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