- add equivalent of old tests to mesh2
[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     test_mesh2_small_signal  \
31     test_mesh2_small_speed  \
32     test_mesh2_small_speed_ack  \
33     test_mesh2_small_speed_nobuf  \
34     test_mesh2_small_speed_backwards  \
35     test_mesh2_small_speed_nobuf_backwards
36 endif
37
38 libexec_PROGRAMS = \
39  gnunet-service-mesh $(EXP_LIBEXEC)
40
41 bin_PROGRAMS = \
42  gnunet-mesh
43
44 lib_LTLIBRARIES = \
45   libgnunetmesh.la $(EXP_LIB)
46
47 plugin_LTLIBRARIES = \
48  libgnunet_plugin_block_mesh.la
49
50 libgnunet_plugin_block_mesh_la_SOURCES = \
51  plugin_block_mesh.c
52 libgnunet_plugin_block_mesh_la_LIBADD = \
53  $(top_builddir)/src/block/libgnunetblock.la \
54  $(top_builddir)/src/util/libgnunetutil.la
55 libgnunet_plugin_block_mesh_la_LDFLAGS = \
56  $(GN_PLUGIN_LDFLAGS)
57 libgnunet_plugin_block_mesh_la_DEPENDENCIES = \
58  $(top_builddir)/src/block/libgnunetblock.la \
59  $(top_builddir)/src/util/libgnunetutil.la
60
61 libgnunetmesh_la_SOURCES = \
62   mesh_api.c mesh_common.c
63 libgnunetmesh_la_LIBADD = \
64   $(top_builddir)/src/util/libgnunetutil.la \
65   $(XLIB) \
66   $(LTLIBINTL)
67 libgnunetmesh_la_LDFLAGS = \
68   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
69   -version-info 2:1:1
70
71 libgnunetmesh2_la_SOURCES = \
72   mesh2_api.c mesh_common.c
73 libgnunetmesh2_la_LIBADD = \
74   $(top_builddir)/src/util/libgnunetutil.la \
75   $(XLIB) \
76   $(LTLIBINTL)
77 libgnunetmesh2_la_LDFLAGS = \
78   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
79   -version-info 2:2:1
80
81
82 gnunet_service_mesh_SOURCES = \
83  gnunet-service-mesh.c \
84  mesh_tunnel_tree.c mesh_tunnel_tree.h \
85  mesh_common.c
86 gnunet_service_mesh_CFLAGS = $(AM_CFLAGS)
87 gnunet_service_mesh_LDADD = \
88   $(top_builddir)/src/statistics/libgnunetstatistics.la \
89   $(top_builddir)/src/regex/libgnunetregex.la \
90   $(top_builddir)/src/util/libgnunetutil.la \
91   $(top_builddir)/src/core/libgnunetcore.la \
92   $(top_builddir)/src/dht/libgnunetdht.la \
93   $(top_builddir)/src/block/libgnunetblock.la 
94 gnunet_service_mesh_DEPENDENCIES = \
95   $(top_builddir)/src/util/libgnunetutil.la \
96   $(top_builddir)/src/core/libgnunetcore.la \
97   $(top_builddir)/src/dht/libgnunetdht.la \
98   $(top_builddir)/src/statistics/libgnunetstatistics.la \
99   $(top_builddir)/src/block/libgnunetblock.la \
100   $(top_builddir)/src/regex/libgnunetregex.la
101 if LINUX
102 gnunet_service_mesh_LDFLAGS = -lrt
103 endif
104
105 gnunet_mesh_SOURCES = \
106   gnunet-mesh.c
107 gnunet_mesh_LDADD = \
108   $(top_builddir)/src/mesh/libgnunetmesh.la \
109   $(top_builddir)/src/util/libgnunetutil.la
110 gnunet_mesh_DEPENDENCIES = \
111   libgnunetmesh.la
112
113 gnunet_service_mesh_new_SOURCES = \
114  gnunet-service-mesh-new.c \
115  mesh_path.c \
116  mesh_common.c
117 gnunet_service_mesh_new_CFLAGS = $(AM_CFLAGS)
118 gnunet_service_mesh_new_LDADD = \
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 gnunet_service_mesh_new_DEPENDENCIES = \
125   $(top_builddir)/src/util/libgnunetutil.la \
126   $(top_builddir)/src/core/libgnunetcore.la \
127   $(top_builddir)/src/dht/libgnunetdht.la \
128   $(top_builddir)/src/statistics/libgnunetstatistics.la \
129   $(top_builddir)/src/block/libgnunetblock.la
130 if LINUX
131 gnunet_service_mesh_new_LDFLAGS = -lrt
132 endif
133
134 if HAVE_TESTING
135 noinst_LIBRARIES = libgnunetmeshtest.a $(noinst_LIB_EXP)
136 endif
137
138 libgnunetmeshtest_a_SOURCES = \
139   mesh_test_lib.c mesh_test_lib.h
140 libgnunetmeshtest_a_LIBADD = \
141  $(top_builddir)/src/util/libgnunetutil.la \
142  $(top_builddir)/src/testbed/libgnunettestbed.la \
143  $(top_builddir)/src/mesh/libgnunetmesh.la
144 libgnunetmeshtest_a_DEPENDENCIES = \
145   libgnunetmesh.la
146
147 libgnunetmesh2test_a_SOURCES = \
148   mesh2_test_lib.c mesh2_test_lib.h
149 libgnunetmesh2test_a_LIBADD = \
150  $(top_builddir)/src/util/libgnunetutil.la \
151  $(top_builddir)/src/testbed/libgnunettestbed.la \
152  $(top_builddir)/src/mesh/libgnunetmesh2.la
153 libgnunetmesh2test_a_DEPENDENCIES = \
154   libgnunetmesh2.la
155
156 if HAVE_TESTING
157 check_PROGRAMS = \
158  test_mesh_api \
159  test_mesh_tree_api \
160  test_mesh_local_1 \
161  test_mesh_local_2 \
162  test_mesh_local_traffic_fwd \
163  test_mesh_local_traffic_bck \
164  test_mesh_local_traffic_both \
165  test_mesh_2dtorus \
166  test_mesh_small_unicast \
167  test_mesh_small_signal \
168  test_mesh_small_speed \
169  test_mesh_small_speed_nobuf \
170  test_mesh_small_speed_backwards \
171  test_mesh_small_speed_nobuf_backwards \
172  test_mesh_small_speed_ack \
173  $(EXP_TESTS)
174 endif
175
176 test_mesh_api_SOURCES = \
177  test_mesh_api.c
178 test_mesh_api_LDADD = \
179  $(top_builddir)/src/util/libgnunetutil.la \
180  $(top_builddir)/src/testing/libgnunettesting.la \
181  $(top_builddir)/src/mesh/libgnunetmesh.la
182 test_mesh_api_DEPENDENCIES = \
183   libgnunetmesh.la \
184    $(top_builddir)/src/util/libgnunetutil.la
185
186 test_mesh_tree_api_SOURCES = \
187  test_mesh_tree_api.c
188 test_mesh_tree_api_LDADD = \
189  $(top_builddir)/src/util/libgnunetutil.la \
190  $(top_builddir)/src/dht/libgnunetdht.la
191 test_mesh_tree_api_DEPENDENCIES = \
192   libgnunetmesh.la \
193   $(top_builddir)/src/dht/libgnunetdht.la
194
195 test_mesh_local_1_SOURCES = \
196  test_mesh_local_1.c
197 test_mesh_local_1_LDADD = \
198  $(top_builddir)/src/util/libgnunetutil.la \
199  $(top_builddir)/src/testing/libgnunettesting.la \
200  $(top_builddir)/src/mesh/libgnunetmesh.la
201 test_mesh_local_1_DEPENDENCIES = \
202   libgnunetmesh.la
203
204 test_mesh_local_2_SOURCES = \
205  test_mesh_local_2.c
206 test_mesh_local_2_LDADD = \
207  $(top_builddir)/src/util/libgnunetutil.la \
208  $(top_builddir)/src/testing/libgnunettesting.la \
209  $(top_builddir)/src/mesh/libgnunetmesh.la
210 test_mesh_local_2_DEPENDENCIES = \
211   libgnunetmesh.la
212
213 test_mesh_local_traffic_fwd_SOURCES = \
214  test_mesh_local_traffic.c
215 test_mesh_local_traffic_fwd_LDADD = \
216  $(top_builddir)/src/util/libgnunetutil.la \
217  $(top_builddir)/src/testing/libgnunettesting.la \
218  $(top_builddir)/src/mesh/libgnunetmesh.la
219 test_mesh_local_traffic_fwd_DEPENDENCIES = \
220   libgnunetmesh.la
221
222 test_mesh_local_traffic_bck_SOURCES = \
223  test_mesh_local_traffic.c
224 test_mesh_local_traffic_bck_LDADD = \
225  $(top_builddir)/src/util/libgnunetutil.la \
226  $(top_builddir)/src/testing/libgnunettesting.la \
227  $(top_builddir)/src/mesh/libgnunetmesh.la
228 test_mesh_local_traffic_bck_DEPENDENCIES = \
229   libgnunetmesh.la
230
231 test_mesh_local_traffic_both_SOURCES = \
232  test_mesh_local_traffic.c
233 test_mesh_local_traffic_both_LDADD = \
234  $(top_builddir)/src/util/libgnunetutil.la \
235  $(top_builddir)/src/testing/libgnunettesting.la \
236  $(top_builddir)/src/mesh/libgnunetmesh.la
237 test_mesh_local_traffic_both_DEPENDENCIES = \
238   libgnunetmesh.la
239
240
241 ld_mesh_test_lib = \
242   $(top_builddir)/src/mesh/libgnunetmeshtest.a \
243   $(top_builddir)/src/mesh/libgnunetmesh.la \
244   $(top_builddir)/src/testbed/libgnunettestbed.la \
245   $(top_builddir)/src/util/libgnunetutil.la 
246
247 dep_mesh_test_lib = \
248   libgnunetmeshtest.a \
249   libgnunetmesh.la
250
251 test_mesh_2dtorus_SOURCES = \
252  test_mesh_2dtorus.c
253 test_mesh_2dtorus_LDADD = $(ld_mesh_test_lib)
254 test_mesh_2dtorus_DEPENDENCIES = $(dep_mesh_test_lib)
255
256 test_mesh_small_unicast_SOURCES = \
257  test_mesh_small.c
258 test_mesh_small_unicast_LDADD = $(ld_mesh_test_lib)
259 test_mesh_small_unicast_DEPENDENCIES = $(dep_mesh_test_lib)
260
261 test_mesh_small_signal_SOURCES = \
262  test_mesh_small.c
263 test_mesh_small_signal_LDADD = $(ld_mesh_test_lib)
264 test_mesh_small_signal_DEPENDENCIES = $(dep_mesh_test_lib)
265
266 test_mesh_small_speed_ack_SOURCES = \
267  test_mesh_small.c
268 test_mesh_small_speed_ack_LDADD = $(ld_mesh_test_lib)
269 test_mesh_small_speed_ack_DEPENDENCIES = $(dep_mesh_test_lib)
270
271 test_mesh_small_speed_SOURCES = \
272  test_mesh_small.c
273 test_mesh_small_speed_LDADD = $(ld_mesh_test_lib)
274 test_mesh_small_speed_DEPENDENCIES = $(dep_mesh_test_lib)
275
276 test_mesh_small_speed_nobuf_SOURCES = \
277  test_mesh_small.c
278 test_mesh_small_speed_nobuf_LDADD = $(ld_mesh_test_lib)
279 test_mesh_small_speed_nobuf_DEPENDENCIES = $(dep_mesh_test_lib)
280
281 test_mesh_small_speed_backwards_SOURCES = \
282  test_mesh_small.c
283 test_mesh_small_speed_backwards_LDADD = $(ld_mesh_test_lib)
284 test_mesh_small_speed_backwards_DEPENDENCIES = $(dep_mesh_test_lib)
285
286 test_mesh_small_speed_nobuf_backwards_SOURCES = \
287  test_mesh_small.c
288 test_mesh_small_speed_nobuf_backwards_LDADD = $(ld_mesh_test_lib)
289 test_mesh_small_speed_nobuf_backwards_DEPENDENCIES = $(dep_mesh_test_lib)
290
291
292 ld_mesh2_test_lib = \
293   $(top_builddir)/src/mesh/libgnunetmesh2test.a \
294   $(top_builddir)/src/mesh/libgnunetmesh2.la \
295   $(top_builddir)/src/testing/libgnunettesting.la \
296   $(top_builddir)/src/testbed/libgnunettestbed.la \
297   $(top_builddir)/src/util/libgnunetutil.la 
298
299 dep_mesh2_test_lib = \
300   libgnunetmesh2test.a \
301   libgnunetmesh2.la
302
303 test_mesh2_local_SOURCES = \
304   test_mesh2_local.c
305 test_mesh2_local_LDADD = $(ld_mesh2_test_lib)
306 test_mesh2_local_DEPENDENCIES = $(dep_mesh2_test_lib)
307
308 test_mesh2_small_forward_SOURCES = \
309   test_mesh2_small.c
310 test_mesh2_small_forward_LDADD = $(ld_mesh2_test_lib)
311 test_mesh2_small_forward_DEPENDENCIES = $(dep_mesh2_test_lib)
312
313 test_mesh2_small_signal_SOURCES = \
314   test_mesh2_small.c
315 test_mesh2_small_signal_LDADD = $(ld_mesh2_test_lib)
316 test_mesh2_small_signal_DEPENDENCIES = $(dep_mesh2_test_lib)
317
318 test_mesh2_small_speed_SOURCES = \
319   test_mesh2_small.c
320 test_mesh2_small_speed_LDADD = $(ld_mesh2_test_lib)
321 test_mesh2_small_speed_DEPENDENCIES = $(dep_mesh2_test_lib)
322
323 test_mesh2_small_speed_ack_SOURCES = \
324   test_mesh2_small.c
325 test_mesh2_small_speed_ack_LDADD = $(ld_mesh2_test_lib)
326 test_mesh2_small_speed_ack_DEPENDENCIES = $(dep_mesh2_test_lib)
327
328 test_mesh2_small_speed_nobuf_SOURCES = \
329   test_mesh2_small.c
330 test_mesh2_small_speed_nobuf_LDADD = $(ld_mesh2_test_lib)
331 test_mesh2_small_speed_nobuf_DEPENDENCIES = $(dep_mesh2_test_lib)
332
333 test_mesh2_small_speed_backwards_SOURCES = \
334   test_mesh2_small.c
335 test_mesh2_small_speed_backwards_LDADD = $(ld_mesh2_test_lib)
336 test_mesh2_small_speed_backwards_DEPENDENCIES = $(dep_mesh2_test_lib)
337
338 test_mesh2_small_speed_nobuf_backwards_SOURCES = \
339   test_mesh2_small.c
340 test_mesh2_small_speed_nobuf_backwards_LDADD = $(ld_mesh2_test_lib)
341 test_mesh2_small_speed_nobuf_backwards_DEPENDENCIES = $(dep_mesh2_test_lib)
342
343
344 if ENABLE_TEST_RUN
345 TESTS = \
346  $(EXP_TESTS) \
347  test_mesh_api \
348  test_mesh_tree_api \
349  test_mesh_local_1 test_mesh_local_2 \
350  test_mesh_local_traffic_fwd \
351  test_mesh_local_traffic_bck \
352  test_mesh_local_traffic_both \
353  test_mesh_2dtorus \
354  test_mesh_small_unicast \
355  test_mesh_small_signal \
356  test_mesh_small_speed \
357  test_mesh_small_speed_nobuf \
358  test_mesh_small_speed_backwards
359 endif
360
361 EXTRA_DIST = \
362   mesh.h mesh_protocol.h \
363   test_mesh.conf \
364   test_mesh_2dtorus.conf \
365   test_mesh_small.conf