More API function tests...
[oweals/gnunet.git] / src / dht / Makefile.am
1 # This Makefile.am is in the public domain
2 AM_CPPFLAGS = -I$(top_srcdir)/src/include
3 if MINGW
4  WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols -lole32 -lshell32 -liconv -lstdc++ -lcomdlg32 -lgdi32
5 endif
6
7 plugindir = $(libdir)/gnunet
8
9 pkgcfgdir= $(pkgdatadir)/config.d/
10
11 libexecdir= $(pkglibdir)/libexec/
12
13 pkgcfg_DATA = \
14   dht.conf
15
16 if USE_COVERAGE
17   AM_CFLAGS = --coverage -O0
18   XLIB = -lgcov
19 endif
20
21 lib_LTLIBRARIES = \
22  libgnunetdht.la
23
24 libgnunetdht_la_SOURCES = \
25   dht_api.c dht.h
26 libgnunetdht_la_LIBADD = \
27   $(top_builddir)/src/util/libgnunetutil.la \
28   $(XLIB) \
29   $(LTLIBINTL)
30 libgnunetdht_la_LDFLAGS = \
31   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
32   -version-info 3:0:0
33
34
35 plugin_LTLIBRARIES = \
36   libgnunet_plugin_block_dht.la
37
38 libgnunet_plugin_block_dht_la_SOURCES = \
39   plugin_block_dht.c
40 libgnunet_plugin_block_dht_la_LIBADD = \
41   $(top_builddir)/src/hello/libgnunethello.la \
42   $(top_builddir)/src/block/libgnunetblock.la \
43   $(top_builddir)/src/block/libgnunetblockgroup.la \
44   $(top_builddir)/src/util/libgnunetutil.la \
45   $(LTLIBINTL)
46 libgnunet_plugin_block_dht_la_LDFLAGS = \
47  $(GN_PLUGIN_LDFLAGS)
48
49
50 libexec_PROGRAMS = \
51  gnunet-service-dht
52
53 if HAVE_EXPERIMENTAL
54 libexec_PROGRAMS += \
55  gnunet-service-dht-xvine \
56  gnunet-service-dht-whanau
57 endif
58
59 noinst_PROGRAMS = \
60  gnunet-dht-monitor \
61  gnunet-dht-get \
62  gnunet-dht-put
63
64 if HAVE_TESTING
65 noinst_PROGRAMS += \
66  gnunet-dht-profiler
67 endif
68
69 gnunet_service_dht_SOURCES = \
70  gnunet-service-dht.c gnunet-service-dht.h \
71  gnunet-service-dht_datacache.c gnunet-service-dht_datacache.h \
72  gnunet-service-dht_hello.c gnunet-service-dht_hello.h \
73  gnunet-service-dht_nse.c gnunet-service-dht_nse.h \
74  gnunet-service-dht_neighbours.c gnunet-service-dht_neighbours.h \
75  gnunet-service-dht_routing.c gnunet-service-dht_routing.h
76 gnunet_service_dht_LDADD = \
77   $(top_builddir)/src/statistics/libgnunetstatistics.la \
78   $(top_builddir)/src/core/libgnunetcore.la \
79   $(top_builddir)/src/nse/libgnunetnse.la \
80   $(top_builddir)/src/ats/libgnunetats.la \
81   $(top_builddir)/src/transport/libgnunettransport.la \
82   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
83   $(top_builddir)/src/hello/libgnunethello.la \
84   $(top_builddir)/src/block/libgnunetblock.la \
85   $(top_builddir)/src/block/libgnunetblockgroup.la \
86   $(top_builddir)/src/datacache/libgnunetdatacache.la \
87   $(top_builddir)/src/util/libgnunetutil.la \
88   -lm
89
90 gnunet_service_dht_xvine_SOURCES = \
91  gnunet-service-xdht.c gnunet-service-dht.h \
92  gnunet-service-dht_datacache.c gnunet-service-dht_datacache.h \
93  gnunet-service-dht_nse.c gnunet-service-dht_nse.h \
94  gnunet-service-xdht_neighbours.c gnunet-service-xdht_neighbours.h \
95  gnunet-service-xdht_routing.c gnunet-service-xdht_routing.h
96
97 gnunet_service_dht_xvine_LDADD = \
98   $(top_builddir)/src/statistics/libgnunetstatistics.la \
99   $(top_builddir)/src/core/libgnunetcore.la \
100   $(top_builddir)/src/nse/libgnunetnse.la \
101   $(top_builddir)/src/ats/libgnunetats.la \
102   $(top_builddir)/src/transport/libgnunettransport.la \
103   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
104   $(top_builddir)/src/hello/libgnunethello.la \
105   $(top_builddir)/src/block/libgnunetblock.la \
106   $(top_builddir)/src/block/libgnunetblockgroup.la \
107   $(top_builddir)/src/datacache/libgnunetdatacache.la \
108   $(top_builddir)/src/util/libgnunetutil.la \
109   -lm
110
111 gnunet_service_dht_whanau_SOURCES = \
112  gnunet-service-wdht.c gnunet-service-wdht.h \
113  gnunet-service-dht_datacache.c gnunet-service-dht_datacache.h \
114  gnunet-service-dht_nse.c gnunet-service-dht_nse.h \
115  gnunet-service-wdht_neighbours.c gnunet-service-dht_neighbours.h
116 gnunet_service_dht_whanau_LDADD = \
117   $(top_builddir)/src/statistics/libgnunetstatistics.la \
118   $(top_builddir)/src/core/libgnunetcore.la \
119   $(top_builddir)/src/nse/libgnunetnse.la \
120   $(top_builddir)/src/ats/libgnunetats.la \
121   $(top_builddir)/src/transport/libgnunettransport.la \
122   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
123   $(top_builddir)/src/hello/libgnunethello.la \
124   $(top_builddir)/src/block/libgnunetblock.la \
125   $(top_builddir)/src/block/libgnunetblockgroup.la \
126   $(top_builddir)/src/datacache/libgnunetdatacache.la \
127   $(top_builddir)/src/util/libgnunetutil.la \
128   -lm
129
130 gnunet_dht_get_SOURCES = \
131  gnunet-dht-get.c
132 gnunet_dht_get_LDADD = \
133   libgnunetdht.la \
134   $(top_builddir)/src/core/libgnunetcore.la \
135   $(top_builddir)/src/util/libgnunetutil.la
136
137 gnunet_dht_put_SOURCES = \
138  gnunet-dht-put.c
139 gnunet_dht_put_LDADD = \
140   libgnunetdht.la \
141   $(top_builddir)/src/core/libgnunetcore.la \
142   $(top_builddir)/src/util/libgnunetutil.la
143
144 gnunet_dht_monitor_SOURCES = \
145  gnunet-dht-monitor.c
146 gnunet_dht_monitor_LDADD = \
147   libgnunetdht.la \
148   $(top_builddir)/src/core/libgnunetcore.la \
149   $(top_builddir)/src/util/libgnunetutil.la
150
151 gnunet_dht_profiler_SOURCES = \
152   gnunet_dht_profiler.c
153 gnunet_dht_profiler_LDADD = \
154   libgnunetdht.la \
155   $(top_builddir)/src/core/libgnunetcore.la \
156   $(top_builddir)/src/util/libgnunetutil.la \
157  $(top_builddir)/src/testbed/libgnunettestbed.la
158
159 if HAVE_TESTING
160 noinst_LIBRARIES = libgnunetdhttest.a
161 endif
162
163 libgnunetdhttest_a_SOURCES = \
164   dht_test_lib.c dht_test_lib.h
165 libgnunetdhttest_a_LIBADD = \
166  $(top_builddir)/src/util/libgnunetutil.la \
167  $(top_builddir)/src/testbed/libgnunettestbed.la \
168  libgnunetdht.la
169
170 if HAVE_TESTING
171 check_PROGRAMS = \
172  test_dht_api \
173  test_dht_twopeer \
174  test_dht_multipeer \
175  test_dht_line \
176  test_dht_2dtorus \
177  test_dht_monitor
178 endif
179
180 if HAVE_EXPERIMENTAL
181 # These tests still do not work as testbed does
182 # not support the respective topology op
183  NEW_TESTS = test_dht_2dtorus test_dht_multipeer
184 endif
185
186 if ENABLE_TEST_RUN
187 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
188 TESTS = test_dht_api $(check_SCRIPTS) \
189  test_dht_twopeer \
190  test_dht_line \
191  test_dht_monitor \
192  $(NEW_TESTS)
193 endif
194
195 test_dht_api_SOURCES = \
196  test_dht_api.c
197 test_dht_api_LDADD = \
198  $(top_builddir)/src/util/libgnunetutil.la \
199  $(top_builddir)/src/testing/libgnunettesting.la \
200  $(top_builddir)/src/hello/libgnunethello.la \
201  libgnunetdht.la
202
203 test_dht_twopeer_SOURCES = \
204  test_dht_topo.c
205 test_dht_twopeer_LDADD = \
206  libgnunetdhttest.a \
207  $(top_builddir)/src/util/libgnunetutil.la \
208  libgnunetdhttest.a \
209  $(top_builddir)/src/testbed/libgnunettestbed.la \
210  libgnunetdht.la
211
212 test_dht_2dtorus_SOURCES = \
213  test_dht_topo.c
214 test_dht_2dtorus_LDADD = \
215  libgnunetdhttest.a \
216  $(top_builddir)/src/util/libgnunetutil.la \
217  $(top_builddir)/src/testbed/libgnunettestbed.la \
218  libgnunetdht.la
219
220 test_dht_line_SOURCES = \
221  test_dht_topo.c
222 test_dht_line_LDADD = \
223  libgnunetdhttest.a \
224  $(top_builddir)/src/util/libgnunetutil.la \
225  $(top_builddir)/src/testbed/libgnunettestbed.la \
226  libgnunetdht.la
227
228 test_dht_multipeer_SOURCES = \
229  test_dht_topo.c
230 test_dht_multipeer_LDADD = \
231  libgnunetdhttest.a \
232  $(top_builddir)/src/util/libgnunetutil.la \
233  $(top_builddir)/src/statistics/libgnunetstatistics.la \
234  $(top_builddir)/src/testbed/libgnunettestbed.la \
235  libgnunetdht.la
236
237 test_dht_monitor_SOURCES = \
238   test_dht_monitor.c
239 test_dht_monitor_LDADD = \
240  libgnunetdhttest.a \
241  $(top_builddir)/src/util/libgnunetutil.la \
242  $(top_builddir)/src/testbed/libgnunettestbed.la \
243  libgnunetdht.la
244
245 EXTRA_DIST = \
246   $(check_SCRIPTS) \
247   test_dht_api_data.conf \
248   test_dht_api_peer1.conf \
249   test_dht_monitor.conf \
250   test_dht_multipeer.conf \
251   test_dht_2dtorus.conf \
252   test_dht_line.conf \
253   test_dht_tools.py.in \
254   test_dht_multipeer_topology.dat
255
256 if HAVE_PYTHON
257 check_SCRIPTS = \
258   test_dht_tools.py
259 endif
260
261 do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g' -e 's,[@]bindir[@],$(bindir),g'
262
263 %.py: %.py.in Makefile
264         $(do_subst) < $(srcdir)/$< > $@
265         chmod +x $@
266
267 test_dht_tools.py: test_dht_tools.py.in Makefile
268         $(do_subst) < $(srcdir)/test_dht_tools.py.in > test_dht_tools.py
269         chmod +x test_dht_tools.py