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