Merge branch 'master' of git+ssh://gnunet.org/gnunet
[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
109 # Real plugins should of course go into
110 # plugin_LTLIBRARIES
111 noinst_LTLIBRARIES = \
112   libgnunet_plugin_datastore_template.la
113
114
115 libgnunet_plugin_datastore_sqlite_la_SOURCES = \
116   plugin_datastore_sqlite.c
117 libgnunet_plugin_datastore_sqlite_la_LIBADD = \
118   $(top_builddir)/src/statistics/libgnunetstatistics.la \
119   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
120   $(LTLIBINTL)
121 libgnunet_plugin_datastore_sqlite_la_LDFLAGS = \
122  $(GN_PLUGIN_LDFLAGS)
123
124
125 libgnunet_plugin_datastore_heap_la_SOURCES = \
126   plugin_datastore_heap.c
127 libgnunet_plugin_datastore_heap_la_LIBADD = \
128   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
129   $(LTLIBINTL)
130 libgnunet_plugin_datastore_heap_la_LDFLAGS = \
131  $(GN_PLUGIN_LDFLAGS)
132
133
134 libgnunet_plugin_datastore_mysql_la_SOURCES = \
135   plugin_datastore_mysql.c
136 libgnunet_plugin_datastore_mysql_la_LIBADD = \
137   $(top_builddir)/src/my/libgnunetmy.la \
138   $(top_builddir)/src/mysql/libgnunetmysql.la \
139   $(top_builddir)/src/statistics/libgnunetstatistics.la \
140   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) $(Z_LIBS) -lmysqlclient
141 libgnunet_plugin_datastore_mysql_la_LDFLAGS = \
142  $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
143 libgnunet_plugin_datastore_mysql_la_CPPFLAGS = \
144  $(MYSQL_CPPFLAGS) $(AM_CPPFLAGS)
145
146 libgnunet_plugin_datastore_postgres_la_SOURCES = \
147   plugin_datastore_postgres.c
148 libgnunet_plugin_datastore_postgres_la_LIBADD = \
149   $(top_builddir)/src/statistics/libgnunetstatistics.la \
150   $(top_builddir)/src/postgres/libgnunetpostgres.la \
151   $(top_builddir)/src/pq/libgnunetpq.la \
152   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq
153 libgnunet_plugin_datastore_postgres_la_LDFLAGS = \
154  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
155 libgnunet_plugin_datastore_postgres_la_CPPFLAGS = \
156  $(POSTGRESQL_CPPFLAGS) $(AM_CPPFLAGS)
157
158
159 libgnunet_plugin_datastore_template_la_SOURCES = \
160   plugin_datastore_template.c
161 libgnunet_plugin_datastore_template_la_LIBADD = \
162   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
163   $(LTLIBINTL)
164 libgnunet_plugin_datastore_template_la_LDFLAGS = \
165  $(GN_PLUGIN_LDFLAGS)
166
167 check_PROGRAMS = \
168   test_datastore_api_heap \
169   test_datastore_api_management_heap \
170   perf_datastore_api_heap \
171   perf_plugin_datastore_heap \
172   test_plugin_datastore_heap \
173   $(SQLITE_TESTS) \
174   $(MYSQL_TESTS) \
175   $(POSTGRES_TESTS)
176
177 if ENABLE_TEST_RUN
178 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
179 TESTS = $(check_PROGRAMS)
180 endif
181
182 test_datastore_api_heap_SOURCES = \
183  test_datastore_api.c
184 test_datastore_api_heap_LDADD = \
185  $(top_builddir)/src/testing/libgnunettesting.la \
186  libgnunetdatastore.la \
187  $(top_builddir)/src/util/libgnunetutil.la
188
189 test_datastore_api_management_heap_SOURCES = \
190  test_datastore_api_management.c
191 test_datastore_api_management_heap_LDADD = \
192  $(top_builddir)/src/testing/libgnunettesting.la \
193  libgnunetdatastore.la \
194  $(top_builddir)/src/util/libgnunetutil.la
195
196 perf_datastore_api_heap_SOURCES = \
197  perf_datastore_api.c
198 perf_datastore_api_heap_LDADD = \
199  $(top_builddir)/src/testing/libgnunettesting.la \
200  libgnunetdatastore.la \
201  $(top_builddir)/src/util/libgnunetutil.la
202
203 perf_plugin_datastore_heap_SOURCES = \
204  perf_plugin_datastore.c
205 perf_plugin_datastore_heap_LDADD = \
206  $(top_builddir)/src/testing/libgnunettesting.la \
207  $(top_builddir)/src/util/libgnunetutil.la
208
209 test_plugin_datastore_heap_SOURCES = \
210  test_plugin_datastore.c
211 test_plugin_datastore_heap_LDADD = \
212  $(top_builddir)/src/testing/libgnunettesting.la \
213  $(top_builddir)/src/util/libgnunetutil.la
214
215
216 test_datastore_api_sqlite_SOURCES = \
217  test_datastore_api.c
218 test_datastore_api_sqlite_LDADD = \
219  $(top_builddir)/src/testing/libgnunettesting.la \
220  libgnunetdatastore.la \
221  $(top_builddir)/src/util/libgnunetutil.la
222
223 test_datastore_api_management_sqlite_SOURCES = \
224  test_datastore_api_management.c
225 test_datastore_api_management_sqlite_LDADD = \
226  $(top_builddir)/src/testing/libgnunettesting.la \
227  libgnunetdatastore.la \
228  $(top_builddir)/src/util/libgnunetutil.la
229
230 perf_datastore_api_sqlite_SOURCES = \
231  perf_datastore_api.c
232 perf_datastore_api_sqlite_LDADD = \
233  $(top_builddir)/src/testing/libgnunettesting.la \
234  libgnunetdatastore.la \
235  $(top_builddir)/src/util/libgnunetutil.la
236
237 perf_plugin_datastore_sqlite_SOURCES = \
238  perf_plugin_datastore.c
239 perf_plugin_datastore_sqlite_LDADD = \
240  $(top_builddir)/src/testing/libgnunettesting.la \
241  $(top_builddir)/src/util/libgnunetutil.la
242
243 test_plugin_datastore_sqlite_SOURCES = \
244  test_plugin_datastore.c
245 test_plugin_datastore_sqlite_LDADD = \
246  $(top_builddir)/src/testing/libgnunettesting.la \
247  $(top_builddir)/src/util/libgnunetutil.la
248
249
250 test_datastore_api_mysql_SOURCES = \
251  test_datastore_api.c
252 test_datastore_api_mysql_LDADD = \
253  $(top_builddir)/src/testing/libgnunettesting.la \
254  libgnunetdatastore.la \
255  $(top_builddir)/src/util/libgnunetutil.la
256
257 test_datastore_api_management_mysql_SOURCES = \
258  test_datastore_api_management.c
259 test_datastore_api_management_mysql_LDADD = \
260  $(top_builddir)/src/testing/libgnunettesting.la \
261  libgnunetdatastore.la \
262  $(top_builddir)/src/util/libgnunetutil.la
263
264 perf_datastore_api_mysql_SOURCES = \
265  perf_datastore_api.c
266 perf_datastore_api_mysql_LDADD = \
267  $(top_builddir)/src/testing/libgnunettesting.la \
268  libgnunetdatastore.la \
269  $(top_builddir)/src/util/libgnunetutil.la
270
271 test_plugin_datastore_mysql_SOURCES = \
272  test_plugin_datastore.c
273 test_plugin_datastore_mysql_LDADD = \
274  $(top_builddir)/src/testing/libgnunettesting.la \
275  $(top_builddir)/src/util/libgnunetutil.la
276
277 perf_plugin_datastore_mysql_SOURCES = \
278  perf_plugin_datastore.c
279 perf_plugin_datastore_mysql_LDADD = \
280  $(top_builddir)/src/testing/libgnunettesting.la \
281  $(top_builddir)/src/util/libgnunetutil.la
282
283
284 test_datastore_api_postgres_SOURCES = \
285  test_datastore_api.c
286 test_datastore_api_postgres_LDADD = \
287  $(top_builddir)/src/testing/libgnunettesting.la \
288  libgnunetdatastore.la \
289  $(top_builddir)/src/util/libgnunetutil.la
290
291 test_datastore_api_management_postgres_SOURCES = \
292  test_datastore_api_management.c
293 test_datastore_api_management_postgres_LDADD = \
294  $(top_builddir)/src/testing/libgnunettesting.la \
295  libgnunetdatastore.la \
296  $(top_builddir)/src/util/libgnunetutil.la
297
298 perf_datastore_api_postgres_SOURCES = \
299  perf_datastore_api.c
300 perf_datastore_api_postgres_LDADD = \
301  $(top_builddir)/src/testing/libgnunettesting.la \
302  libgnunetdatastore.la \
303  $(top_builddir)/src/util/libgnunetutil.la
304
305 test_plugin_datastore_postgres_SOURCES = \
306  test_plugin_datastore.c
307 test_plugin_datastore_postgres_LDADD = \
308  $(top_builddir)/src/testing/libgnunettesting.la \
309  $(top_builddir)/src/util/libgnunetutil.la
310
311 perf_plugin_datastore_postgres_SOURCES = \
312  perf_plugin_datastore.c
313 perf_plugin_datastore_postgres_LDADD = \
314  $(top_builddir)/src/testing/libgnunettesting.la \
315  $(top_builddir)/src/util/libgnunetutil.la
316
317
318 EXTRA_DIST = \
319  test_defaults.conf \
320  test_datastore_api_data_sqlite.conf \
321  perf_plugin_datastore_data_sqlite.conf \
322  test_plugin_datastore_data_sqlite.conf \
323  test_datastore_api_data_heap.conf \
324  perf_plugin_datastore_data_heap.conf \
325  test_plugin_datastore_data_heap.conf \
326  test_datastore_api_data_mysql.conf \
327  perf_plugin_datastore_data_mysql.conf \
328  test_plugin_datastore_data_mysql.conf \
329  test_datastore_api_data_postgres.conf \
330  perf_plugin_datastore_data_postgres.conf \
331  test_plugin_datastore_data_postgres.conf