(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 endif
14
15 if USE_COVERAGE
16   AM_CFLAGS = --coverage -O0
17 endif
18
19 if LINUX
20 NATBIN = gnunet-nat-server gnunet-nat-client
21 install-exec-hook:
22         chown root $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client || true
23         chmod u+s $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client || true
24 else
25 install-exec-hook:
26 endif
27
28
29 lib_LTLIBRARIES = \
30   libgnunettransport.la
31
32 libgnunettransport_la_SOURCES = \
33   transport_api.c transport.h \
34   transport_api_blacklist.c \
35   transport_api_address_lookup.c 
36 libgnunettransport_la_LIBADD = \
37   $(top_builddir)/src/hello/libgnunethello.la \
38   $(top_builddir)/src/util/libgnunetutil.la \
39   $(GN_LIBINTL) 
40 libgnunettransport_la_LDFLAGS = \
41   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
42   -version-info 0:0:0
43
44
45 bin_PROGRAMS = \
46  gnunet-transport \
47  gnunet-service-transport $(NATBIN)
48
49
50 gnunet_nat_server_SOURCES = \
51  gnunet-nat-server.c         
52
53 gnunet_nat_client_SOURCES = \
54  gnunet-nat-client.c         
55
56
57 gnunet_transport_SOURCES = \
58  gnunet-transport.c         
59 gnunet_transport_LDADD = \
60   $(top_builddir)/src/transport/libgnunettransport.la \
61   $(top_builddir)/src/util/libgnunetutil.la \
62   $(GN_LIBINTL)
63
64 gnunet_service_transport_SOURCES = \
65  gnunet-service-transport.c plugin_transport.h 
66 gnunet_service_transport_LDADD = \
67   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
68   $(top_builddir)/src/statistics/libgnunetstatistics.la \
69   $(top_builddir)/src/util/libgnunetutil.la \
70   $(GN_LIBINTL)
71
72
73 plugin_LTLIBRARIES = \
74   libgnunet_plugin_transport_tcp.la \
75   libgnunet_plugin_transport_udp.la \
76   libgnunet_plugin_transport_udp_nat.la \
77   $(HTTP_PLUGIN_LA) \
78   libgnunet_plugin_transport_template.la
79 # TODO: add http, nat, etc.
80
81 libgnunet_plugin_transport_tcp_la_SOURCES = \
82   plugin_transport_tcp.c
83 libgnunet_plugin_transport_tcp_la_LIBADD = \
84   $(top_builddir)/src/hello/libgnunethello.la \
85   $(top_builddir)/src/statistics/libgnunetstatistics.la \
86   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
87   $(top_builddir)/src/util/libgnunetutil.la 
88 libgnunet_plugin_transport_tcp_la_LDFLAGS = \
89  $(GN_PLUGIN_LDFLAGS)
90
91 libgnunet_plugin_transport_template_la_SOURCES = \
92   plugin_transport_template.c
93 libgnunet_plugin_transport_template_la_LIBADD = \
94   $(top_builddir)/src/util/libgnunetutil.la 
95 libgnunet_plugin_transport_template_la_LDFLAGS = \
96  $(GN_PLUGIN_LDFLAGS)
97
98 libgnunet_plugin_transport_udp_la_SOURCES = \
99   plugin_transport_udp.c
100 libgnunet_plugin_transport_udp_la_LIBADD = \
101   $(top_builddir)/src/hello/libgnunethello.la \
102   $(top_builddir)/src/statistics/libgnunetstatistics.la \
103   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
104   $(top_builddir)/src/util/libgnunetutil.la 
105 libgnunet_plugin_transport_udp_la_LDFLAGS = \
106  $(GN_PLUGIN_LDFLAGS)
107
108 libgnunet_plugin_transport_udp_nat_la_SOURCES = \
109   plugin_transport_udp_nat.c
110 libgnunet_plugin_transport_udp_nat_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_udp_nat_la_LDFLAGS = \
116  $(GN_PLUGIN_LDFLAGS)
117
118 if HAVE_MHD 
119 libgnunet_plugin_transport_http_la_SOURCES = \
120   plugin_transport_http.c
121 libgnunet_plugin_transport_http_la_LIBADD = \
122   $(top_builddir)/src/hello/libgnunethello.la \
123   $(top_builddir)/src/statistics/libgnunetstatistics.la \
124   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
125   @LIBCURL@ \
126   $(top_builddir)/src/util/libgnunetutil.la 
127 libgnunet_plugin_transport_http_la_LDFLAGS = \
128  $(GN_LIBMHD) \
129  $(GN_PLUGIN_LDFLAGS)
130 endif
131
132 check_PROGRAMS = \
133  test_transport_api_tcp \
134  test_transport_api_tcp \
135  test_transport_api_udp \
136  $(HTTP_PLUGIN_CHECK) \
137  test_transport_api_udp_nat \
138  test_transport_api_reliability_tcp 
139 # test_transport_api_http \
140 # TODO: add tests for http, nat, etc.
141
142 TESTS = $(check_PROGRAMS)
143
144 test_transport_api_tcp_SOURCES = \
145  test_transport_api.c
146 test_transport_api_tcp_LDADD = \
147  $(top_builddir)/src/transport/libgnunettransport.la \
148  $(top_builddir)/src/util/libgnunetutil.la  
149
150 test_transport_api_reliability_tcp_SOURCES = \
151  test_transport_api_reliability.c
152 test_transport_api_reliability_tcp_LDADD = \
153  $(top_builddir)/src/transport/libgnunettransport.la \
154  $(top_builddir)/src/util/libgnunetutil.la  
155
156 test_transport_api_udp_SOURCES = \
157  test_transport_api.c
158 test_transport_api_udp_LDADD = \
159  $(top_builddir)/src/transport/libgnunettransport.la \
160  $(top_builddir)/src/util/libgnunetutil.la  
161
162 test_transport_api_udp_nat_SOURCES = \
163  test_transport_api.c
164 test_transport_api_udp_nat_LDADD = \
165  $(top_builddir)/src/transport/libgnunettransport.la \
166  $(top_builddir)/src/util/libgnunetutil.la  
167
168 #test_transport_api_http_SOURCES = \
169 # test_transport_api.c
170 #test_transport_api_http_LDADD = \
171 # $(top_builddir)/src/transport/libgnunettransport.la \
172 # $(top_builddir)/src/util/libgnunetutil.la  
173
174 test_plugin_transport_http_SOURCES = \
175  test_plugin_transport_http.c
176 test_plugin_transport_http_LDADD = \
177  $(top_builddir)/src/transport/libgnunettransport.la \
178  $(top_builddir)/src/statistics/libgnunetstatistics.la \
179  @LIBCURL@ \
180  $(top_builddir)/src/util/libgnunetutil.la  
181
182
183 EXTRA_DIST = \
184   test_transport_api_data.conf \
185   test_transport_api_tcp_peer1.conf \
186   test_transport_api_tcp_peer2.conf \
187   test_transport_api_udp_peer1.conf \
188   test_transport_api_udp_peer2.conf \
189   test_transport_api_udp_nat_peer1.conf \
190   test_transport_api_udp_nat_peer2.conf \
191   test_plugin_transport_data.conf \
192   test_plugin_transport_data_http.conf