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