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