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