and quota compliance for udp
[oweals/gnunet.git] / src / transport / Makefile.am
1 INCLUDES = -I$(top_srcdir)/src/include
2
3 plugindir = $(libdir)/gnunet
4
5 if MINGW
6   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
7   NATBIN = gnunet-nat-server gnunet-nat-client
8   NATSERVER = gnunet-nat-server-windows.c
9   NATCLIENT = gnunet-nat-client-windows.c
10 else
11   NATSERVER = gnunet-nat-server.c
12   NATCLIENT = gnunet-nat-client.c
13 endif
14
15 if HAVE_MHD
16  GN_LIBMHD = -lmicrohttpd
17  HTTP_PLUGIN_LA = libgnunet_plugin_transport_http.la
18  HTTP_PLUGIN_TEST = test_plugin_transport_http
19  HTTP_API_TEST = test_transport_api_http
20  HTTP_REL_TEST = test_transport_api_reliability_http
21
22  HTTPS_PLUGIN_LA = libgnunet_plugin_transport_https.la
23  HTTPS_PLUGIN_TEST = test_plugin_transport_https
24  HTTPS_API_TEST = test_transport_api_https
25  HTTPS_REL_TEST = test_transport_api_reliability_https                     
26 endif
27
28 if USE_COVERAGE
29   AM_CFLAGS = --coverage -O0
30 endif
31
32 if HAVE_PCAP
33 if LINUX
34  WANBIN = gnunet-transport-wlan-helper
35  WLAN_PLUGIN_LA = libgnunet_plugin_transport_wlan.la
36 endif
37 endif
38
39 if LINUX
40 NATBIN = gnunet-nat-server gnunet-nat-client
41 install-exec-hook:
42         chown root $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client $(bindir)/gnunet-wlan || true
43         chmod u+s $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client $(bindir)/gnunet-wlan || true
44 else
45 install-exec-hook:
46 endif
47
48 #noinst_PROGRAMS = ${check_PROGRAMS}
49
50 lib_LTLIBRARIES = \
51   libgnunettransport.la
52
53 libgnunettransport_la_SOURCES = \
54   transport_api.c transport.h \
55   transport_api_blacklist.c \
56   transport_api_address_lookup.c 
57 libgnunettransport_la_LIBADD = \
58   $(top_builddir)/src/hello/libgnunethello.la \
59   $(top_builddir)/src/util/libgnunetutil.la \
60   $(GN_LIBINTL) 
61 libgnunettransport_la_LDFLAGS = \
62   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
63   -version-info 0:0:0
64
65
66 bin_PROGRAMS = \
67  gnunet-transport \
68  $(WANBIN) \
69  gnunet-service-transport $(NATBIN)
70
71 bin_SCRIPTS = \
72  gnunet-transport-certificate-creation
73
74 gnunet_nat_server_SOURCES = \
75  $(NATSERVER)
76
77 gnunet_transport_wlan_helper_SOURCES = \
78  gnunet-transport-wlan-helper.c         
79 gnunet_transport_wlan_helper_LDADD = \
80  -lpcap
81
82 gnunet_nat_client_SOURCES = \
83  $(NATCLIENT)         
84
85 gnunet_transport_SOURCES = \
86  gnunet-transport.c         
87 gnunet_transport_LDADD = \
88   $(top_builddir)/src/transport/libgnunettransport.la \
89   $(top_builddir)/src/util/libgnunetutil.la \
90   $(GN_LIBINTL)
91
92 gnunet_service_transport_SOURCES = \
93  gnunet-service-transport.c plugin_transport.h 
94 gnunet_service_transport_LDADD = \
95   $(top_builddir)/src/hello/libgnunethello.la \
96   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
97   $(top_builddir)/src/statistics/libgnunetstatistics.la \
98   $(top_builddir)/src/util/libgnunetutil.la \
99   $(GN_LIBINTL)
100
101
102 plugin_LTLIBRARIES = \
103   libgnunet_plugin_transport_tcp.la \
104   libgnunet_plugin_transport_udp.la \
105   $(HTTP_PLUGIN_LA) \
106   $(HTTPS_PLUGIN_LA) \
107   $(WLAN_PLUGIN_LA) \
108   libgnunet_plugin_transport_template.la
109 # TODO: add nat, etc.
110
111 libgnunet_plugin_transport_tcp_la_SOURCES = \
112   plugin_transport_tcp.c
113 libgnunet_plugin_transport_tcp_la_LIBADD = \
114   $(top_builddir)/src/hello/libgnunethello.la \
115   $(top_builddir)/src/statistics/libgnunetstatistics.la \
116   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
117   $(top_builddir)/src/util/libgnunetutil.la 
118 libgnunet_plugin_transport_tcp_la_LDFLAGS = \
119  $(GN_PLUGIN_LDFLAGS)
120
121 libgnunet_plugin_transport_template_la_SOURCES = \
122   plugin_transport_template.c
123 libgnunet_plugin_transport_template_la_LIBADD = \
124   $(top_builddir)/src/util/libgnunetutil.la 
125 libgnunet_plugin_transport_template_la_LDFLAGS = \
126  $(GN_PLUGIN_LDFLAGS)
127
128 if HAVE_PCAP
129 if LINUX
130 libgnunet_plugin_transport_wlan_la_SOURCES = \
131         plugin_transport_wlan.c
132 libgnunet_plugin_transport_wlan_la_LIBADD = \
133         $(top_builddir)/src/hello/libgnunethello.la \
134         $(top_builddir)/src/statistics/libgnunetstatistics.la \
135         $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
136         $(top_builddir)/src/util/libgnunetutil.la 
137 libgnunet_plugin_transport_wlan_la_LDFLAGS = \
138         $(GN_PLUGIN_LDFLAGS)
139 endif
140 endif
141
142 libgnunet_plugin_transport_udp_la_SOURCES = \
143   plugin_transport_udp.c
144 libgnunet_plugin_transport_udp_la_LIBADD = \
145   $(top_builddir)/src/hello/libgnunethello.la \
146   $(top_builddir)/src/statistics/libgnunetstatistics.la \
147   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
148   $(top_builddir)/src/util/libgnunetutil.la 
149 libgnunet_plugin_transport_udp_la_LDFLAGS = \
150  $(GN_PLUGIN_LDFLAGS)
151
152 #libgnunet_plugin_transport_udp_nat_la_SOURCES = \
153 #  plugin_transport_udp_nat.c
154 #libgnunet_plugin_transport_udp_nat_la_LIBADD = \
155 #  $(top_builddir)/src/hello/libgnunethello.la \
156 #  $(top_builddir)/src/statistics/libgnunetstatistics.la \
157 #  $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
158 #  $(top_builddir)/src/util/libgnunetutil.la 
159 #libgnunet_plugin_transport_udp_nat_la_LDFLAGS = \
160 # $(GN_PLUGIN_LDFLAGS)
161
162 if HAVE_MHD 
163 libgnunet_plugin_transport_http_la_SOURCES = \
164   plugin_transport_http.c
165 libgnunet_plugin_transport_http_la_LIBADD = \
166   $(top_builddir)/src/hello/libgnunethello.la \
167   $(top_builddir)/src/statistics/libgnunetstatistics.la \
168   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
169   @LIBCURL@ \
170   $(top_builddir)/src/util/libgnunetutil.la 
171 libgnunet_plugin_transport_http_la_LDFLAGS = \
172  $(GN_LIBMHD) \
173  $(GN_PLUGIN_LDFLAGS)
174  
175 libgnunet_plugin_transport_https_la_SOURCES = \
176   plugin_transport_http.c
177 libgnunet_plugin_transport_https_la_LIBADD = \
178   $(top_builddir)/src/hello/libgnunethello.la \
179   $(top_builddir)/src/statistics/libgnunetstatistics.la \
180   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
181   @LIBCURL@ \
182   $(top_builddir)/src/util/libgnunetutil.la 
183 libgnunet_plugin_transport_https_la_LDFLAGS = \
184  $(GN_LIBMHD) \
185  $(GN_PLUGIN_LDFLAGS)
186 libgnunet_plugin_transport_https_la_CFLAGS = \
187  $(CFLAGS) -DBUILD_HTTPS  
188 endif
189
190 check_PROGRAMS = \
191  test_transport_api_tcp \
192  test_transport_api_tcp_nat \
193  test_transport_api_udp \
194  test_transport_api_udp_nat \
195  $(HTTP_PLUGIN_TEST) \
196  $(HTTP_API_TEST) \
197  $(HTTPS_PLUGIN_TEST) \
198  $(HTTPS_API_TEST) \
199  test_transport_api_reliability_tcp \
200  test_transport_api_reliability_tcp_nat \
201  test_transport_api_reliability_udp \
202  $(HTTP_REL_TEST) \
203  $(HTTPS_REL_TEST) \
204  test_quota_compliance_tcp \
205  test_quota_compliance_http \
206  test_quota_compliance_https \
207  test_quota_compliance_udp
208 # TODO: add tests for nat, etc.
209
210 if !DISABLE_TEST_RUN
211 TESTS = \
212  test_transport_api_tcp \
213  test_transport_api_tcp_nat \
214  test_transport_api_udp \
215  test_transport_api_udp_nat \
216  $(HTTP_PLUGIN_TEST) \
217  $(HTTP_API_TEST) \
218  $(HTTPS_PLUGIN_TEST) \
219  $(HTTPS_API_TEST) \
220  test_transport_api_reliability_tcp \
221  test_transport_api_reliability_tcp_nat \
222  $(HTTP_REL_TEST) \
223  $(HTTPS_REL_TEST) \
224  test_quota_compliance_tcp \
225  test_quota_compliance_http \
226  test_quota_compliance_https \
227  test_quota_compliance_udp
228 endif
229
230 test_transport_api_tcp_SOURCES = \
231  test_transport_api.c
232 test_transport_api_tcp_LDADD = \
233  $(top_builddir)/src/transport/libgnunettransport.la \
234  $(top_builddir)/src/util/libgnunetutil.la  
235
236 test_transport_api_tcp_nat_SOURCES = \
237  test_transport_api.c
238 test_transport_api_tcp_nat_LDADD = \
239  $(top_builddir)/src/transport/libgnunettransport.la \
240  $(top_builddir)/src/util/libgnunetutil.la  
241
242 test_transport_api_reliability_tcp_SOURCES = \
243  test_transport_api_reliability.c
244 test_transport_api_reliability_tcp_LDADD = \
245  $(top_builddir)/src/transport/libgnunettransport.la \
246  $(top_builddir)/src/util/libgnunetutil.la  
247
248 test_transport_api_reliability_tcp_nat_SOURCES = \
249  test_transport_api_reliability.c
250 test_transport_api_reliability_tcp_nat_LDADD = \
251  $(top_builddir)/src/transport/libgnunettransport.la \
252  $(top_builddir)/src/util/libgnunetutil.la 
253
254 test_transport_api_reliability_udp_SOURCES = \
255  test_transport_api_reliability.c
256 test_transport_api_reliability_udp_LDADD = \
257  $(top_builddir)/src/transport/libgnunettransport.la \
258  $(top_builddir)/src/util/libgnunetutil.la   
259
260 test_transport_api_udp_SOURCES = \
261  test_transport_api.c
262 test_transport_api_udp_LDADD = \
263  $(top_builddir)/src/transport/libgnunettransport.la \
264  $(top_builddir)/src/util/libgnunetutil.la  
265
266 test_transport_api_udp_nat_SOURCES = \
267  test_transport_api.c
268 test_transport_api_udp_nat_LDADD = \
269  $(top_builddir)/src/transport/libgnunettransport.la \
270  $(top_builddir)/src/util/libgnunetutil.la  
271
272 if HAVE_MHD
273
274 test_plugin_transport_http_SOURCES = \
275  test_plugin_transport_http.c
276 test_plugin_transport_http_LDADD = \
277  $(top_builddir)/src/transport/libgnunettransport.la \
278  $(top_builddir)/src/statistics/libgnunetstatistics.la \
279  @LIBCURL@ \
280  $(top_builddir)/src/util/libgnunetutil.la  
281
282 test_transport_api_http_SOURCES = \
283  test_transport_api.c
284 test_transport_api_http_LDADD = \
285  $(top_builddir)/src/transport/libgnunettransport.la \
286  $(top_builddir)/src/util/libgnunetutil.la  
287
288 test_transport_api_reliability_http_SOURCES = \
289  test_transport_api_reliability.c
290 test_transport_api_reliability_http_LDADD = \
291  $(top_builddir)/src/transport/libgnunettransport.la \
292  $(top_builddir)/src/util/libgnunetutil.la
293  
294 test_plugin_transport_https_SOURCES = \
295  test_plugin_transport_https.c
296 test_plugin_transport_https_LDADD = \
297  $(top_builddir)/src/transport/libgnunettransport.la \
298  $(top_builddir)/src/statistics/libgnunetstatistics.la \
299  @LIBCURL@ \
300  $(top_builddir)/src/util/libgnunetutil.la  
301
302 test_transport_api_https_SOURCES = \
303  test_transport_api.c
304 test_transport_api_https_LDADD = \
305  $(top_builddir)/src/transport/libgnunettransport.la \
306  $(top_builddir)/src/util/libgnunetutil.la  
307
308 test_transport_api_reliability_https_SOURCES = \
309  test_transport_api_reliability.c
310 test_transport_api_reliability_https_LDADD = \
311  $(top_builddir)/src/transport/libgnunettransport.la \
312  $(top_builddir)/src/util/libgnunetutil.la
313
314 test_quota_compliance_tcp_SOURCES = \
315  test_quota_compliance.c
316 test_quota_compliance_tcp_LDADD = \
317  $(top_builddir)/src/transport/libgnunettransport.la \
318  $(top_builddir)/src/util/libgnunetutil.la
319
320 test_quota_compliance_http_SOURCES = \
321  test_quota_compliance.c
322 test_quota_compliance_http_LDADD = \
323  $(top_builddir)/src/transport/libgnunettransport.la \
324  $(top_builddir)/src/util/libgnunetutil.la
325
326 test_quota_compliance_https_SOURCES = \
327  test_quota_compliance.c
328 test_quota_compliance_https_LDADD = \
329  $(top_builddir)/src/transport/libgnunettransport.la \
330  $(top_builddir)/src/util/libgnunetutil.la
331
332 test_quota_compliance_udp_SOURCES = \
333  test_quota_compliance.c
334 test_quota_compliance_udp_LDADD = \
335  $(top_builddir)/src/transport/libgnunettransport.la \
336  $(top_builddir)/src/util/libgnunetutil.la
337
338 endif
339
340 EXTRA_DIST = \
341   test_transport_api_data.conf \
342   test_transport_api_tcp_peer1.conf \
343   test_transport_api_tcp_peer2.conf \
344   test_transport_api_udp_peer1.conf \
345   test_transport_api_udp_peer2.conf \
346   test_transport_api_udp_nat_peer1.conf \
347   test_transport_api_udp_nat_peer2.conf \
348   test_transport_api_tcp_nat_peer1.conf \
349   test_transport_api_tcp_nat_peer2.conf \
350   test_plugin_transport_data.conf \
351   test_transport_api_http_peer1.conf \
352   test_transport_api_http_peer2.conf \
353   test_transport_api_https_peer1.conf \
354   test_transport_api_https_peer2.conf \
355   test_transport_api_rel_http_peer1.conf \
356   test_transport_api_rel_http_peer2.conf \
357   test_transport_api_rel_https_peer1.conf \
358   test_transport_api_rel_https_peer2.conf \
359   test_plugin_transport_data_http.conf \
360   test_plugin_transport_data.conf \
361   test_quota_compliance_data.conf \
362   test_quota_compliance_tcp_peer1.conf \
363   test_quota_compliance_tcp_peer2.conf \
364   test_quota_compliance_http_peer1.conf \
365   test_quota_compliance_http_peer2.conf \
366   test_quota_compliance_https_peer1.conf \
367   test_quota_compliance_https_peer2.conf