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