Make building gnunet-testing lib optional.
[oweals/gnunet.git] / src / mesh / Makefile.am
1 INCLUDES = -I$(top_srcdir)/src/include
2
3 if MINGW
4   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
5 endif
6
7 if USE_COVERAGE
8   AM_CFLAGS = --coverage -O0
9   XLIB = -lgcov
10 endif
11
12 pkgcfgdir= $(pkgdatadir)/config.d/
13
14 libexecdir= $(pkglibdir)/libexec/
15
16 pkgcfg_DATA = \
17   mesh.conf
18
19 plugindir = $(libdir)/gnunet
20
21 AM_CLFAGS = -g
22
23 if HAVE_EXPERIMENTAL
24   noinst_LIB_EXP = libgnunetmesh2test.a
25   EXP_LIB = libgnunetmesh2.la
26   EXP_LIBEXEC = gnunet-service-mesh-new
27   EXP_TESTS = \
28     test_mesh2_local \
29     test_mesh2_small_forward
30 endif
31
32 libexec_PROGRAMS = \
33  gnunet-service-mesh $(EXP_LIBEXEC)
34
35 bin_PROGRAMS = \
36  gnunet-mesh
37
38 lib_LTLIBRARIES = \
39   libgnunetmesh.la $(EXP_LIB)
40
41 plugin_LTLIBRARIES = \
42  libgnunet_plugin_block_mesh.la
43
44 libgnunet_plugin_block_mesh_la_SOURCES = \
45  plugin_block_mesh.c
46 libgnunet_plugin_block_mesh_la_LIBADD = \
47  $(top_builddir)/src/block/libgnunetblock.la \
48  $(top_builddir)/src/util/libgnunetutil.la
49 libgnunet_plugin_block_mesh_la_LDFLAGS = \
50  $(GN_PLUGIN_LDFLAGS)
51 libgnunet_plugin_block_mesh_la_DEPENDENCIES = \
52  $(top_builddir)/src/block/libgnunetblock.la \
53  $(top_builddir)/src/util/libgnunetutil.la
54
55 libgnunetmesh_la_SOURCES = \
56   mesh_api.c mesh_common.c
57 libgnunetmesh_la_LIBADD = \
58   $(top_builddir)/src/util/libgnunetutil.la \
59   $(XLIB) \
60   $(LTLIBINTL)
61 libgnunetmesh_la_LDFLAGS = \
62   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
63   -version-info 2:1:1
64
65 libgnunetmesh2_la_SOURCES = \
66   mesh2_api.c mesh_common.c
67 libgnunetmesh2_la_LIBADD = \
68   $(top_builddir)/src/util/libgnunetutil.la \
69   $(XLIB) \
70   $(LTLIBINTL)
71 libgnunetmesh2_la_LDFLAGS = \
72   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
73   -version-info 2:2:1
74
75
76 gnunet_service_mesh_SOURCES = \
77  gnunet-service-mesh.c \
78  mesh_tunnel_tree.c mesh_tunnel_tree.h \
79  mesh_common.c
80 gnunet_service_mesh_CFLAGS = $(AM_CFLAGS)
81 gnunet_service_mesh_LDADD = \
82   $(top_builddir)/src/statistics/libgnunetstatistics.la \
83   $(top_builddir)/src/regex/libgnunetregex.la \
84   $(top_builddir)/src/util/libgnunetutil.la \
85   $(top_builddir)/src/core/libgnunetcore.la \
86   $(top_builddir)/src/dht/libgnunetdht.la \
87   $(top_builddir)/src/block/libgnunetblock.la 
88 gnunet_service_mesh_DEPENDENCIES = \
89   $(top_builddir)/src/util/libgnunetutil.la \
90   $(top_builddir)/src/core/libgnunetcore.la \
91   $(top_builddir)/src/dht/libgnunetdht.la \
92   $(top_builddir)/src/statistics/libgnunetstatistics.la \
93   $(top_builddir)/src/block/libgnunetblock.la \
94   $(top_builddir)/src/regex/libgnunetregex.la
95 if LINUX
96 gnunet_service_mesh_LDFLAGS = -lrt
97 endif
98
99 gnunet_mesh_SOURCES = \
100   gnunet-mesh.c
101 gnunet_mesh_LDADD = \
102   $(top_builddir)/src/mesh/libgnunetmesh.la \
103   $(top_builddir)/src/util/libgnunetutil.la
104 gnunet_mesh_DEPENDENCIES = \
105   libgnunetmesh.la
106
107 gnunet_service_mesh_new_SOURCES = \
108  gnunet-service-mesh-new.c \
109  mesh_path.c \
110  mesh_common.c
111 gnunet_service_mesh_new_CFLAGS = $(AM_CFLAGS)
112 gnunet_service_mesh_new_LDADD = \
113   $(top_builddir)/src/util/libgnunetutil.la \
114   $(top_builddir)/src/core/libgnunetcore.la \
115   $(top_builddir)/src/dht/libgnunetdht.la \
116   $(top_builddir)/src/statistics/libgnunetstatistics.la \
117   $(top_builddir)/src/block/libgnunetblock.la
118 gnunet_service_mesh_new_DEPENDENCIES = \
119   $(top_builddir)/src/util/libgnunetutil.la \
120   $(top_builddir)/src/core/libgnunetcore.la \
121   $(top_builddir)/src/dht/libgnunetdht.la \
122   $(top_builddir)/src/statistics/libgnunetstatistics.la \
123   $(top_builddir)/src/block/libgnunetblock.la
124 if LINUX
125 gnunet_service_mesh_new_LDFLAGS = -lrt
126 endif
127
128 if HAVE_TESTING
129 noinst_LIBRARIES = libgnunetmeshtest.a $(noinst_LIB_EXP)
130 endif
131
132 libgnunetmeshtest_a_SOURCES = \
133   mesh_test_lib.c mesh_test_lib.h
134 libgnunetmeshtest_a_LIBADD = \
135  $(top_builddir)/src/util/libgnunetutil.la \
136  $(top_builddir)/src/testbed/libgnunettestbed.la \
137  $(top_builddir)/src/mesh/libgnunetmesh.la
138 libgnunetmeshtest_a_DEPENDENCIES = \
139   libgnunetmesh.la
140
141 libgnunetmesh2test_a_SOURCES = \
142   mesh2_test_lib.c mesh2_test_lib.h
143 libgnunetmesh2test_a_LIBADD = \
144  $(top_builddir)/src/util/libgnunetutil.la \
145  $(top_builddir)/src/testbed/libgnunettestbed.la \
146  $(top_builddir)/src/mesh/libgnunetmesh2.la
147 libgnunetmesh2test_a_DEPENDENCIES = \
148   libgnunetmesh2.la
149
150 if HAVE_TESTING
151 check_PROGRAMS = \
152  test_mesh_api \
153  test_mesh_tree_api \
154  test_mesh_local_1 \
155  test_mesh_local_2 \
156  test_mesh_local_traffic_fwd \
157  test_mesh_local_traffic_bck \
158  test_mesh_local_traffic_both \
159  test_mesh_2dtorus \
160  test_mesh_small_unicast \
161  test_mesh_small_signal \
162  test_mesh_small_speed \
163  test_mesh_small_speed_nobuf \
164  test_mesh_small_speed_backwards \
165  test_mesh_small_speed_nobuf_backwards \
166  test_mesh_small_speed_ack \
167  $(EXP_TESTS)
168 endif
169
170 test_mesh_api_SOURCES = \
171  test_mesh_api.c
172 test_mesh_api_LDADD = \
173  $(top_builddir)/src/util/libgnunetutil.la \
174  $(top_builddir)/src/testing/libgnunettesting.la \
175  $(top_builddir)/src/mesh/libgnunetmesh.la
176 test_mesh_api_DEPENDENCIES = \
177   libgnunetmesh.la \
178    $(top_builddir)/src/util/libgnunetutil.la
179
180 test_mesh_tree_api_SOURCES = \
181  test_mesh_tree_api.c
182 test_mesh_tree_api_LDADD = \
183  $(top_builddir)/src/util/libgnunetutil.la \
184  $(top_builddir)/src/dht/libgnunetdht.la
185 test_mesh_tree_api_DEPENDENCIES = \
186   libgnunetmesh.la \
187   $(top_builddir)/src/dht/libgnunetdht.la
188
189 test_mesh_local_1_SOURCES = \
190  test_mesh_local_1.c
191 test_mesh_local_1_LDADD = \
192  $(top_builddir)/src/util/libgnunetutil.la \
193  $(top_builddir)/src/testing/libgnunettesting.la \
194  $(top_builddir)/src/mesh/libgnunetmesh.la
195 test_mesh_local_1_DEPENDENCIES = \
196   libgnunetmesh.la
197
198 test_mesh_local_2_SOURCES = \
199  test_mesh_local_2.c
200 test_mesh_local_2_LDADD = \
201  $(top_builddir)/src/util/libgnunetutil.la \
202  $(top_builddir)/src/testing/libgnunettesting.la \
203  $(top_builddir)/src/mesh/libgnunetmesh.la
204 test_mesh_local_2_DEPENDENCIES = \
205   libgnunetmesh.la
206
207 test_mesh_local_traffic_fwd_SOURCES = \
208  test_mesh_local_traffic.c
209 test_mesh_local_traffic_fwd_LDADD = \
210  $(top_builddir)/src/util/libgnunetutil.la \
211  $(top_builddir)/src/testing/libgnunettesting.la \
212  $(top_builddir)/src/mesh/libgnunetmesh.la
213 test_mesh_local_traffic_fwd_DEPENDENCIES = \
214   libgnunetmesh.la
215
216 test_mesh_local_traffic_bck_SOURCES = \
217  test_mesh_local_traffic.c
218 test_mesh_local_traffic_bck_LDADD = \
219  $(top_builddir)/src/util/libgnunetutil.la \
220  $(top_builddir)/src/testing/libgnunettesting.la \
221  $(top_builddir)/src/mesh/libgnunetmesh.la
222 test_mesh_local_traffic_bck_DEPENDENCIES = \
223   libgnunetmesh.la
224
225 test_mesh_local_traffic_both_SOURCES = \
226  test_mesh_local_traffic.c
227 test_mesh_local_traffic_both_LDADD = \
228  $(top_builddir)/src/util/libgnunetutil.la \
229  $(top_builddir)/src/testing/libgnunettesting.la \
230  $(top_builddir)/src/mesh/libgnunetmesh.la
231 test_mesh_local_traffic_both_DEPENDENCIES = \
232   libgnunetmesh.la
233
234
235 ld_mesh_test_lib = \
236   $(top_builddir)/src/mesh/libgnunetmeshtest.a \
237   $(top_builddir)/src/mesh/libgnunetmesh.la \
238   $(top_builddir)/src/testbed/libgnunettestbed.la \
239   $(top_builddir)/src/util/libgnunetutil.la 
240
241 dep_mesh_test_lib = \
242   libgnunetmeshtest.a \
243   libgnunetmesh.la
244
245 test_mesh_2dtorus_SOURCES = \
246  test_mesh_2dtorus.c
247 test_mesh_2dtorus_LDADD = $(ld_mesh_test_lib)
248 test_mesh_2dtorus_DEPENDENCIES = $(dep_mesh_test_lib)
249
250 test_mesh_small_unicast_SOURCES = \
251  test_mesh_small.c
252 test_mesh_small_unicast_LDADD = $(ld_mesh_test_lib)
253 test_mesh_small_unicast_DEPENDENCIES = $(dep_mesh_test_lib)
254
255 test_mesh_small_signal_SOURCES = \
256  test_mesh_small.c
257 test_mesh_small_signal_LDADD = $(ld_mesh_test_lib)
258 test_mesh_small_signal_DEPENDENCIES = $(dep_mesh_test_lib)
259
260 test_mesh_small_speed_ack_SOURCES = \
261  test_mesh_small.c
262 test_mesh_small_speed_ack_LDADD = $(ld_mesh_test_lib)
263 test_mesh_small_speed_ack_DEPENDENCIES = $(dep_mesh_test_lib)
264
265 test_mesh_small_speed_SOURCES = \
266  test_mesh_small.c
267 test_mesh_small_speed_LDADD = $(ld_mesh_test_lib)
268 test_mesh_small_speed_DEPENDENCIES = $(dep_mesh_test_lib)
269
270 test_mesh_small_speed_nobuf_SOURCES = \
271  test_mesh_small.c
272 test_mesh_small_speed_nobuf_LDADD = $(ld_mesh_test_lib)
273 test_mesh_small_speed_nobuf_DEPENDENCIES = $(dep_mesh_test_lib)
274
275 test_mesh_small_speed_backwards_SOURCES = \
276  test_mesh_small.c
277 test_mesh_small_speed_backwards_LDADD = $(ld_mesh_test_lib)
278 test_mesh_small_speed_backwards_DEPENDENCIES = $(dep_mesh_test_lib)
279
280 test_mesh_small_speed_nobuf_backwards_SOURCES = \
281  test_mesh_small.c
282 test_mesh_small_speed_nobuf_backwards_LDADD = $(ld_mesh_test_lib)
283 test_mesh_small_speed_nobuf_backwards_DEPENDENCIES = $(dep_mesh_test_lib)
284
285
286 ld_mesh2_test_lib = \
287   $(top_builddir)/src/mesh/libgnunetmesh2test.a \
288   $(top_builddir)/src/mesh/libgnunetmesh2.la \
289   $(top_builddir)/src/testing/libgnunettesting.la \
290   $(top_builddir)/src/testbed/libgnunettestbed.la \
291   $(top_builddir)/src/util/libgnunetutil.la 
292
293 dep_mesh2_test_lib = \
294   libgnunetmesh2test.a \
295   libgnunetmesh2.la
296
297 test_mesh2_local_SOURCES = \
298   test_mesh2_local.c
299 test_mesh2_local_LDADD = $(ld_mesh2_test_lib)
300 test_mesh2_local_DEPENDENCIES = $(dep_mesh2_test_lib)
301
302 test_mesh2_small_forward_SOURCES = \
303   test_mesh2_small.c
304 test_mesh2_small_forward_LDADD = $(ld_mesh2_test_lib)
305 test_mesh2_small_forward_DEPENDENCIES = $(dep_mesh2_test_lib)
306
307
308 if ENABLE_TEST_RUN
309 TESTS = \
310  $(EXP_TESTS) \
311  test_mesh_api \
312  test_mesh_tree_api \
313  test_mesh_local_1 test_mesh_local_2 \
314  test_mesh_local_traffic_fwd \
315  test_mesh_local_traffic_bck \
316  test_mesh_local_traffic_both \
317  test_mesh_2dtorus \
318  test_mesh_small_unicast \
319  test_mesh_small_signal \
320  test_mesh_small_speed \
321  test_mesh_small_speed_nobuf \
322  test_mesh_small_speed_backwards
323 endif
324
325 EXTRA_DIST = \
326   mesh.h mesh_protocol.h \
327   test_mesh.conf \
328   test_mesh_2dtorus.conf \
329   test_mesh_small.conf