-fix ftbfs issues
[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 2:0:2
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/util/libgnunetutil.la \
44   $(LTLIBINTL)
45 libgnunet_plugin_block_dht_la_LDFLAGS = \
46  $(GN_PLUGIN_LDFLAGS)
47
48
49 libexec_PROGRAMS = \
50  gnunet-service-dht \
51  gnunet-service-dht-xvine \
52  gnunet-service-dht-whanau
53
54 noinst_PROGRAMS = \
55  gnunet-dht-monitor \
56  gnunet-dht-get \
57  gnunet-dht-put \
58  gnunet-dht-profiler
59
60 gnunet_service_dht_SOURCES = \
61  gnunet-service-dht.c gnunet-service-dht.h \
62  gnunet-service-dht_clients.c gnunet-service-dht_clients.h \
63  gnunet-service-dht_datacache.c gnunet-service-dht_datacache.h \
64  gnunet-service-dht_hello.c gnunet-service-dht_hello.h \
65  gnunet-service-dht_nse.c gnunet-service-dht_nse.h \
66  gnunet-service-dht_neighbours.c gnunet-service-dht_neighbours.h \
67  gnunet-service-dht_routing.c gnunet-service-dht_routing.h
68 gnunet_service_dht_LDADD = \
69   $(top_builddir)/src/statistics/libgnunetstatistics.la \
70   $(top_builddir)/src/core/libgnunetcore.la \
71   $(top_builddir)/src/nse/libgnunetnse.la \
72   $(top_builddir)/src/ats/libgnunetats.la \
73   $(top_builddir)/src/transport/libgnunettransport.la \
74   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
75   $(top_builddir)/src/hello/libgnunethello.la \
76   $(top_builddir)/src/block/libgnunetblock.la \
77   $(top_builddir)/src/datacache/libgnunetdatacache.la \
78   $(top_builddir)/src/util/libgnunetutil.la \
79   -lm
80
81 gnunet_service_dht_xvine_SOURCES = \
82  gnunet-service-xdht.c gnunet-service-xdht.h \
83  gnunet-service-xdht_clients.c gnunet-service-xdht_clients.h \
84  gnunet-service-xdht_datacache.c gnunet-service-xdht_datacache.h \
85  gnunet-service-xdht_nse.c gnunet-service-xdht_nse.h \
86  gnunet-service-xdht_neighbours.c gnunet-service-xdht_neighbours.h \
87  gnunet-service-xdht_routing.c gnunet-service-xdht_routing.h
88
89 gnunet_service_dht_xvine_LDADD = \
90   $(top_builddir)/src/statistics/libgnunetstatistics.la \
91   $(top_builddir)/src/core/libgnunetcore.la \
92   $(top_builddir)/src/nse/libgnunetnse.la \
93   $(top_builddir)/src/ats/libgnunetats.la \
94   $(top_builddir)/src/transport/libgnunettransport.la \
95   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
96   $(top_builddir)/src/hello/libgnunethello.la \
97   $(top_builddir)/src/block/libgnunetblock.la \
98   $(top_builddir)/src/datacache/libgnunetdatacache.la \
99   $(top_builddir)/src/util/libgnunetutil.la \
100   -lm
101
102 gnunet_service_dht_whanau_SOURCES = \
103  gnunet-service-wdht.c gnunet-service-wdht.h \
104  gnunet-service-wdht_clients.c gnunet-service-wdht_clients.h \
105  gnunet-service-wdht_datacache.c gnunet-service-wdht_datacache.h \
106  gnunet-service-wdht_nse.c gnunet-service-wdht_nse.h \
107  gnunet-service-wdht_neighbours.c gnunet-service-wdht_neighbours.h
108 gnunet_service_dht_whanau_LDADD = \
109   $(top_builddir)/src/statistics/libgnunetstatistics.la \
110   $(top_builddir)/src/core/libgnunetcore.la \
111   $(top_builddir)/src/nse/libgnunetnse.la \
112   $(top_builddir)/src/ats/libgnunetats.la \
113   $(top_builddir)/src/transport/libgnunettransport.la \
114   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
115   $(top_builddir)/src/hello/libgnunethello.la \
116   $(top_builddir)/src/block/libgnunetblock.la \
117   $(top_builddir)/src/datacache/libgnunetdatacache.la \
118   $(top_builddir)/src/util/libgnunetutil.la \
119   -lm
120
121 gnunet_dht_get_SOURCES = \
122  gnunet-dht-get.c
123 gnunet_dht_get_LDADD = \
124   libgnunetdht.la \
125   $(top_builddir)/src/core/libgnunetcore.la \
126   $(top_builddir)/src/util/libgnunetutil.la
127
128 gnunet_dht_put_SOURCES = \
129  gnunet-dht-put.c
130 gnunet_dht_put_LDADD = \
131   libgnunetdht.la \
132   $(top_builddir)/src/core/libgnunetcore.la \
133   $(top_builddir)/src/util/libgnunetutil.la
134
135 gnunet_dht_monitor_SOURCES = \
136  gnunet-dht-monitor.c
137 gnunet_dht_monitor_LDADD = \
138   libgnunetdht.la \
139   $(top_builddir)/src/core/libgnunetcore.la \
140   $(top_builddir)/src/util/libgnunetutil.la
141
142 gnunet_dht_profiler_SOURCES = \
143   gnunet_dht_profiler.c
144 gnunet_dht_profiler_LDADD = \
145   libgnunetdht.la \
146   $(top_builddir)/src/core/libgnunetcore.la \
147   $(top_builddir)/src/util/libgnunetutil.la \
148  $(top_builddir)/src/testbed/libgnunettestbed.la
149
150 if HAVE_TESTING
151 noinst_LIBRARIES = libgnunetdhttest.a
152 endif
153
154 libgnunetdhttest_a_SOURCES = \
155   dht_test_lib.c dht_test_lib.h
156 libgnunetdhttest_a_LIBADD = \
157  $(top_builddir)/src/util/libgnunetutil.la \
158  $(top_builddir)/src/testbed/libgnunettestbed.la \
159  libgnunetdht.la
160
161 if HAVE_TESTING
162 check_PROGRAMS = \
163  test_dht_api \
164  test_dht_twopeer \
165  test_dht_multipeer \
166  test_dht_line \
167  test_dht_2dtorus \
168  test_dht_monitor
169 endif
170
171 if HAVE_EXPERIMENTAL
172 # These tests still do not work as testbed does
173 # not support the respective topology op
174  NEW_TESTS = test_dht_2dtorus test_dht_multipeer
175 endif
176
177 if ENABLE_TEST_RUN
178 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
179 TESTS = test_dht_api $(check_SCRIPTS) \
180  test_dht_twopeer \
181  test_dht_line \
182  test_dht_monitor \
183  $(NEW_TESTS)
184 endif
185
186 test_dht_api_SOURCES = \
187  test_dht_api.c
188 test_dht_api_LDADD = \
189  $(top_builddir)/src/util/libgnunetutil.la \
190  $(top_builddir)/src/testing/libgnunettesting.la \
191  $(top_builddir)/src/hello/libgnunethello.la \
192  libgnunetdht.la
193
194 test_dht_twopeer_SOURCES = \
195  test_dht_topo.c
196 test_dht_twopeer_LDADD = \
197  libgnunetdhttest.a \
198  $(top_builddir)/src/util/libgnunetutil.la \
199  libgnunetdhttest.a \
200  $(top_builddir)/src/testbed/libgnunettestbed.la \
201  libgnunetdht.la
202
203 test_dht_2dtorus_SOURCES = \
204  test_dht_topo.c
205 test_dht_2dtorus_LDADD = \
206  libgnunetdhttest.a \
207  $(top_builddir)/src/util/libgnunetutil.la \
208  $(top_builddir)/src/testbed/libgnunettestbed.la \
209  libgnunetdht.la
210
211 test_dht_line_SOURCES = \
212  test_dht_topo.c
213 test_dht_line_LDADD = \
214  libgnunetdhttest.a \
215  $(top_builddir)/src/util/libgnunetutil.la \
216  $(top_builddir)/src/testbed/libgnunettestbed.la \
217  libgnunetdht.la
218
219 test_dht_multipeer_SOURCES = \
220  test_dht_topo.c
221 test_dht_multipeer_LDADD = \
222  libgnunetdhttest.a \
223  $(top_builddir)/src/util/libgnunetutil.la \
224  $(top_builddir)/src/statistics/libgnunetstatistics.la \
225  $(top_builddir)/src/testbed/libgnunettestbed.la \
226  libgnunetdht.la
227
228 test_dht_monitor_SOURCES = \
229   test_dht_monitor.c
230 test_dht_monitor_LDADD = \
231  libgnunetdhttest.a \
232  $(top_builddir)/src/util/libgnunetutil.la \
233  $(top_builddir)/src/testbed/libgnunettestbed.la \
234  libgnunetdht.la
235
236 EXTRA_DIST = \
237   $(check_SCRIPTS) \
238   test_dht_api_data.conf \
239   test_dht_api_peer1.conf \
240   test_dht_monitor.conf \
241   test_dht_multipeer.conf \
242   test_dht_2dtorus.conf \
243   test_dht_line.conf \
244   test_dht_tools.py.in \
245   test_dht_multipeer_topology.dat
246
247 if HAVE_PYTHON
248 check_SCRIPTS = \
249   test_dht_tools.py
250 endif
251
252 do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g'
253
254 %.py: %.py.in Makefile
255         $(do_subst) < $(srcdir)/$< > $@
256         chmod +x $@
257
258 test_dht_tools.py: test_dht_tools.py.in Makefile
259         $(do_subst) < $(srcdir)/test_dht_tools.py.in > test_dht_tools.py
260         chmod +x test_dht_tools.py