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