c8d3a1afc41ff4e0523a37b0d36615f8d806126e
[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 bin_PROGRAMS = \
84  gnunet-service-dht \
85  gnunet-dht-get \
86  gnunet-dht-get-peer \
87  gnunet-dht-put
88
89 if HAVE_MALICIOUS
90 noinst_PROGRAMS = \
91  gnunet-dht-driver 
92 endif
93
94 gnunet_service_dht_SOURCES = \
95  gnunet-service-dht.c         
96 gnunet_service_dht_LDADD = \
97   $(top_builddir)/src/statistics/libgnunetstatistics.la \
98   $(top_builddir)/src/core/libgnunetcore.la \
99   $(top_builddir)/src/nse/libgnunetnse.la \
100   $(top_builddir)/src/transport/libgnunettransport.la \
101   $(top_builddir)/src/hello/libgnunethello.la \
102   $(top_builddir)/src/block/libgnunetblock.la \
103   $(top_builddir)/src/datacache/libgnunetdatacache.la \
104   $(top_builddir)/src/util/libgnunetutil.la \
105   $(top_builddir)/src/dht/libgnunetdhtlog.la -lm
106 gnunet_service_dht_DEPENDENCIES = \
107   libgnunetdhtlog.la                              
108
109 gnunet_dht_get_SOURCES = \
110  gnunet-dht-get.c         
111 gnunet_dht_get_LDADD = \
112   $(top_builddir)/src/dht/libgnunetdht.la \
113   $(top_builddir)/src/core/libgnunetcore.la \
114   $(top_builddir)/src/util/libgnunetutil.la 
115 gnunet_dht_get_DEPENDENCIES = \
116   libgnunetdht.la                             
117
118 gnunet_dht_get_peer_SOURCES = \
119  gnunet-dht-get-peer.c         
120 gnunet_dht_get_peer_LDADD = \
121   $(top_builddir)/src/dht/libgnunetdht.la \
122   $(top_builddir)/src/hello/libgnunethello.la \
123   $(top_builddir)/src/core/libgnunetcore.la \
124   $(top_builddir)/src/util/libgnunetutil.la 
125 gnunet_dht_get_peer_DEPENDENCIES = \
126   libgnunetdht.la                             
127
128 gnunet_dht_put_SOURCES = \
129  gnunet-dht-put.c         
130 gnunet_dht_put_LDADD = \
131   $(top_builddir)/src/dht/libgnunetdht.la \
132   $(top_builddir)/src/core/libgnunetcore.la \
133   $(top_builddir)/src/util/libgnunetutil.la 
134 gnunet_dht_put_DEPENDENCIES = \
135   libgnunetdht.la                             
136
137 gnunet_dht_driver_SOURCES = \
138  gnunet-dht-driver.c         
139 gnunet_dht_driver_LDADD = \
140   $(top_builddir)/src/dht/libgnunetdht.la \
141   $(top_builddir)/src/dht/libgnunetdhtlog.la \
142   $(top_builddir)/src/core/libgnunetcore.la \
143   $(top_builddir)/src/testing/libgnunettesting.la \
144   $(top_builddir)/src/util/libgnunetutil.la \
145   $(top_builddir)/src/dht/libgnunetdhtlog.la
146 gnunet_dht_driver_DEPENDENCIES = \
147   libgnunetdht.la \
148   libgnunetdhtlog.la  
149
150
151 check_PROGRAMS = \
152  test_dht_api \
153  test_dht_twopeer \
154  test_dht_twopeer_put_get \
155  test_dht_twopeer_get_put \
156  test_dht_twopeer_path_tracking \
157  test_dht_multipeer \
158  test_dhtlog 
159 # test_hash_operations
160
161 if ENABLE_TEST_RUN
162 TESTS = test_dht_api $(check_SCRIPTS) \
163  test_dht_twopeer \
164  test_dht_twopeer_put_get \
165  test_dht_twopeer_path_tracking \
166  test_dht_multipeer \
167  test_dhtlog
168 endif
169
170 test_dht_api_SOURCES = \
171  test_dht_api.c
172 test_dht_api_LDADD = \
173  $(top_builddir)/src/util/libgnunetutil.la \
174  $(top_builddir)/src/hello/libgnunethello.la \
175  $(top_builddir)/src/dht/libgnunetdht.la
176 test_dht_api_DEPENDENCIES = \
177   libgnunetdht.la                           
178
179 test_dht_multipeer_SOURCES = \
180  test_dht_multipeer.c
181 test_dht_multipeer_LDADD = \
182  $(top_builddir)/src/util/libgnunetutil.la \
183  $(top_builddir)/src/testing/libgnunettesting.la \
184  $(top_builddir)/src/dht/libgnunetdht.la  
185 test_dht_multipeer_DEPENDENCIES = \
186   libgnunetdht.la                           
187  
188 #test_hash_operations_SOURCES = \
189 # test_hash_operations.c
190 #test_hash_operations_LDADD = \
191 # $(top_builddir)/src/util/libgnunetutil.la \
192 # $(top_builddir)/src/testing/libgnunettesting.la \
193 # $(top_builddir)/src/dht/libgnunetdht.la 
194
195 test_dht_twopeer_SOURCES = \
196  test_dht_twopeer.c
197 test_dht_twopeer_LDADD = \
198  $(top_builddir)/src/util/libgnunetutil.la \
199  $(top_builddir)/src/testing/libgnunettesting.la \
200  $(top_builddir)/src/dht/libgnunetdht.la    
201 test_dht_twopeer_DEPENDENCIES = \
202   libgnunetdht.la                           
203
204 test_dht_twopeer_put_get_SOURCES = \
205  test_dht_twopeer_put_get.c
206 test_dht_twopeer_put_get_LDADD = \
207  $(top_builddir)/src/util/libgnunetutil.la \
208  $(top_builddir)/src/testing/libgnunettesting.la \
209  $(top_builddir)/src/dht/libgnunetdht.la   
210
211 test_dht_twopeer_get_put_SOURCES = \
212  test_dht_twopeer_get_put.c
213 test_dht_twopeer_get_put_LDADD = \
214  $(top_builddir)/src/util/libgnunetutil.la \
215  $(top_builddir)/src/testing/libgnunettesting.la \
216  $(top_builddir)/src/dht/libgnunetdht.la   
217
218 test_dht_twopeer_path_tracking_SOURCES = \
219  test_dht_twopeer_path_tracking.c
220 test_dht_twopeer_path_tracking_LDADD = \
221  $(top_builddir)/src/util/libgnunetutil.la \
222  $(top_builddir)/src/testing/libgnunettesting.la \
223  $(top_builddir)/src/dht/libgnunetdht.la   
224
225 test_dhtlog_SOURCES = \
226  test_dhtlog.c
227 test_dhtlog_LDADD = \
228  $(top_builddir)/src/util/libgnunetutil.la \
229  $(top_builddir)/src/testing/libgnunettesting.la \
230  $(top_builddir)/src/dht/libgnunetdht.la \
231  $(top_builddir)/src/dht/libgnunetdhtlog.la
232
233 EXTRA_DIST = \
234   $(check_SCRIPTS) \
235   test_dht_api_data.conf \
236   test_dht_api_peer1.conf \
237   test_dht_twopeer_data.conf \
238   test_dht_multipeer_data.conf \
239   test_dhtlog_data.conf \
240   multipeer_topo.dat
241
242 check_SCRIPTS = \
243   test_dht_tools.sh