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