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