- add mesh2 local testcase
[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   EXP_LIB = libgnunetmesh2.la
25   EXP_LIBEXEC = gnunet-service-mesh-new
26   EXP_TESTS = \
27   test_mesh2_local
28 endif
29
30 libexec_PROGRAMS = \
31  gnunet-service-mesh $(EXP_LIBEXEC)
32
33 bin_PROGRAMS = \
34  gnunet-mesh
35
36 lib_LTLIBRARIES = \
37   libgnunetmesh.la $(EXP_LIB)
38
39 plugin_LTLIBRARIES = \
40  libgnunet_plugin_block_mesh.la
41
42 libgnunet_plugin_block_mesh_la_SOURCES = \
43  plugin_block_mesh.c
44 libgnunet_plugin_block_mesh_la_LIBADD = \
45  $(top_builddir)/src/block/libgnunetblock.la \
46  $(top_builddir)/src/util/libgnunetutil.la
47 libgnunet_plugin_block_mesh_la_LDFLAGS = \
48  $(GN_PLUGIN_LDFLAGS)
49 libgnunet_plugin_block_mesh_la_DEPENDENCIES = \
50  $(top_builddir)/src/block/libgnunetblock.la \
51  $(top_builddir)/src/util/libgnunetutil.la
52
53 libgnunetmesh_la_SOURCES = \
54   mesh_api.c mesh_common.c
55 libgnunetmesh_la_LIBADD = \
56   $(top_builddir)/src/util/libgnunetutil.la \
57   $(XLIB) \
58   $(LTLIBINTL)
59 libgnunetmesh_la_LDFLAGS = \
60   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
61   -version-info 2:1:1
62
63 libgnunetmesh2_la_SOURCES = \
64   mesh2_api.c mesh_common.c
65 libgnunetmesh2_la_LIBADD = \
66   $(top_builddir)/src/util/libgnunetutil.la \
67   $(XLIB) \
68   $(LTLIBINTL)
69 libgnunetmesh2_la_LDFLAGS = \
70   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
71   -version-info 2:2:1
72
73
74 gnunet_service_mesh_SOURCES = \
75  gnunet-service-mesh.c \
76  mesh_tunnel_tree.c mesh_tunnel_tree.h \
77  mesh_common.c
78 gnunet_service_mesh_CFLAGS = $(AM_CFLAGS)
79 gnunet_service_mesh_LDADD = \
80   $(top_builddir)/src/util/libgnunetutil.la \
81   $(top_builddir)/src/core/libgnunetcore.la \
82   $(top_builddir)/src/dht/libgnunetdht.la \
83   $(top_builddir)/src/statistics/libgnunetstatistics.la \
84   $(top_builddir)/src/block/libgnunetblock.la \
85   $(top_builddir)/src/regex/libgnunetregex.la
86 gnunet_service_mesh_DEPENDENCIES = \
87   $(top_builddir)/src/util/libgnunetutil.la \
88   $(top_builddir)/src/core/libgnunetcore.la \
89   $(top_builddir)/src/dht/libgnunetdht.la \
90   $(top_builddir)/src/statistics/libgnunetstatistics.la \
91   $(top_builddir)/src/block/libgnunetblock.la \
92   $(top_builddir)/src/regex/libgnunetregex.la
93 if LINUX
94 gnunet_service_mesh_LDFLAGS = -lrt
95 endif
96
97 gnunet_mesh_SOURCES = \
98   gnunet-mesh.c
99 gnunet_mesh_LDADD = \
100   $(top_builddir)/src/mesh/libgnunetmesh.la \
101   $(top_builddir)/src/util/libgnunetutil.la
102 gnunet_mesh_DEPENDENCIES = \
103   libgnunetmesh.la
104
105 gnunet_service_mesh_new_SOURCES = \
106  gnunet-service-mesh-new.c \
107  mesh_path.c \
108  mesh_common.c
109 gnunet_service_mesh_new_CFLAGS = $(AM_CFLAGS)
110 gnunet_service_mesh_new_LDADD = \
111   $(top_builddir)/src/util/libgnunetutil.la \
112   $(top_builddir)/src/core/libgnunetcore.la \
113   $(top_builddir)/src/dht/libgnunetdht.la \
114   $(top_builddir)/src/statistics/libgnunetstatistics.la \
115   $(top_builddir)/src/block/libgnunetblock.la
116 gnunet_service_mesh_new_DEPENDENCIES = \
117   $(top_builddir)/src/util/libgnunetutil.la \
118   $(top_builddir)/src/core/libgnunetcore.la \
119   $(top_builddir)/src/dht/libgnunetdht.la \
120   $(top_builddir)/src/statistics/libgnunetstatistics.la \
121   $(top_builddir)/src/block/libgnunetblock.la
122 if LINUX
123 gnunet_service_mesh_new_LDFLAGS = -lrt
124 endif
125
126
127 noinst_LIBRARIES = libgnunetmeshtest.a
128
129 libgnunetmeshtest_a_SOURCES = \
130   mesh_test_lib.c mesh_test_lib.h
131 libgnunetmeshtest_a_LIBADD = \
132  $(top_builddir)/src/util/libgnunetutil.la \
133  $(top_builddir)/src/testbed/libgnunettestbed.la \
134  $(top_builddir)/src/mesh/libgnunetmesh.la
135 libgnunetmeshtest_a_DEPENDENCIES = \
136   libgnunetmesh.la
137
138
139 check_PROGRAMS = \
140  test_mesh_api \
141  test_mesh_tree_api \
142  test_mesh_local_1 \
143  test_mesh_local_2 \
144  test_mesh_local_traffic_fwd \
145  test_mesh_local_traffic_bck \
146  test_mesh_local_traffic_both \
147  test_mesh_2dtorus \
148  test_mesh_small_unicast \
149  test_mesh_small_signal \
150  test_mesh_small_speed \
151  test_mesh_small_speed_nobuf \
152  test_mesh_small_speed_backwards \
153  test_mesh_small_speed_nobuf_backwards \
154  test_mesh_small_speed_ack \
155  $(EXP_TESTS)
156
157 test_mesh_api_SOURCES = \
158  test_mesh_api.c
159 test_mesh_api_LDADD = \
160  $(top_builddir)/src/util/libgnunetutil.la \
161  $(top_builddir)/src/testing/libgnunettesting.la \
162  $(top_builddir)/src/mesh/libgnunetmesh2.la
163 test_mesh_api_DEPENDENCIES = \
164   libgnunetmesh.la \
165    $(top_builddir)/src/util/libgnunetutil.la
166
167 test_mesh_tree_api_SOURCES = \
168  test_mesh_tree_api.c
169 test_mesh_tree_api_LDADD = \
170  $(top_builddir)/src/util/libgnunetutil.la \
171  $(top_builddir)/src/dht/libgnunetdht.la
172 test_mesh_tree_api_DEPENDENCIES = \
173   libgnunetmesh.la \
174   $(top_builddir)/src/dht/libgnunetdht.la
175
176 test_mesh_local_1_SOURCES = \
177  test_mesh_local_1.c
178 test_mesh_local_1_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_local_1_DEPENDENCIES = \
183   libgnunetmesh.la
184
185 test_mesh_local_2_SOURCES = \
186  test_mesh_local_2.c
187 test_mesh_local_2_LDADD = \
188  $(top_builddir)/src/util/libgnunetutil.la \
189  $(top_builddir)/src/testing/libgnunettesting.la \
190  $(top_builddir)/src/mesh/libgnunetmesh.la
191 test_mesh_local_2_DEPENDENCIES = \
192   libgnunetmesh.la
193
194 test_mesh_local_traffic_fwd_SOURCES = \
195  test_mesh_local_traffic.c
196 test_mesh_local_traffic_fwd_LDADD = \
197  $(top_builddir)/src/util/libgnunetutil.la \
198  $(top_builddir)/src/testing/libgnunettesting.la \
199  $(top_builddir)/src/mesh/libgnunetmesh.la
200 test_mesh_local_traffic_fwd_DEPENDENCIES = \
201   libgnunetmesh.la
202
203 test_mesh_local_traffic_bck_SOURCES = \
204  test_mesh_local_traffic.c
205 test_mesh_local_traffic_bck_LDADD = \
206  $(top_builddir)/src/util/libgnunetutil.la \
207  $(top_builddir)/src/testing/libgnunettesting.la \
208  $(top_builddir)/src/mesh/libgnunetmesh.la
209 test_mesh_local_traffic_bck_DEPENDENCIES = \
210   libgnunetmesh.la
211
212 test_mesh_local_traffic_both_SOURCES = \
213  test_mesh_local_traffic.c
214 test_mesh_local_traffic_both_LDADD = \
215  $(top_builddir)/src/util/libgnunetutil.la \
216  $(top_builddir)/src/testing/libgnunettesting.la \
217  $(top_builddir)/src/mesh/libgnunetmesh.la
218 test_mesh_local_traffic_both_DEPENDENCIES = \
219   libgnunetmesh.la
220
221
222 ld_mesh_test_lib = \
223   $(top_builddir)/src/mesh/libgnunetmeshtest.a \
224   $(top_builddir)/src/mesh/libgnunetmesh.la \
225   $(top_builddir)/src/testbed/libgnunettestbed.la \
226   $(top_builddir)/src/util/libgnunetutil.la 
227
228 dep_mesh_test_lib = \
229   libgnunetmeshtest.a \
230   libgnunetmesh.la
231
232 test_mesh_2dtorus_SOURCES = \
233  test_mesh_2dtorus.c
234 test_mesh_2dtorus_LDADD = $(ld_mesh_test_lib)
235 test_mesh_2dtorus_DEPENDENCIES = $(dep_mesh_test_lib)
236
237 test_mesh_small_unicast_SOURCES = \
238  test_mesh_small.c
239 test_mesh_small_unicast_LDADD = $(ld_mesh_test_lib)
240 test_mesh_small_unicast_DEPENDENCIES = $(dep_mesh_test_lib)
241
242 test_mesh_small_signal_SOURCES = \
243  test_mesh_small.c
244 test_mesh_small_signal_LDADD = $(ld_mesh_test_lib)
245 test_mesh_small_signal_DEPENDENCIES = $(dep_mesh_test_lib)
246
247 test_mesh_small_speed_ack_SOURCES = \
248  test_mesh_small.c
249 test_mesh_small_speed_ack_LDADD = $(ld_mesh_test_lib)
250 test_mesh_small_speed_ack_DEPENDENCIES = $(dep_mesh_test_lib)
251
252 test_mesh_small_speed_SOURCES = \
253  test_mesh_small.c
254 test_mesh_small_speed_LDADD = $(ld_mesh_test_lib)
255 test_mesh_small_speed_DEPENDENCIES = $(dep_mesh_test_lib)
256
257 test_mesh_small_speed_nobuf_SOURCES = \
258  test_mesh_small.c
259 test_mesh_small_speed_nobuf_LDADD = $(ld_mesh_test_lib)
260 test_mesh_small_speed_nobuf_DEPENDENCIES = $(dep_mesh_test_lib)
261
262 test_mesh_small_speed_backwards_SOURCES = \
263  test_mesh_small.c
264 test_mesh_small_speed_backwards_LDADD = $(ld_mesh_test_lib)
265 test_mesh_small_speed_backwards_DEPENDENCIES = $(dep_mesh_test_lib)
266
267 test_mesh_small_speed_nobuf_backwards_SOURCES = \
268  test_mesh_small.c
269 test_mesh_small_speed_nobuf_backwards_LDADD = $(ld_mesh_test_lib)
270 test_mesh_small_speed_nobuf_backwards_DEPENDENCIES = $(dep_mesh_test_lib)
271
272
273 test_mesh2_local_SOURCES = \
274  test_mesh2_local.c
275 test_mesh2_local_LDADD = \
276  $(top_builddir)/src/util/libgnunetutil.la \
277  $(top_builddir)/src/testing/libgnunettesting.la \
278  $(top_builddir)/src/mesh/libgnunetmesh2.la
279 test_mesh2_local_DEPENDENCIES = \
280   libgnunetmesh2.la
281
282 if ENABLE_TEST_RUN
283 TESTS = \
284  $(EXP_TESTS) \
285  test_mesh_api \
286  test_mesh_tree_api \
287  test_mesh_local_1 test_mesh_local_2 \
288  test_mesh_local_traffic_fwd \
289  test_mesh_local_traffic_bck \
290  test_mesh_local_traffic_both \
291  test_mesh_2dtorus \
292  test_mesh_small_unicast \
293  test_mesh_small_signal \
294  test_mesh_small_speed \
295  test_mesh_small_speed_nobuf \
296  test_mesh_small_speed_backwards
297 endif
298
299 EXTRA_DIST = \
300   mesh.h mesh_protocol.h \
301   test_mesh.conf \
302   test_mesh_2dtorus.conf \
303   test_mesh_small.conf