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