installing all service, daemon and helper binaries to lib/gnunet/libexec/; updating...
[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_template.la 
91
92
93 libgnunet_plugin_datastore_sqlite_la_SOURCES = \
94   plugin_datastore_sqlite.c
95 libgnunet_plugin_datastore_sqlite_la_LIBADD = \
96   $(top_builddir)/src/statistics/libgnunetstatistics.la \
97   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
98   $(LTLIBINTL)
99 libgnunet_plugin_datastore_sqlite_la_LDFLAGS = \
100  $(GN_PLUGIN_LDFLAGS)
101
102
103 libgnunet_plugin_datastore_mysql_la_SOURCES = \
104   plugin_datastore_mysql.c
105 libgnunet_plugin_datastore_mysql_la_LIBADD = \
106   $(top_builddir)/src/mysql/libgnunetmysql.la \
107   $(top_builddir)/src/statistics/libgnunetstatistics.la \
108   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lz -lmysqlclient
109 libgnunet_plugin_datastore_mysql_la_LDFLAGS = \
110  $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
111 libgnunet_plugin_datastore_mysql_la_CPPFLAGS = \
112  $(MYSQL_CPPFLAGS)
113
114 libgnunet_plugin_datastore_postgres_la_SOURCES = \
115   plugin_datastore_postgres.c
116 libgnunet_plugin_datastore_postgres_la_LIBADD = \
117   $(top_builddir)/src/statistics/libgnunetstatistics.la \
118   $(top_builddir)/src/postgres/libgnunetpostgres.la \
119   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq
120 libgnunet_plugin_datastore_postgres_la_LDFLAGS = \
121  $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq
122 libgnunet_plugin_datastore_postgres_la_CPPFLAGS = \
123  $(POSTGRES_CPPFLAGS)
124
125
126 libgnunet_plugin_datastore_template_la_SOURCES = \
127   plugin_datastore_template.c
128 libgnunet_plugin_datastore_template_la_LIBADD = \
129   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
130   $(LTLIBINTL)
131 libgnunet_plugin_datastore_template_la_LDFLAGS = \
132  $(GN_PLUGIN_LDFLAGS)
133
134 check_PROGRAMS = \
135   $(SQLITE_TESTS) \
136   $(MYSQL_TESTS) \
137   $(POSTGRES_TESTS)
138
139 if ENABLE_TEST_RUN
140 TESTS = $(check_PROGRAMS)
141 endif
142
143 test_datastore_api_sqlite_SOURCES = \
144  test_datastore_api.c
145 test_datastore_api_sqlite_LDADD = \
146  $(top_builddir)/src/testing/libgnunettesting.la \
147  $(top_builddir)/src/datastore/libgnunetdatastore.la \
148  $(top_builddir)/src/util/libgnunetutil.la  
149
150 test_datastore_api_management_sqlite_SOURCES = \
151  test_datastore_api_management.c
152 test_datastore_api_management_sqlite_LDADD = \
153  $(top_builddir)/src/testing/libgnunettesting.la \
154  $(top_builddir)/src/datastore/libgnunetdatastore.la \
155  $(top_builddir)/src/util/libgnunetutil.la  
156
157 perf_datastore_api_sqlite_SOURCES = \
158  perf_datastore_api.c
159 perf_datastore_api_sqlite_LDADD = \
160  $(top_builddir)/src/testing/libgnunettesting.la \
161  $(top_builddir)/src/datastore/libgnunetdatastore.la \
162  $(top_builddir)/src/util/libgnunetutil.la  
163
164 perf_plugin_datastore_sqlite_SOURCES = \
165  perf_plugin_datastore.c
166 perf_plugin_datastore_sqlite_LDADD = \
167  $(top_builddir)/src/testing/libgnunettesting.la \
168  $(top_builddir)/src/util/libgnunetutil.la  
169
170 test_plugin_datastore_sqlite_SOURCES = \
171  test_plugin_datastore.c
172 test_plugin_datastore_sqlite_LDADD = \
173  $(top_builddir)/src/testing/libgnunettesting.la \
174  $(top_builddir)/src/util/libgnunetutil.la  
175
176
177 test_datastore_api_mysql_SOURCES = \
178  test_datastore_api.c
179 test_datastore_api_mysql_LDADD = \
180  $(top_builddir)/src/testing/libgnunettesting.la \
181  $(top_builddir)/src/datastore/libgnunetdatastore.la \
182  $(top_builddir)/src/util/libgnunetutil.la  
183
184 test_datastore_api_management_mysql_SOURCES = \
185  test_datastore_api_management.c
186 test_datastore_api_management_mysql_LDADD = \
187  $(top_builddir)/src/testing/libgnunettesting.la \
188  $(top_builddir)/src/datastore/libgnunetdatastore.la \
189  $(top_builddir)/src/util/libgnunetutil.la  
190
191 perf_datastore_api_mysql_SOURCES = \
192  perf_datastore_api.c
193 perf_datastore_api_mysql_LDADD = \
194  $(top_builddir)/src/testing/libgnunettesting.la \
195  $(top_builddir)/src/datastore/libgnunetdatastore.la \
196  $(top_builddir)/src/util/libgnunetutil.la  
197
198 test_plugin_datastore_mysql_SOURCES = \
199  test_plugin_datastore.c
200 test_plugin_datastore_mysql_LDADD = \
201  $(top_builddir)/src/testing/libgnunettesting.la \
202  $(top_builddir)/src/util/libgnunetutil.la  
203
204 perf_plugin_datastore_mysql_SOURCES = \
205  perf_plugin_datastore.c
206 perf_plugin_datastore_mysql_LDADD = \
207  $(top_builddir)/src/testing/libgnunettesting.la \
208  $(top_builddir)/src/util/libgnunetutil.la  
209
210
211 test_datastore_api_postgres_SOURCES = \
212  test_datastore_api.c
213 test_datastore_api_postgres_LDADD = \
214  $(top_builddir)/src/testing/libgnunettesting.la \
215  $(top_builddir)/src/datastore/libgnunetdatastore.la \
216  $(top_builddir)/src/util/libgnunetutil.la  
217
218 test_datastore_api_management_postgres_SOURCES = \
219  test_datastore_api_management.c
220 test_datastore_api_management_postgres_LDADD = \
221  $(top_builddir)/src/testing/libgnunettesting.la \
222  $(top_builddir)/src/datastore/libgnunetdatastore.la \
223  $(top_builddir)/src/util/libgnunetutil.la  
224
225 perf_datastore_api_postgres_SOURCES = \
226  perf_datastore_api.c
227 perf_datastore_api_postgres_LDADD = \
228  $(top_builddir)/src/testing/libgnunettesting.la \
229  $(top_builddir)/src/datastore/libgnunetdatastore.la \
230  $(top_builddir)/src/util/libgnunetutil.la  
231
232 test_plugin_datastore_postgres_SOURCES = \
233  test_plugin_datastore.c
234 test_plugin_datastore_postgres_LDADD = \
235  $(top_builddir)/src/testing/libgnunettesting.la \
236  $(top_builddir)/src/util/libgnunetutil.la  
237
238 perf_plugin_datastore_postgres_SOURCES = \
239  perf_plugin_datastore.c
240 perf_plugin_datastore_postgres_LDADD = \
241  $(top_builddir)/src/testing/libgnunettesting.la \
242  $(top_builddir)/src/util/libgnunetutil.la  
243
244
245 EXTRA_DIST = \
246  test_defaults.conf \
247  test_datastore_api_data_sqlite.conf \
248  perf_plugin_datastore_data_sqlite.conf \
249  test_datastore_api_data_mysql.conf \
250  perf_plugin_datastore_data_mysql.conf \
251  test_datastore_api_data_postgres.conf \
252  perf_plugin_datastore_data_postgres.conf \
253  test_plugin_datastore_data_mysql.conf \
254  test_plugin_datastore_data_postgres.conf \
255  test_plugin_datastore_data_sqlite.conf