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