- refactor kx sending, unify under send_kx
[oweals/gnunet.git] / src / datastore / Makefile.am
1 # This Makefile.am is in the public domain
2 AM_CPPFLAGS = -I$(top_srcdir)/src/include
3
4 plugindir = $(libdir)/gnunet
5
6 pkgcfgdir= $(pkgdatadir)/config.d/
7
8 libexecdir= $(pkglibdir)/libexec/
9
10 pkgcfg_DATA = \
11   datastore.conf
12
13 if MINGW
14   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
15 endif
16
17 if USE_COVERAGE
18   AM_CFLAGS = --coverage -O0
19   XLIBS = -lgcov
20 endif
21
22
23 lib_LTLIBRARIES = \
24   libgnunetdatastore.la
25
26 libgnunetdatastore_la_SOURCES = \
27   datastore_api.c datastore.h 
28 libgnunetdatastore_la_LIBADD = \
29   $(top_builddir)/src/statistics/libgnunetstatistics.la \
30   $(top_builddir)/src/util/libgnunetutil.la \
31   $(GN_LIBINTL) 
32 libgnunetdatastore_la_LDFLAGS = \
33   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
34   -version-info 1:0:0
35
36 bin_PROGRAMS = \
37  gnunet-datastore
38
39 libexec_PROGRAMS = \
40  gnunet-service-datastore
41
42 gnunet_service_datastore_SOURCES = \
43  gnunet-service-datastore.c 
44 gnunet_service_datastore_LDADD = \
45   $(top_builddir)/src/statistics/libgnunetstatistics.la \
46   $(top_builddir)/src/util/libgnunetutil.la \
47   $(GN_LIBINTL)
48
49 gnunet_datastore_SOURCES = \
50  gnunet-datastore.c 
51 gnunet_datastore_LDADD = \
52   libgnunetdatastore.la \
53   $(top_builddir)/src/util/libgnunetutil.la \
54   $(GN_LIBINTL)
55
56
57 if HAVE_MYSQL
58  MYSQL_PLUGIN = libgnunet_plugin_datastore_mysql.la
59 if HAVE_TESTING
60 if HAVE_BENCHMARKS
61   MYSQL_BENCHMARKS = \
62    perf_datastore_api_mysql \
63    perf_plugin_datastore_mysql
64 endif
65  MYSQL_TESTS = \
66   test_datastore_api_mysql \
67   test_datastore_api_management_mysql \
68   test_plugin_datastore_mysql \
69   $(MYSQL_BENCHMARKS)
70 endif
71 endif
72 if HAVE_SQLITE
73  SQLITE_PLUGIN = libgnunet_plugin_datastore_sqlite.la
74 if HAVE_TESTING
75 if HAVE_BENCHMARKS
76   SQLITE_BENCHMARKS = \
77    perf_datastore_api_sqlite \
78    perf_plugin_datastore_sqlite
79 endif
80  SQLITE_TESTS = \
81   test_datastore_api_sqlite \
82   test_datastore_api_management_sqlite \
83   test_plugin_datastore_sqlite \
84   $(SQLITE_BENCHMARKS)
85 endif
86 endif
87 if HAVE_POSTGRESQL
88  POSTGRES_PLUGIN = libgnunet_plugin_datastore_postgres.la
89 if HAVE_TESTING
90 if HAVE_BENCHMARKS
91   POSTGRES_BENCHMARKS = \
92    perf_datastore_api_postgres \
93    perf_plugin_datastore_postgres
94 endif
95  POSTGRES_TESTS = \
96   test_datastore_api_postgres \
97   test_datastore_api_management_postgres \
98   test_plugin_datastore_postgres \
99   $(POSTGRES_BENCHMARKS)
100 endif
101 endif
102
103 plugin_LTLIBRARIES = \
104   $(SQLITE_PLUGIN) \
105   $(MYSQL_PLUGIN) \
106   $(POSTGRES_PLUGIN) \
107   libgnunet_plugin_datastore_heap.la \
108   libgnunet_plugin_datastore_template.la 
109
110
111 libgnunet_plugin_datastore_sqlite_la_SOURCES = \
112   plugin_datastore_sqlite.c
113 libgnunet_plugin_datastore_sqlite_la_LIBADD = \
114   $(top_builddir)/src/statistics/libgnunetstatistics.la \
115   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
116   $(LTLIBINTL)
117 libgnunet_plugin_datastore_sqlite_la_LDFLAGS = \
118  $(GN_PLUGIN_LDFLAGS)
119
120
121 libgnunet_plugin_datastore_heap_la_SOURCES = \
122   plugin_datastore_heap.c
123 libgnunet_plugin_datastore_heap_la_LIBADD = \
124   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
125   $(LTLIBINTL)
126 libgnunet_plugin_datastore_heap_la_LDFLAGS = \
127  $(GN_PLUGIN_LDFLAGS)
128
129
130 libgnunet_plugin_datastore_mysql_la_SOURCES = \
131   plugin_datastore_mysql.c
132 libgnunet_plugin_datastore_mysql_la_LIBADD = \
133   $(top_builddir)/src/mysql/libgnunetmysql.la \
134   $(top_builddir)/src/statistics/libgnunetstatistics.la \
135   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) $(Z_LIBS) -lmysqlclient
136 libgnunet_plugin_datastore_mysql_la_LDFLAGS = \
137  $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
138 libgnunet_plugin_datastore_mysql_la_CPPFLAGS = \
139  $(MYSQL_CPPFLAGS) $(AM_CPPFLAGS)
140
141 libgnunet_plugin_datastore_postgres_la_SOURCES = \
142   plugin_datastore_postgres.c
143 libgnunet_plugin_datastore_postgres_la_LIBADD = \
144   $(top_builddir)/src/statistics/libgnunetstatistics.la \
145   $(top_builddir)/src/postgres/libgnunetpostgres.la \
146   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq
147 libgnunet_plugin_datastore_postgres_la_LDFLAGS = \
148  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
149 libgnunet_plugin_datastore_postgres_la_CPPFLAGS = \
150  $(POSTGRESQL_CPPFLAGS) $(AM_CPPFLAGS)
151
152
153 libgnunet_plugin_datastore_template_la_SOURCES = \
154   plugin_datastore_template.c
155 libgnunet_plugin_datastore_template_la_LIBADD = \
156   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
157   $(LTLIBINTL)
158 libgnunet_plugin_datastore_template_la_LDFLAGS = \
159  $(GN_PLUGIN_LDFLAGS)
160
161 check_PROGRAMS = \
162   test_datastore_api_heap \
163   test_datastore_api_management_heap \
164   perf_datastore_api_heap \
165   perf_plugin_datastore_heap \
166   test_plugin_datastore_heap \
167   $(SQLITE_TESTS) \
168   $(MYSQL_TESTS) \
169   $(POSTGRES_TESTS)
170
171 if ENABLE_TEST_RUN
172 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
173 TESTS = $(check_PROGRAMS)
174 endif
175
176 test_datastore_api_heap_SOURCES = \
177  test_datastore_api.c
178 test_datastore_api_heap_LDADD = \
179  $(top_builddir)/src/testing/libgnunettesting.la \
180  libgnunetdatastore.la \
181  $(top_builddir)/src/util/libgnunetutil.la  
182
183 test_datastore_api_management_heap_SOURCES = \
184  test_datastore_api_management.c
185 test_datastore_api_management_heap_LDADD = \
186  $(top_builddir)/src/testing/libgnunettesting.la \
187  libgnunetdatastore.la \
188  $(top_builddir)/src/util/libgnunetutil.la  
189
190 perf_datastore_api_heap_SOURCES = \
191  perf_datastore_api.c
192 perf_datastore_api_heap_LDADD = \
193  $(top_builddir)/src/testing/libgnunettesting.la \
194  libgnunetdatastore.la \
195  $(top_builddir)/src/util/libgnunetutil.la  
196
197 perf_plugin_datastore_heap_SOURCES = \
198  perf_plugin_datastore.c
199 perf_plugin_datastore_heap_LDADD = \
200  $(top_builddir)/src/testing/libgnunettesting.la \
201  $(top_builddir)/src/util/libgnunetutil.la  
202
203 test_plugin_datastore_heap_SOURCES = \
204  test_plugin_datastore.c
205 test_plugin_datastore_heap_LDADD = \
206  $(top_builddir)/src/testing/libgnunettesting.la \
207  $(top_builddir)/src/util/libgnunetutil.la  
208
209
210 test_datastore_api_sqlite_SOURCES = \
211  test_datastore_api.c
212 test_datastore_api_sqlite_LDADD = \
213  $(top_builddir)/src/testing/libgnunettesting.la \
214  libgnunetdatastore.la \
215  $(top_builddir)/src/util/libgnunetutil.la  
216
217 test_datastore_api_management_sqlite_SOURCES = \
218  test_datastore_api_management.c
219 test_datastore_api_management_sqlite_LDADD = \
220  $(top_builddir)/src/testing/libgnunettesting.la \
221  libgnunetdatastore.la \
222  $(top_builddir)/src/util/libgnunetutil.la  
223
224 perf_datastore_api_sqlite_SOURCES = \
225  perf_datastore_api.c
226 perf_datastore_api_sqlite_LDADD = \
227  $(top_builddir)/src/testing/libgnunettesting.la \
228  libgnunetdatastore.la \
229  $(top_builddir)/src/util/libgnunetutil.la  
230
231 perf_plugin_datastore_sqlite_SOURCES = \
232  perf_plugin_datastore.c
233 perf_plugin_datastore_sqlite_LDADD = \
234  $(top_builddir)/src/testing/libgnunettesting.la \
235  $(top_builddir)/src/util/libgnunetutil.la  
236
237 test_plugin_datastore_sqlite_SOURCES = \
238  test_plugin_datastore.c
239 test_plugin_datastore_sqlite_LDADD = \
240  $(top_builddir)/src/testing/libgnunettesting.la \
241  $(top_builddir)/src/util/libgnunetutil.la  
242
243
244 test_datastore_api_mysql_SOURCES = \
245  test_datastore_api.c
246 test_datastore_api_mysql_LDADD = \
247  $(top_builddir)/src/testing/libgnunettesting.la \
248  libgnunetdatastore.la \
249  $(top_builddir)/src/util/libgnunetutil.la  
250
251 test_datastore_api_management_mysql_SOURCES = \
252  test_datastore_api_management.c
253 test_datastore_api_management_mysql_LDADD = \
254  $(top_builddir)/src/testing/libgnunettesting.la \
255  libgnunetdatastore.la \
256  $(top_builddir)/src/util/libgnunetutil.la  
257
258 perf_datastore_api_mysql_SOURCES = \
259  perf_datastore_api.c
260 perf_datastore_api_mysql_LDADD = \
261  $(top_builddir)/src/testing/libgnunettesting.la \
262  libgnunetdatastore.la \
263  $(top_builddir)/src/util/libgnunetutil.la  
264
265 test_plugin_datastore_mysql_SOURCES = \
266  test_plugin_datastore.c
267 test_plugin_datastore_mysql_LDADD = \
268  $(top_builddir)/src/testing/libgnunettesting.la \
269  $(top_builddir)/src/util/libgnunetutil.la  
270
271 perf_plugin_datastore_mysql_SOURCES = \
272  perf_plugin_datastore.c
273 perf_plugin_datastore_mysql_LDADD = \
274  $(top_builddir)/src/testing/libgnunettesting.la \
275  $(top_builddir)/src/util/libgnunetutil.la  
276
277
278 test_datastore_api_postgres_SOURCES = \
279  test_datastore_api.c
280 test_datastore_api_postgres_LDADD = \
281  $(top_builddir)/src/testing/libgnunettesting.la \
282  libgnunetdatastore.la \
283  $(top_builddir)/src/util/libgnunetutil.la  
284
285 test_datastore_api_management_postgres_SOURCES = \
286  test_datastore_api_management.c
287 test_datastore_api_management_postgres_LDADD = \
288  $(top_builddir)/src/testing/libgnunettesting.la \
289  libgnunetdatastore.la \
290  $(top_builddir)/src/util/libgnunetutil.la  
291
292 perf_datastore_api_postgres_SOURCES = \
293  perf_datastore_api.c
294 perf_datastore_api_postgres_LDADD = \
295  $(top_builddir)/src/testing/libgnunettesting.la \
296  libgnunetdatastore.la \
297  $(top_builddir)/src/util/libgnunetutil.la  
298
299 test_plugin_datastore_postgres_SOURCES = \
300  test_plugin_datastore.c
301 test_plugin_datastore_postgres_LDADD = \
302  $(top_builddir)/src/testing/libgnunettesting.la \
303  $(top_builddir)/src/util/libgnunetutil.la  
304
305 perf_plugin_datastore_postgres_SOURCES = \
306  perf_plugin_datastore.c
307 perf_plugin_datastore_postgres_LDADD = \
308  $(top_builddir)/src/testing/libgnunettesting.la \
309  $(top_builddir)/src/util/libgnunetutil.la  
310
311
312 EXTRA_DIST = \
313  test_defaults.conf \
314  test_datastore_api_data_sqlite.conf \
315  perf_plugin_datastore_data_sqlite.conf \
316  test_plugin_datastore_data_sqlite.conf \
317  test_datastore_api_data_heap.conf \
318  perf_plugin_datastore_data_heap.conf \
319  test_plugin_datastore_data_heap.conf \
320  test_datastore_api_data_mysql.conf \
321  perf_plugin_datastore_data_mysql.conf \
322  test_plugin_datastore_data_mysql.conf \
323  test_datastore_api_data_postgres.conf \
324  perf_plugin_datastore_data_postgres.conf \
325  test_plugin_datastore_data_postgres.conf