4000e998183fbcc587abd8fdd73be8eb997cfe3f
[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 pkgcfg_DATA = \
8   datastore.conf
9
10 if MINGW
11   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
12 endif
13
14 if USE_COVERAGE
15   AM_CFLAGS = --coverage -O0
16   XLIBS = -lgcov
17 endif
18
19
20 lib_LTLIBRARIES = \
21   libgnunetdatastore.la
22
23 libgnunetdatastore_la_SOURCES = \
24   datastore_api.c datastore.h 
25 libgnunetdatastore_la_LIBADD = \
26   $(top_builddir)/src/statistics/libgnunetstatistics.la \
27   $(top_builddir)/src/util/libgnunetutil.la \
28   $(GN_LIBINTL) 
29 libgnunetdatastore_la_LDFLAGS = \
30   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
31   -version-info 1:0:0
32
33
34 bin_PROGRAMS = \
35  gnunet-service-datastore
36
37 gnunet_service_datastore_SOURCES = \
38  gnunet-service-datastore.c 
39 gnunet_service_datastore_LDADD = \
40   $(top_builddir)/src/statistics/libgnunetstatistics.la \
41   $(top_builddir)/src/util/libgnunetutil.la \
42   $(GN_LIBINTL)
43
44 if HAVE_MYSQL
45  MYSQL_PLUGIN = libgnunet_plugin_datastore_mysql.la
46 if HAVE_BENCHMARKS
47   MYSQL_BENCHMARKS = \
48    perf_datastore_api_mysql \
49    perf_plugin_datastore_mysql
50 endif
51  MYSQL_TESTS = \
52   test_datastore_api_mysql \
53   test_datastore_api_management_mysql \
54   test_plugin_datastore_mysql \
55   $(MYSQL_BENCHMARKS)
56 endif
57 if HAVE_SQLITE
58  SQLITE_PLUGIN = libgnunet_plugin_datastore_sqlite.la
59 if HAVE_BENCHMARKS
60   SQLITE_BENCHMARKS = \
61    perf_datastore_api_sqlite \
62    perf_plugin_datastore_sqlite
63 endif
64  SQLITE_TESTS = \
65   test_datastore_api_sqlite \
66   test_datastore_api_management_sqlite \
67   test_plugin_datastore_sqlite \
68   $(SQLITE_BENCHMARKS)
69 endif
70 if HAVE_POSTGRES
71  POSTGRES_PLUGIN = libgnunet_plugin_datastore_postgres.la
72 if HAVE_BENCHMARKS
73   POSTGRES_BENCHMARKS = \
74    perf_datastore_api_postgres \
75    perf_plugin_datastore_postgres
76 endif
77  POSTGRES_TESTS = \
78   test_datastore_api_postgres \
79   test_datastore_api_management_postgres \
80   test_plugin_datastore_postgres \
81   $(POSTGRES_BENCHMARKS)
82 endif
83
84 plugin_LTLIBRARIES = \
85   $(SQLITE_PLUGIN) \
86   $(MYSQL_PLUGIN) \
87   $(POSTGRES_PLUGIN) \
88   libgnunet_plugin_datastore_template.la 
89
90
91 libgnunet_plugin_datastore_sqlite_la_SOURCES = \
92   plugin_datastore_sqlite.c
93 libgnunet_plugin_datastore_sqlite_la_LIBADD = \
94   $(top_builddir)/src/statistics/libgnunetstatistics.la \
95   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
96   $(LTLIBINTL)
97 libgnunet_plugin_datastore_sqlite_la_LDFLAGS = \
98  $(GN_PLUGIN_LDFLAGS)
99
100
101 libgnunet_plugin_datastore_mysql_la_SOURCES = \
102   plugin_datastore_mysql.c
103 libgnunet_plugin_datastore_mysql_la_LIBADD = \
104   $(top_builddir)/src/mysql/libgnunetmysql.la \
105   $(top_builddir)/src/statistics/libgnunetstatistics.la \
106   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lz -lmysqlclient
107 libgnunet_plugin_datastore_mysql_la_LDFLAGS = \
108  $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
109 libgnunet_plugin_datastore_mysql_la_CPPFLAGS = \
110  $(MYSQL_CPPFLAGS)
111
112 libgnunet_plugin_datastore_postgres_la_SOURCES = \
113   plugin_datastore_postgres.c
114 libgnunet_plugin_datastore_postgres_la_LIBADD = \
115   $(top_builddir)/src/statistics/libgnunetstatistics.la \
116   $(top_builddir)/src/postgres/libgnunetpostgres.la \
117   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq
118 libgnunet_plugin_datastore_postgres_la_LDFLAGS = \
119  $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq
120 libgnunet_plugin_datastore_postgres_la_CPPFLAGS = \
121  $(POSTGRES_CPPFLAGS)
122
123
124 libgnunet_plugin_datastore_template_la_SOURCES = \
125   plugin_datastore_template.c
126 libgnunet_plugin_datastore_template_la_LIBADD = \
127   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
128   $(LTLIBINTL)
129 libgnunet_plugin_datastore_template_la_LDFLAGS = \
130  $(GN_PLUGIN_LDFLAGS)
131
132 check_PROGRAMS = \
133   $(SQLITE_TESTS) \
134   $(MYSQL_TESTS) \
135   $(POSTGRES_TESTS)
136
137 if ENABLE_TEST_RUN
138 TESTS = $(check_PROGRAMS)
139 endif
140
141 test_datastore_api_sqlite_SOURCES = \
142  test_datastore_api.c
143 test_datastore_api_sqlite_LDADD = \
144  $(top_builddir)/src/testing/libgnunettesting.la \
145  $(top_builddir)/src/datastore/libgnunetdatastore.la \
146  $(top_builddir)/src/util/libgnunetutil.la  
147
148 test_datastore_api_management_sqlite_SOURCES = \
149  test_datastore_api_management.c
150 test_datastore_api_management_sqlite_LDADD = \
151  $(top_builddir)/src/testing/libgnunettesting.la \
152  $(top_builddir)/src/datastore/libgnunetdatastore.la \
153  $(top_builddir)/src/util/libgnunetutil.la  
154
155 perf_datastore_api_sqlite_SOURCES = \
156  perf_datastore_api.c
157 perf_datastore_api_sqlite_LDADD = \
158  $(top_builddir)/src/testing/libgnunettesting.la \
159  $(top_builddir)/src/datastore/libgnunetdatastore.la \
160  $(top_builddir)/src/util/libgnunetutil.la  
161
162 perf_plugin_datastore_sqlite_SOURCES = \
163  perf_plugin_datastore.c
164 perf_plugin_datastore_sqlite_LDADD = \
165  $(top_builddir)/src/testing/libgnunettesting.la \
166  $(top_builddir)/src/util/libgnunetutil.la  
167
168 test_plugin_datastore_sqlite_SOURCES = \
169  test_plugin_datastore.c
170 test_plugin_datastore_sqlite_LDADD = \
171  $(top_builddir)/src/testing/libgnunettesting.la \
172  $(top_builddir)/src/util/libgnunetutil.la  
173
174
175 test_datastore_api_mysql_SOURCES = \
176  test_datastore_api.c
177 test_datastore_api_mysql_LDADD = \
178  $(top_builddir)/src/testing/libgnunettesting.la \
179  $(top_builddir)/src/datastore/libgnunetdatastore.la \
180  $(top_builddir)/src/util/libgnunetutil.la  
181
182 test_datastore_api_management_mysql_SOURCES = \
183  test_datastore_api_management.c
184 test_datastore_api_management_mysql_LDADD = \
185  $(top_builddir)/src/testing/libgnunettesting.la \
186  $(top_builddir)/src/datastore/libgnunetdatastore.la \
187  $(top_builddir)/src/util/libgnunetutil.la  
188
189 perf_datastore_api_mysql_SOURCES = \
190  perf_datastore_api.c
191 perf_datastore_api_mysql_LDADD = \
192  $(top_builddir)/src/testing/libgnunettesting.la \
193  $(top_builddir)/src/datastore/libgnunetdatastore.la \
194  $(top_builddir)/src/util/libgnunetutil.la  
195
196 test_plugin_datastore_mysql_SOURCES = \
197  test_plugin_datastore.c
198 test_plugin_datastore_mysql_LDADD = \
199  $(top_builddir)/src/testing/libgnunettesting.la \
200  $(top_builddir)/src/util/libgnunetutil.la  
201
202 perf_plugin_datastore_mysql_SOURCES = \
203  perf_plugin_datastore.c
204 perf_plugin_datastore_mysql_LDADD = \
205  $(top_builddir)/src/testing/libgnunettesting.la \
206  $(top_builddir)/src/util/libgnunetutil.la  
207
208
209 test_datastore_api_postgres_SOURCES = \
210  test_datastore_api.c
211 test_datastore_api_postgres_LDADD = \
212  $(top_builddir)/src/testing/libgnunettesting.la \
213  $(top_builddir)/src/datastore/libgnunetdatastore.la \
214  $(top_builddir)/src/util/libgnunetutil.la  
215
216 test_datastore_api_management_postgres_SOURCES = \
217  test_datastore_api_management.c
218 test_datastore_api_management_postgres_LDADD = \
219  $(top_builddir)/src/testing/libgnunettesting.la \
220  $(top_builddir)/src/datastore/libgnunetdatastore.la \
221  $(top_builddir)/src/util/libgnunetutil.la  
222
223 perf_datastore_api_postgres_SOURCES = \
224  perf_datastore_api.c
225 perf_datastore_api_postgres_LDADD = \
226  $(top_builddir)/src/testing/libgnunettesting.la \
227  $(top_builddir)/src/datastore/libgnunetdatastore.la \
228  $(top_builddir)/src/util/libgnunetutil.la  
229
230 test_plugin_datastore_postgres_SOURCES = \
231  test_plugin_datastore.c
232 test_plugin_datastore_postgres_LDADD = \
233  $(top_builddir)/src/testing/libgnunettesting.la \
234  $(top_builddir)/src/util/libgnunetutil.la  
235
236 perf_plugin_datastore_postgres_SOURCES = \
237  perf_plugin_datastore.c
238 perf_plugin_datastore_postgres_LDADD = \
239  $(top_builddir)/src/testing/libgnunettesting.la \
240  $(top_builddir)/src/util/libgnunetutil.la  
241
242
243 EXTRA_DIST = \
244  test_defaults.conf \
245  test_datastore_api_data_sqlite.conf \
246  perf_plugin_datastore_data_sqlite.conf \
247  test_datastore_api_data_mysql.conf \
248  perf_plugin_datastore_data_mysql.conf \
249  test_datastore_api_data_postgres.conf \
250  perf_plugin_datastore_data_postgres.conf \
251  test_plugin_datastore_data_mysql.conf \
252  test_plugin_datastore_data_postgres.conf \
253  test_plugin_datastore_data_sqlite.conf