clean up new block logic, avoid direct linkage against blockgroup lib from DHT service
[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/datacache/libgnunetdatacache.la \
86   $(top_builddir)/src/util/libgnunetutil.la \
87   -lm
88
89 gnunet_service_dht_xvine_SOURCES = \
90  gnunet-service-xdht.c gnunet-service-dht.h \
91  gnunet-service-dht_datacache.c gnunet-service-dht_datacache.h \
92  gnunet-service-dht_nse.c gnunet-service-dht_nse.h \
93  gnunet-service-xdht_neighbours.c gnunet-service-xdht_neighbours.h \
94  gnunet-service-xdht_routing.c gnunet-service-xdht_routing.h
95
96 gnunet_service_dht_xvine_LDADD = \
97   $(top_builddir)/src/statistics/libgnunetstatistics.la \
98   $(top_builddir)/src/core/libgnunetcore.la \
99   $(top_builddir)/src/nse/libgnunetnse.la \
100   $(top_builddir)/src/ats/libgnunetats.la \
101   $(top_builddir)/src/transport/libgnunettransport.la \
102   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
103   $(top_builddir)/src/hello/libgnunethello.la \
104   $(top_builddir)/src/block/libgnunetblock.la \
105   $(top_builddir)/src/block/libgnunetblockgroup.la \
106   $(top_builddir)/src/datacache/libgnunetdatacache.la \
107   $(top_builddir)/src/util/libgnunetutil.la \
108   -lm
109
110 gnunet_service_dht_whanau_SOURCES = \
111  gnunet-service-wdht.c gnunet-service-wdht.h \
112  gnunet-service-dht_datacache.c gnunet-service-dht_datacache.h \
113  gnunet-service-dht_nse.c gnunet-service-dht_nse.h \
114  gnunet-service-wdht_neighbours.c gnunet-service-dht_neighbours.h
115 gnunet_service_dht_whanau_LDADD = \
116   $(top_builddir)/src/statistics/libgnunetstatistics.la \
117   $(top_builddir)/src/core/libgnunetcore.la \
118   $(top_builddir)/src/nse/libgnunetnse.la \
119   $(top_builddir)/src/ats/libgnunetats.la \
120   $(top_builddir)/src/transport/libgnunettransport.la \
121   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
122   $(top_builddir)/src/hello/libgnunethello.la \
123   $(top_builddir)/src/block/libgnunetblock.la \
124   $(top_builddir)/src/block/libgnunetblockgroup.la \
125   $(top_builddir)/src/datacache/libgnunetdatacache.la \
126   $(top_builddir)/src/util/libgnunetutil.la \
127   -lm
128
129 gnunet_dht_get_SOURCES = \
130  gnunet-dht-get.c
131 gnunet_dht_get_LDADD = \
132   libgnunetdht.la \
133   $(top_builddir)/src/core/libgnunetcore.la \
134   $(top_builddir)/src/util/libgnunetutil.la
135
136 gnunet_dht_put_SOURCES = \
137  gnunet-dht-put.c
138 gnunet_dht_put_LDADD = \
139   libgnunetdht.la \
140   $(top_builddir)/src/core/libgnunetcore.la \
141   $(top_builddir)/src/util/libgnunetutil.la
142
143 gnunet_dht_monitor_SOURCES = \
144  gnunet-dht-monitor.c
145 gnunet_dht_monitor_LDADD = \
146   libgnunetdht.la \
147   $(top_builddir)/src/core/libgnunetcore.la \
148   $(top_builddir)/src/util/libgnunetutil.la
149
150 gnunet_dht_profiler_SOURCES = \
151   gnunet_dht_profiler.c
152 gnunet_dht_profiler_LDADD = \
153   libgnunetdht.la \
154   $(top_builddir)/src/core/libgnunetcore.la \
155   $(top_builddir)/src/util/libgnunetutil.la \
156  $(top_builddir)/src/testbed/libgnunettestbed.la
157
158 if HAVE_TESTING
159 noinst_LIBRARIES = libgnunetdhttest.a
160 endif
161
162 libgnunetdhttest_a_SOURCES = \
163   dht_test_lib.c dht_test_lib.h
164 libgnunetdhttest_a_LIBADD = \
165  $(top_builddir)/src/util/libgnunetutil.la \
166  $(top_builddir)/src/testbed/libgnunettestbed.la \
167  libgnunetdht.la
168
169 if HAVE_TESTING
170 check_PROGRAMS = \
171  test_dht_api \
172  test_dht_twopeer \
173  test_dht_multipeer \
174  test_dht_line \
175  test_dht_2dtorus \
176  test_dht_monitor
177 endif
178
179 if HAVE_EXPERIMENTAL
180 # These tests still do not work as testbed does
181 # not support the respective topology op
182  NEW_TESTS = test_dht_2dtorus test_dht_multipeer
183 endif
184
185 if ENABLE_TEST_RUN
186 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
187 TESTS = test_dht_api $(check_SCRIPTS) \
188  test_dht_twopeer \
189  test_dht_line \
190  test_dht_monitor \
191  $(NEW_TESTS)
192 endif
193
194 test_dht_api_SOURCES = \
195  test_dht_api.c
196 test_dht_api_LDADD = \
197  $(top_builddir)/src/util/libgnunetutil.la \
198  $(top_builddir)/src/testing/libgnunettesting.la \
199  $(top_builddir)/src/hello/libgnunethello.la \
200  libgnunetdht.la
201
202 test_dht_twopeer_SOURCES = \
203  test_dht_topo.c
204 test_dht_twopeer_LDADD = \
205  libgnunetdhttest.a \
206  $(top_builddir)/src/util/libgnunetutil.la \
207  libgnunetdhttest.a \
208  $(top_builddir)/src/testbed/libgnunettestbed.la \
209  libgnunetdht.la
210
211 test_dht_2dtorus_SOURCES = \
212  test_dht_topo.c
213 test_dht_2dtorus_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_line_SOURCES = \
220  test_dht_topo.c
221 test_dht_line_LDADD = \
222  libgnunetdhttest.a \
223  $(top_builddir)/src/util/libgnunetutil.la \
224  $(top_builddir)/src/testbed/libgnunettestbed.la \
225  libgnunetdht.la
226
227 test_dht_multipeer_SOURCES = \
228  test_dht_topo.c
229 test_dht_multipeer_LDADD = \
230  libgnunetdhttest.a \
231  $(top_builddir)/src/util/libgnunetutil.la \
232  $(top_builddir)/src/statistics/libgnunetstatistics.la \
233  $(top_builddir)/src/testbed/libgnunettestbed.la \
234  libgnunetdht.la
235
236 test_dht_monitor_SOURCES = \
237   test_dht_monitor.c
238 test_dht_monitor_LDADD = \
239  libgnunetdhttest.a \
240  $(top_builddir)/src/util/libgnunetutil.la \
241  $(top_builddir)/src/testbed/libgnunettestbed.la \
242  libgnunetdht.la
243
244 EXTRA_DIST = \
245   $(check_SCRIPTS) \
246   test_dht_api_data.conf \
247   test_dht_api_peer1.conf \
248   test_dht_monitor.conf \
249   test_dht_multipeer.conf \
250   test_dht_2dtorus.conf \
251   test_dht_line.conf \
252   test_dht_tools.py.in \
253   test_dht_multipeer_topology.dat
254
255 if HAVE_PYTHON
256 check_SCRIPTS = \
257   test_dht_tools.py
258 endif
259
260 do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g' -e 's,[@]bindir[@],$(bindir),g'
261
262 %.py: %.py.in Makefile
263         $(do_subst) < $(srcdir)/$< > $@
264         chmod +x $@
265
266 test_dht_tools.py: test_dht_tools.py.in Makefile
267         $(do_subst) < $(srcdir)/test_dht_tools.py.in > test_dht_tools.py
268         chmod +x test_dht_tools.py