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