0baf6b00e0618560f97534395bada34453b271e9
[oweals/gnunet.git] / src / dht / Makefile.am
1 INCLUDES = -I$(top_srcdir)/src/include
2 if MINGW
3  WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols -lole32 -lshell32 -liconv -lstdc++ -lcomdlg32 -lgdi32
4 endif
5
6 plugindir = $(libdir)/gnunet
7
8 pkgcfgdir= $(pkgdatadir)/config.d/
9
10 libexecdir= $(pkglibdir)/libexec/
11
12 pkgcfg_DATA = \
13   dht.conf 
14
15 if HAVE_ZLIB
16  ZLIB_LNK = -lz
17 endif
18
19 if USE_COVERAGE
20   AM_CFLAGS = --coverage -O0
21   XLIB = -lgcov
22 endif
23
24 lib_LTLIBRARIES = \
25  libgnunetdht.la 
26
27 libgnunetdht_la_SOURCES = \
28   dht_api.c dht.h 
29 libgnunetdht_la_LIBADD = \
30   $(top_builddir)/src/util/libgnunetutil.la \
31   $(XLIB) \
32   $(LTLIBINTL)
33 libgnunetdht_la_LDFLAGS = \
34   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
35   -version-info 1:0:1
36
37
38 plugin_LTLIBRARIES = \
39   libgnunet_plugin_block_dht.la 
40
41 libgnunet_plugin_block_dht_la_SOURCES = \
42   plugin_block_dht.c
43 libgnunet_plugin_block_dht_la_LIBADD = \
44   $(top_builddir)/src/hello/libgnunethello.la \
45   $(top_builddir)/src/block/libgnunetblock.la \
46   $(top_builddir)/src/util/libgnunetutil.la \
47   $(LTLIBINTL)
48 libgnunet_plugin_block_dht_la_LDFLAGS = \
49  $(GN_PLUGIN_LDFLAGS)
50 libgnunet_plugin_block_dht_la_DEPENDENCIES = \
51   $(top_builddir)/src/block/libgnunetblock.la 
52
53
54
55 libexec_PROGRAMS = \
56  gnunet-service-dht 
57
58 noinst_PROGRAMS = \
59  gnunet-dht-monitor \
60  gnunet-dht-get \
61  gnunet-dht-put
62
63 gnunet_service_dht_SOURCES = \
64  gnunet-service-dht.c gnunet-service-dht.h \
65  gnunet-service-dht_clients.c gnunet-service-dht_clients.h \
66  gnunet-service-dht_datacache.c gnunet-service-dht_datacache.h \
67  gnunet-service-dht_hello.c gnunet-service-dht_hello.h \
68  gnunet-service-dht_nse.c gnunet-service-dht_nse.h \
69  gnunet-service-dht_neighbours.c gnunet-service-dht_neighbours.h \
70  gnunet-service-dht_routing.c gnunet-service-dht_routing.h 
71 gnunet_service_dht_LDADD = \
72   $(top_builddir)/src/statistics/libgnunetstatistics.la \
73   $(top_builddir)/src/core/libgnunetcore.la \
74   $(top_builddir)/src/nse/libgnunetnse.la \
75   $(top_builddir)/src/ats/libgnunetats.la \
76   $(top_builddir)/src/transport/libgnunettransport.la \
77   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
78   $(top_builddir)/src/hello/libgnunethello.la \
79   $(top_builddir)/src/block/libgnunetblock.la \
80   $(top_builddir)/src/datacache/libgnunetdatacache.la \
81   $(top_builddir)/src/util/libgnunetutil.la \
82   -lm
83
84 gnunet_dht_get_SOURCES = \
85  gnunet-dht-get.c         
86 gnunet_dht_get_LDADD = \
87   $(top_builddir)/src/dht/libgnunetdht.la \
88   $(top_builddir)/src/core/libgnunetcore.la \
89   $(top_builddir)/src/util/libgnunetutil.la 
90 gnunet_dht_get_DEPENDENCIES = \
91   libgnunetdht.la                             
92
93 gnunet_dht_put_SOURCES = \
94  gnunet-dht-put.c         
95 gnunet_dht_put_LDADD = \
96   $(top_builddir)/src/dht/libgnunetdht.la \
97   $(top_builddir)/src/core/libgnunetcore.la \
98   $(top_builddir)/src/util/libgnunetutil.la 
99 gnunet_dht_put_DEPENDENCIES = \
100   libgnunetdht.la                             
101
102 gnunet_dht_monitor_SOURCES = \
103  gnunet-dht-monitor.c         
104 gnunet_dht_monitor_LDADD = \
105   $(top_builddir)/src/dht/libgnunetdht.la \
106   $(top_builddir)/src/core/libgnunetcore.la \
107   $(top_builddir)/src/util/libgnunetutil.la 
108 gnunet_dht_monitor_DEPENDENCIES = \
109   libgnunetdht.la                             
110
111
112 noinst_LIBRARIES = libgnunetdhttest.a
113
114 libgnunetdhttest_a_SOURCES = \
115   dht_test_lib.c dht_test_lib.h
116 libgnunetdhttest_a_LIBADD = \
117  $(top_builddir)/src/util/libgnunetutil.la \
118  $(top_builddir)/src/testbed/libgnunettestbed.la \
119  $(top_builddir)/src/dht/libgnunetdht.la
120 libgnunetdhttest_a_DEPENDENCIES = \
121   libgnunetdht.la   
122
123 check_PROGRAMS = \
124  test_dht_api \
125  test_dht_twopeer \
126  test_dht_multipeer \
127  test_dht_line \
128  test_dht_2dtorus 
129 # test_dht_monitor
130
131 if HAVE_EXPERIMENTAL
132 # These tests still do not work as testbed does
133 # not support the respective topology op
134  NEW_TESTS = test_dht_2dtorus test_dht_multipeer
135 endif
136
137 if ENABLE_TEST_RUN
138 TESTS = test_dht_api $(check_SCRIPTS) \
139  test_dht_twopeer \
140  test_dht_line \
141  $(NEW_TESTS) 
142 # test_dht_monitor
143 endif
144
145 test_dht_api_SOURCES = \
146  test_dht_api.c
147 test_dht_api_LDADD = \
148  $(top_builddir)/src/util/libgnunetutil.la \
149  $(top_builddir)/src/testing/libgnunettesting.la \
150  $(top_builddir)/src/hello/libgnunethello.la \
151  $(top_builddir)/src/dht/libgnunetdht.la
152 test_dht_api_DEPENDENCIES = \
153   libgnunetdht.la                           
154
155 test_dht_twopeer_SOURCES = \
156  test_dht_topo.c
157 test_dht_twopeer_LDADD = \
158  $(top_builddir)/src/util/libgnunetutil.la \
159  $(top_builddir)/src/testing_old/libgnunettesting_old.la \
160  $(top_builddir)/src/dht/libgnunetdht.la    
161 test_dht_twopeer_DEPENDENCIES = \
162   libgnunetdht.la                           
163
164 test_dht_2dtorus_SOURCES = \
165  test_dht_topo.c
166 test_dht_2dtorus_LDADD = \
167  $(top_builddir)/src/dht/libgnunetdhttest.a \
168  $(top_builddir)/src/util/libgnunetutil.la \
169  $(top_builddir)/src/testbed/libgnunettestbed.la \
170  $(top_builddir)/src/dht/libgnunetdht.la
171 test_dht_2dtorus_DEPENDENCIES = \
172   libgnunetdht.la
173
174 test_dht_line_SOURCES = \
175  test_dht_topo.c
176 test_dht_line_LDADD = \
177  $(top_builddir)/src/dht/libgnunetdhttest.a \
178  $(top_builddir)/src/util/libgnunetutil.la \
179  $(top_builddir)/src/testbed/libgnunettestbed.la \
180  $(top_builddir)/src/dht/libgnunetdht.la 
181 test_dht_line_DEPENDENCIES = \
182   libgnunetdht.la
183
184 test_dht_multipeer_SOURCES = \
185  test_dht_topo.c
186 test_dht_multipeer_LDADD = \
187  $(top_builddir)/src/util/libgnunetutil.la \
188  $(top_builddir)/src/statistics/libgnunetstatistics.la \
189  $(top_builddir)/src/testing_old/libgnunettesting_old.la \
190  $(top_builddir)/src/dht/libgnunetdht.la  
191 test_dht_multipeer_DEPENDENCIES = \
192   libgnunetdht.la                           
193
194 # fixme, rewrite based on test_dht_topo.c!
195 test_dht_monitor_SOURCES = test_dht_monitor.c
196 test_dht_monitor_LDADD = \
197  $(top_builddir)/src/util/libgnunetutil.la \
198  $(top_builddir)/src/testing_old/libgnunettesting_old.la \
199  $(top_builddir)/src/dht/libgnunetdht.la
200 test_dht_monitor_DEPENDENCIES = \
201   libgnunetdht.la
202
203 EXTRA_DIST = \
204   $(check_SCRIPTS) \
205   test_dht_api_data.conf \
206   test_dht_api_peer1.conf \
207   test_dht_twopeer_data.conf \
208   test_dht_multipeer.conf \
209   test_dht_2dtorus.conf \
210   test_dht_line.conf \
211   test_dht_tools.py.in \
212   test_dht_multipeer_topology.dat
213
214 check_SCRIPTS = \
215   test_dht_tools.py
216
217 do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g'
218
219 %.py: %.py.in Makefile
220         $(do_subst) < $(srcdir)/$< > $@
221         chmod +x $@
222
223 test_dht_tools.py: test_dht_tools.py.in Makefile
224         $(do_subst) < $(srcdir)/test_dht_tools.py.in > test_dht_tools.py
225         chmod +x test_dht_tools.py