70fa5ca2808b5bb777afb73fdbc5096fba3b4e49
[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 = \
22  libgnunetdht.la \
23  libgnunetdhtnew.la \
24  libgnunetdhtlog.la
25
26 plugin_LTLIBRARIES = \
27  $(MYSQL_PLUGIN) \
28  libgnunet_plugin_dhtlog_dummy.la \
29  libgnunet_plugin_dhtlog_mysql_dump.la \
30  libgnunet_plugin_dhtlog_mysql_dump_load.la  
31
32
33 libgnunet_plugin_dhtlog_mysql_la_SOURCES = \
34   plugin_dhtlog_mysql.c
35 libgnunet_plugin_dhtlog_mysql_la_LIBADD = \
36   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lz -lsqlite3
37 libgnunet_plugin_dhtlog_mysql_la_LDFLAGS = \
38  $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
39 libgnunet_plugin_dhtlog_mysql_la_CPFLAGS = \
40  $(MYSQL_CPPFLAGS)
41
42 libgnunet_plugin_dhtlog_dummy_la_SOURCES = \
43   plugin_dhtlog_dummy.c
44 libgnunet_plugin_dhtlog_dummy_la_LIBADD = \
45   $(top_builddir)/src/util/libgnunetutil.la \
46   $(XLIB)
47 libgnunet_plugin_dhtlog_dummy_la_LDFLAGS = \
48  $(GN_PLUGIN_LDFLAGS)
49
50 libgnunet_plugin_dhtlog_mysql_dump_la_SOURCES = \
51   plugin_dhtlog_mysql_dump.c
52 libgnunet_plugin_dhtlog_mysql_dump_la_LIBADD = \
53   $(top_builddir)/src/util/libgnunetutil.la \
54   $(XLIB)
55 libgnunet_plugin_dhtlog_mysql_dump_la_LDFLAGS = \
56  $(GN_PLUGIN_LDFLAGS)
57
58 libgnunet_plugin_dhtlog_mysql_dump_load_la_SOURCES = \
59   plugin_dhtlog_mysql_dump_load.c
60 libgnunet_plugin_dhtlog_mysql_dump_load_la_LIBADD = \
61   $(top_builddir)/src/util/libgnunetutil.la \
62   $(XLIB)
63 libgnunet_plugin_dhtlog_mysql_dump_load_la_LDFLAGS = \
64  $(GN_PLUGIN_LDFLAGS)
65
66 libgnunetdhtlog_la_SOURCES = \
67   dhtlog.c dhtlog.h
68 libgnunetdhtlog_la_LIBADD = \
69   $(top_builddir)/src/util/libgnunetutil.la
70 libgnunetdhtlog_la_LDFLAGS = \
71   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
72   -version-info 0:0:0
73
74 libgnunetdht_la_SOURCES = \
75   dht_api.c dht.h \
76   dht_api_get_put.c \
77   dht_api_find_peer.c 
78 libgnunetdht_la_LIBADD = \
79   $(top_builddir)/src/util/libgnunetutil.la \
80   $(XLIB)
81 libgnunetdht_la_LDFLAGS = \
82   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
83   -version-info 0:0:0
84
85 libgnunetdhtnew_la_SOURCES = \
86   dht_api_new.c dht_new.h 
87 libgnunetdhtnew_la_LIBADD = \
88   $(top_builddir)/src/util/libgnunetutil.la \
89   $(XLIB)
90 libgnunetdhtnew_la_LDFLAGS = \
91   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
92   -version-info 0:0:0
93
94 bin_PROGRAMS = \
95  gnunet-service-dht \
96  gnunet-service-dht-new \
97  gnunet-dht-get \
98  gnunet-dht-get-peer \
99  gnunet-dht-put
100
101 if HAVE_MALICIOUS
102 noinst_PROGRAMS = \
103  gnunet-dht-driver 
104 endif
105
106 gnunet_service_dht_SOURCES = \
107  gnunet-service-dht.c         
108 gnunet_service_dht_LDADD = \
109   $(top_builddir)/src/statistics/libgnunetstatistics.la \
110   $(top_builddir)/src/core/libgnunetcore.la \
111   $(top_builddir)/src/nse/libgnunetnse.la \
112   $(top_builddir)/src/transport/libgnunettransport.la \
113   $(top_builddir)/src/hello/libgnunethello.la \
114   $(top_builddir)/src/block/libgnunetblock.la \
115   $(top_builddir)/src/datacache/libgnunetdatacache.la \
116   $(top_builddir)/src/util/libgnunetutil.la \
117   $(top_builddir)/src/dht/libgnunetdhtlog.la -lm
118 gnunet_service_dht_DEPENDENCIES = \
119   libgnunetdhtlog.la                              
120
121 gnunet_service_dht_new_SOURCES = \
122  gnunet-service-dht-new.c gnunet-service-dht.h \
123  gnunet-service-dht_clients.c gnunet-service-dht_clients.h \
124  gnunet-service-dht_datacache.c gnunet-service-dht_datacache.h \
125  gnunet-service-dht_nse.c gnunet-service-dht_nse.h \
126  gnunet-service-dht_neighbours.c gnunet-service-dht_neighbours.h \
127  gnunet-service-dht_routing.c gnunet-service-dht_routing.h 
128 gnunet_service_dht_new_LDADD = \
129   $(top_builddir)/src/statistics/libgnunetstatistics.la \
130   $(top_builddir)/src/core/libgnunetcore.la \
131   $(top_builddir)/src/nse/libgnunetnse.la \
132   $(top_builddir)/src/transport/libgnunettransport.la \
133   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
134   $(top_builddir)/src/hello/libgnunethello.la \
135   $(top_builddir)/src/block/libgnunetblock.la \
136   $(top_builddir)/src/datacache/libgnunetdatacache.la \
137   $(top_builddir)/src/util/libgnunetutil.la \
138   -lm
139
140 gnunet_dht_get_SOURCES = \
141  gnunet-dht-get.c         
142 gnunet_dht_get_LDADD = \
143   $(top_builddir)/src/dht/libgnunetdht.la \
144   $(top_builddir)/src/core/libgnunetcore.la \
145   $(top_builddir)/src/util/libgnunetutil.la 
146 gnunet_dht_get_DEPENDENCIES = \
147   libgnunetdht.la                             
148
149 gnunet_dht_get_peer_SOURCES = \
150  gnunet-dht-get-peer.c         
151 gnunet_dht_get_peer_LDADD = \
152   $(top_builddir)/src/dht/libgnunetdht.la \
153   $(top_builddir)/src/hello/libgnunethello.la \
154   $(top_builddir)/src/core/libgnunetcore.la \
155   $(top_builddir)/src/util/libgnunetutil.la 
156 gnunet_dht_get_peer_DEPENDENCIES = \
157   libgnunetdht.la                             
158
159 gnunet_dht_put_SOURCES = \
160  gnunet-dht-put.c         
161 gnunet_dht_put_LDADD = \
162   $(top_builddir)/src/dht/libgnunetdht.la \
163   $(top_builddir)/src/core/libgnunetcore.la \
164   $(top_builddir)/src/util/libgnunetutil.la 
165 gnunet_dht_put_DEPENDENCIES = \
166   libgnunetdht.la                             
167
168 gnunet_dht_driver_SOURCES = \
169  gnunet-dht-driver.c         
170 gnunet_dht_driver_LDADD = \
171   $(top_builddir)/src/dht/libgnunetdht.la \
172   $(top_builddir)/src/dht/libgnunetdhtlog.la \
173   $(top_builddir)/src/core/libgnunetcore.la \
174   $(top_builddir)/src/testing/libgnunettesting.la \
175   $(top_builddir)/src/util/libgnunetutil.la \
176   $(top_builddir)/src/dht/libgnunetdhtlog.la
177 gnunet_dht_driver_DEPENDENCIES = \
178   libgnunetdht.la \
179   libgnunetdhtlog.la  
180
181
182 check_PROGRAMS = \
183  test_dht_api \
184  test_dht_twopeer \
185  test_dht_twopeer_put_get \
186  test_dht_twopeer_get_put \
187  test_dht_twopeer_path_tracking \
188  test_dht_multipeer \
189  test_dhtlog 
190 # test_hash_operations
191
192 if ENABLE_TEST_RUN
193 TESTS = test_dht_api $(check_SCRIPTS) \
194  test_dht_twopeer \
195  test_dht_twopeer_put_get \
196  test_dht_twopeer_get_put \
197  test_dht_twopeer_path_tracking \
198  test_dht_multipeer \
199  test_dhtlog
200 endif
201
202 test_dht_api_SOURCES = \
203  test_dht_api.c
204 test_dht_api_LDADD = \
205  $(top_builddir)/src/util/libgnunetutil.la \
206  $(top_builddir)/src/hello/libgnunethello.la \
207  $(top_builddir)/src/dht/libgnunetdht.la
208 test_dht_api_DEPENDENCIES = \
209   libgnunetdht.la                           
210
211 test_dht_multipeer_SOURCES = \
212  test_dht_multipeer.c
213 test_dht_multipeer_LDADD = \
214  $(top_builddir)/src/util/libgnunetutil.la \
215  $(top_builddir)/src/testing/libgnunettesting.la \
216  $(top_builddir)/src/dht/libgnunetdht.la  
217 test_dht_multipeer_DEPENDENCIES = \
218   libgnunetdht.la                           
219  
220 #test_hash_operations_SOURCES = \
221 # test_hash_operations.c
222 #test_hash_operations_LDADD = \
223 # $(top_builddir)/src/util/libgnunetutil.la \
224 # $(top_builddir)/src/testing/libgnunettesting.la \
225 # $(top_builddir)/src/dht/libgnunetdht.la 
226
227 test_dht_twopeer_SOURCES = \
228  test_dht_twopeer.c
229 test_dht_twopeer_LDADD = \
230  $(top_builddir)/src/util/libgnunetutil.la \
231  $(top_builddir)/src/testing/libgnunettesting.la \
232  $(top_builddir)/src/dht/libgnunetdht.la    
233 test_dht_twopeer_DEPENDENCIES = \
234   libgnunetdht.la                           
235
236 test_dht_twopeer_put_get_SOURCES = \
237  test_dht_twopeer_put_get.c
238 test_dht_twopeer_put_get_LDADD = \
239  $(top_builddir)/src/util/libgnunetutil.la \
240  $(top_builddir)/src/testing/libgnunettesting.la \
241  $(top_builddir)/src/dht/libgnunetdht.la   
242
243 test_dht_twopeer_get_put_SOURCES = \
244  test_dht_twopeer_get_put.c
245 test_dht_twopeer_get_put_LDADD = \
246  $(top_builddir)/src/util/libgnunetutil.la \
247  $(top_builddir)/src/testing/libgnunettesting.la \
248  $(top_builddir)/src/dht/libgnunetdht.la   
249
250 test_dht_twopeer_path_tracking_SOURCES = \
251  test_dht_twopeer_path_tracking.c
252 test_dht_twopeer_path_tracking_LDADD = \
253  $(top_builddir)/src/util/libgnunetutil.la \
254  $(top_builddir)/src/testing/libgnunettesting.la \
255  $(top_builddir)/src/dht/libgnunetdht.la   
256
257 test_dhtlog_SOURCES = \
258  test_dhtlog.c
259 test_dhtlog_LDADD = \
260  $(top_builddir)/src/util/libgnunetutil.la \
261  $(top_builddir)/src/testing/libgnunettesting.la \
262  $(top_builddir)/src/dht/libgnunetdht.la \
263  $(top_builddir)/src/dht/libgnunetdhtlog.la
264
265 EXTRA_DIST = \
266   $(check_SCRIPTS) \
267   test_dht_api_data.conf \
268   test_dht_api_peer1.conf \
269   test_dht_twopeer_data.conf \
270   test_dht_multipeer_data.conf \
271   test_dhtlog_data.conf \
272   multipeer_topo.dat
273
274 check_SCRIPTS = \
275   test_dht_tools.sh