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