make code compile with enable-malicious option set
[oweals/gnunet.git] / src / dht / Makefile.am
1 INCLUDES = -I$(top_srcdir)/src/include
2 if MINGW
3  WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols -lole32 -lshell32 -liconv -lstdc++ -lcomdlg32 -lgdi32
4 endif
5
6 plugindir = $(libdir)/gnunet
7
8 if HAVE_MYSQL
9  MYSQL_PLUGIN = libgnunet_plugin_dhtlog_mysql.la
10 endif
11
12 if HAVE_ZLIB
13  ZLIB_LNK = -lz
14 endif
15
16 if USE_COVERAGE
17   AM_CFLAGS = --coverage -O0
18   XLIB = -lgcov
19 endif
20
21 lib_LTLIBRARIES = libgnunetdht.la \
22  libgnunetdhtlog.la
23
24 plugin_LTLIBRARIES = \
25  $(MYSQL_PLUGIN) \
26  libgnunet_plugin_dhtlog_dummy.la \
27  libgnunet_plugin_dhtlog_mysql_dump.la \
28  libgnunet_plugin_dhtlog_mysql_dump_load.la  
29
30
31 libgnunet_plugin_dhtlog_mysql_la_SOURCES = \
32   plugin_dhtlog_mysql.c
33 libgnunet_plugin_dhtlog_mysql_la_LIBADD = \
34   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lz -lsqlite3
35 libgnunet_plugin_dhtlog_mysql_la_LDFLAGS = \
36  $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
37 libgnunet_plugin_dhtlog_mysql_la_CPFLAGS = \
38  $(MYSQL_CPPFLAGS)
39
40 libgnunet_plugin_dhtlog_dummy_la_SOURCES = \
41   plugin_dhtlog_dummy.c
42 libgnunet_plugin_dhtlog_dummy_la_LIBADD = \
43   $(top_builddir)/src/util/libgnunetutil.la \
44   $(XLIB)
45 libgnunet_plugin_dhtlog_dummy_la_LDFLAGS = \
46  $(GN_PLUGIN_LDFLAGS)
47
48 libgnunet_plugin_dhtlog_mysql_dump_la_SOURCES = \
49   plugin_dhtlog_mysql_dump.c
50 libgnunet_plugin_dhtlog_mysql_dump_la_LIBADD = \
51   $(top_builddir)/src/util/libgnunetutil.la \
52   $(XLIB)
53 libgnunet_plugin_dhtlog_mysql_dump_la_LDFLAGS = \
54  $(GN_PLUGIN_LDFLAGS)
55
56 libgnunet_plugin_dhtlog_mysql_dump_load_la_SOURCES = \
57   plugin_dhtlog_mysql_dump_load.c
58 libgnunet_plugin_dhtlog_mysql_dump_load_la_LIBADD = \
59   $(top_builddir)/src/util/libgnunetutil.la \
60   $(XLIB)
61 libgnunet_plugin_dhtlog_mysql_dump_load_la_LDFLAGS = \
62  $(GN_PLUGIN_LDFLAGS)
63
64 libgnunetdhtlog_la_SOURCES = \
65   dhtlog.c dhtlog.h
66 libgnunetdhtlog_la_LIBADD = \
67   $(top_builddir)/src/util/libgnunetutil.la
68 libgnunetdhtlog_la_LDFLAGS = \
69   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
70   -version-info 0:0:0
71
72 libgnunetdht_la_SOURCES = \
73   dht_api.c dht.h \
74   dht_api_get_put.c \
75   dht_api_find_peer.c 
76 libgnunetdht_la_LIBADD = \
77   $(top_builddir)/src/util/libgnunetutil.la \
78   $(XLIB)
79 libgnunetdht_la_LDFLAGS = \
80   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
81   -version-info 0:0:0
82
83 if HAVE_EXPERIMENTAL
84 STUD_PROGS =  gnunet-service-dht-can \
85  gnunet-service-dht-freenet \
86  gnunet-service-dht-kademlia \
87  gnunet-service-dht-koorde 
88 STUD_TESTS = test_kademlia_end2end
89 endif
90
91 bin_PROGRAMS = $(STUD_PROGS) \
92  gnunet-service-dht \
93  gnunet-dht-get \
94  gnunet-dht-get-peer \
95  gnunet-dht-put 
96
97 if HAVE_MALICIOUS
98 noinst_PROGRAMS = \
99  gnunet-dht-driver 
100 endif
101
102 gnunet_service_dht_SOURCES = \
103  gnunet-service-dht.c         
104 gnunet_service_dht_LDADD = \
105   $(top_builddir)/src/statistics/libgnunetstatistics.la \
106   $(top_builddir)/src/core/libgnunetcore.la \
107   $(top_builddir)/src/transport/libgnunettransport.la \
108   $(top_builddir)/src/hello/libgnunethello.la \
109   $(top_builddir)/src/datacache/libgnunetdatacache.la \
110   $(top_builddir)/src/util/libgnunetutil.la \
111   $(top_builddir)/src/dht/libgnunetdhtlog.la -lm
112
113 gnunet_service_dht_can_SOURCES = \
114  dht_can.c dht_can_helper.c dht_can_helper.h
115 gnunet_service_dht_can_LDADD = \
116   $(top_builddir)/src/statistics/libgnunetstatistics.la \
117   $(top_builddir)/src/core/libgnunetcore.la \
118   $(top_builddir)/src/transport/libgnunettransport.la \
119   $(top_builddir)/src/hello/libgnunethello.la \
120   $(top_builddir)/src/datacache/libgnunetdatacache.la \
121   $(top_builddir)/src/util/libgnunetutil.la 
122
123 gnunet_service_dht_freenet_SOURCES = \
124  dht_freenet.c 
125 gnunet_service_dht_freenet_LDADD = \
126   $(top_builddir)/src/statistics/libgnunetstatistics.la \
127   $(top_builddir)/src/core/libgnunetcore.la \
128   $(top_builddir)/src/transport/libgnunettransport.la \
129   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
130   $(top_builddir)/src/hello/libgnunethello.la \
131   $(top_builddir)/src/datacache/libgnunetdatacache.la \
132   $(top_builddir)/src/util/libgnunetutil.la 
133
134 gnunet_service_dht_kademlia_SOURCES = \
135  dht_kademlia.c dht_kademlia.h
136 gnunet_service_dht_kademlia_LDADD = \
137   $(top_builddir)/src/statistics/libgnunetstatistics.la \
138   $(top_builddir)/src/core/libgnunetcore.la \
139   $(top_builddir)/src/transport/libgnunettransport.la \
140   $(top_builddir)/src/hello/libgnunethello.la \
141   $(top_builddir)/src/datacache/libgnunetdatacache.la \
142   $(top_builddir)/src/util/libgnunetutil.la 
143
144 gnunet_service_dht_koorde_SOURCES = \
145  dht_koorde.c dht_koorde.h
146 gnunet_service_dht_koorde_LDADD = \
147   $(top_builddir)/src/statistics/libgnunetstatistics.la \
148   $(top_builddir)/src/core/libgnunetcore.la \
149   $(top_builddir)/src/transport/libgnunettransport.la \
150   $(top_builddir)/src/hello/libgnunethello.la \
151   $(top_builddir)/src/datacache/libgnunetdatacache.la \
152   $(top_builddir)/src/util/libgnunetutil.la 
153
154 gnunet_dht_get_SOURCES = \
155  gnunet-dht-get.c         
156 gnunet_dht_get_LDADD = \
157   $(top_builddir)/src/dht/libgnunetdht.la \
158   $(top_builddir)/src/core/libgnunetcore.la \
159   $(top_builddir)/src/util/libgnunetutil.la 
160
161 gnunet_dht_get_peer_SOURCES = \
162  gnunet-dht-get-peer.c         
163 gnunet_dht_get_peer_LDADD = \
164   $(top_builddir)/src/dht/libgnunetdht.la \
165   $(top_builddir)/src/hello/libgnunethello.la \
166   $(top_builddir)/src/core/libgnunetcore.la \
167   $(top_builddir)/src/util/libgnunetutil.la 
168
169 gnunet_dht_put_SOURCES = \
170  gnunet-dht-put.c         
171 gnunet_dht_put_LDADD = \
172   $(top_builddir)/src/dht/libgnunetdht.la \
173   $(top_builddir)/src/core/libgnunetcore.la \
174   $(top_builddir)/src/util/libgnunetutil.la 
175
176 gnunet_dht_driver_SOURCES = \
177  gnunet-dht-driver.c         
178 gnunet_dht_driver_LDADD = \
179   $(top_builddir)/src/dht/libgnunetdht.la \
180   $(top_builddir)/src/dht/libgnunetdhtlog.la \
181   $(top_builddir)/src/core/libgnunetcore.la \
182   $(top_builddir)/src/testing/libgnunettesting.la \
183   $(top_builddir)/src/util/libgnunetutil.la \
184   $(top_builddir)/src/dht/libgnunetdhtlog.la
185
186 check_PROGRAMS = $(STUD_TESTS) \
187  test_dht_api \
188  test_dht_twopeer \
189  test_dht_twopeer_put_get \
190  test_dht_multipeer \
191  test_dhtlog 
192 # test_hash_operations
193
194 if !DISABLE_TEST_RUN
195 TESTS = test_dht_api $(check_SCRIPTS) \
196  test_dht_twopeer \
197  test_dht_twopeer_put_get
198 endif
199
200 test_dht_api_SOURCES = \
201  test_dht_api.c
202 test_dht_api_LDADD = \
203  $(top_builddir)/src/util/libgnunetutil.la \
204  $(top_builddir)/src/hello/libgnunethello.la \
205  $(top_builddir)/src/dht/libgnunetdht.la
206
207 test_dht_multipeer_SOURCES = \
208  test_dht_multipeer.c
209 test_dht_multipeer_LDADD = \
210  $(top_builddir)/src/util/libgnunetutil.la \
211  $(top_builddir)/src/testing/libgnunettesting.la \
212  $(top_builddir)/src/dht/libgnunetdht.la  
213  
214 #test_hash_operations_SOURCES = \
215 # test_hash_operations.c
216 #test_hash_operations_LDADD = \
217 # $(top_builddir)/src/util/libgnunetutil.la \
218 # $(top_builddir)/src/testing/libgnunettesting.la \
219 # $(top_builddir)/src/dht/libgnunetdht.la 
220
221 test_dht_twopeer_SOURCES = \
222  test_dht_twopeer.c
223 test_dht_twopeer_LDADD = \
224  $(top_builddir)/src/util/libgnunetutil.la \
225  $(top_builddir)/src/testing/libgnunettesting.la \
226  $(top_builddir)/src/dht/libgnunetdht.la    
227
228 test_dht_twopeer_put_get_SOURCES = \
229  test_dht_twopeer_put_get.c
230 test_dht_twopeer_put_get_LDADD = \
231  $(top_builddir)/src/util/libgnunetutil.la \
232  $(top_builddir)/src/testing/libgnunettesting.la \
233  $(top_builddir)/src/dht/libgnunetdht.la   
234
235 test_dhtlog_SOURCES = \
236  test_dhtlog.c
237 test_dhtlog_LDADD = \
238  $(top_builddir)/src/util/libgnunetutil.la \
239  $(top_builddir)/src/testing/libgnunettesting.la \
240  $(top_builddir)/src/dht/libgnunetdht.la \
241  $(top_builddir)/src/dht/libgnunetdhtlog.la
242
243 test_kademlia_end2end_SOURCES = \
244  test_kademlia_end2end.c
245 test_kademlia_end2end_LDADD = \
246  $(top_builddir)/src/util/libgnunetutil.la \
247  $(top_builddir)/src/testing/libgnunettesting.la \
248  $(top_builddir)/src/dht/libgnunetdht.la \
249  $(top_builddir)/src/dht/libgnunetdhtlog.la
250
251 EXTRA_DIST = \
252   $(check_SCRIPTS) \
253   test_dht_api_data.conf \
254   test_dht_api_peer1.conf \
255   test_dht_twopeer_data.conf \
256   test_dht_multipeer_data.conf
257
258 check_SCRIPTS = \
259   test_dht_tools.sh