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