fixes
[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 if HAVE_EXPERIMENTAL
41  MYSQL_PLUGIN = libgnunet_plugin_datastore_mysql.la
42  MYSQL_TESTS = \
43   test_datastore_api_mysql \
44   test_datastore_api_management_mysql \
45   test_plugin_datastore_mysql \
46   perf_datastore_api_mysql \
47   perf_plugin_datastore_mysql
48 endif
49 endif
50 if HAVE_SQLITE
51  SQLITE_PLUGIN = libgnunet_plugin_datastore_sqlite.la
52  SQLITE_TESTS = \
53   test_datastore_api_sqlite \
54   test_datastore_api_management_sqlite \
55   test_plugin_datastore_sqlite \
56   perf_datastore_api_sqlite \
57   perf_plugin_datastore_sqlite
58 endif
59 if HAVE_POSTGRES
60 if HAVE_EXPERIMENTAL
61  POSTGRES_PLUGIN = libgnunet_plugin_datastore_postgres.la
62  POSTGRES_TESTS = \
63   test_datastore_api_postgres \
64   test_datastore_api_management_postgres \
65   test_plugin_datastore_postgres \
66   perf_datastore_api_postgres \
67   perf_plugin_datastore_postgres
68 endif
69 endif
70
71 plugin_LTLIBRARIES = \
72   $(SQLITE_PLUGIN) \
73   $(MYSQL_PLUGIN) \
74   $(POSTGRES_PLUGIN) \
75   libgnunet_plugin_datastore_template.la 
76
77
78 libgnunet_plugin_datastore_sqlite_la_SOURCES = \
79   plugin_datastore_sqlite.c
80 libgnunet_plugin_datastore_sqlite_la_LIBADD = \
81   $(top_builddir)/src/statistics/libgnunetstatistics.la \
82   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3
83 libgnunet_plugin_datastore_sqlite_la_LDFLAGS = \
84  $(GN_PLUGIN_LDFLAGS)
85
86
87 libgnunet_plugin_datastore_mysql_la_SOURCES = \
88   plugin_datastore_mysql.c
89 libgnunet_plugin_datastore_mysql_la_LIBADD = \
90   $(top_builddir)/src/statistics/libgnunetstatistics.la \
91   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lz -lmysqlclient
92 libgnunet_plugin_datastore_mysql_la_LDFLAGS = \
93  $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
94 libgnunet_plugin_datastore_mysql_la_CPPFLAGS = \
95  $(MYSQL_CPPFLAGS)
96
97 libgnunet_plugin_datastore_postgres_la_SOURCES = \
98   plugin_datastore_postgres.c
99 libgnunet_plugin_datastore_postgres_la_LIBADD = \
100   $(top_builddir)/src/statistics/libgnunetstatistics.la \
101   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq
102 libgnunet_plugin_datastore_postgres_la_LDFLAGS = \
103  $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq
104 libgnunet_plugin_datastore_postgres_la_CPPFLAGS = \
105  $(POSTGRES_CPPFLAGS)
106
107
108 libgnunet_plugin_datastore_template_la_SOURCES = \
109   plugin_datastore_template.c
110 libgnunet_plugin_datastore_template_la_LIBADD = \
111   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS)
112 libgnunet_plugin_datastore_template_la_LDFLAGS = \
113  $(GN_PLUGIN_LDFLAGS)
114
115 check_PROGRAMS = \
116   $(SQLITE_TESTS) \
117   $(MYSQL_TESTS) \
118   $(POSTGRES_TESTS)
119
120 if !DISABLE_TEST_RUN
121 TESTS = $(check_PROGRAMS)
122 endif
123
124 test_datastore_api_sqlite_SOURCES = \
125  test_datastore_api.c
126 test_datastore_api_sqlite_LDADD = \
127  $(top_builddir)/src/datastore/libgnunetdatastore.la \
128  $(top_builddir)/src/util/libgnunetutil.la  
129
130 test_datastore_api_management_sqlite_SOURCES = \
131  test_datastore_api_management.c
132 test_datastore_api_management_sqlite_LDADD = \
133  $(top_builddir)/src/datastore/libgnunetdatastore.la \
134  $(top_builddir)/src/util/libgnunetutil.la  
135
136 perf_datastore_api_sqlite_SOURCES = \
137  perf_datastore_api.c
138 perf_datastore_api_sqlite_LDADD = \
139  $(top_builddir)/src/datastore/libgnunetdatastore.la \
140  $(top_builddir)/src/util/libgnunetutil.la  
141
142 perf_plugin_datastore_sqlite_SOURCES = \
143  perf_plugin_datastore.c
144 perf_plugin_datastore_sqlite_LDADD = \
145  $(top_builddir)/src/util/libgnunetutil.la  
146
147 test_plugin_datastore_sqlite_SOURCES = \
148  test_plugin_datastore.c
149 test_plugin_datastore_sqlite_LDADD = \
150  $(top_builddir)/src/util/libgnunetutil.la  
151
152
153 test_datastore_api_mysql_SOURCES = \
154  test_datastore_api.c
155 test_datastore_api_mysql_LDADD = \
156  $(top_builddir)/src/datastore/libgnunetdatastore.la \
157  $(top_builddir)/src/util/libgnunetutil.la  
158
159 test_datastore_api_management_mysql_SOURCES = \
160  test_datastore_api_management.c
161 test_datastore_api_management_mysql_LDADD = \
162  $(top_builddir)/src/datastore/libgnunetdatastore.la \
163  $(top_builddir)/src/util/libgnunetutil.la  
164
165 perf_datastore_api_mysql_SOURCES = \
166  perf_datastore_api.c
167 perf_datastore_api_mysql_LDADD = \
168  $(top_builddir)/src/datastore/libgnunetdatastore.la \
169  $(top_builddir)/src/util/libgnunetutil.la  
170
171 test_plugin_datastore_mysql_SOURCES = \
172  test_plugin_datastore.c
173 test_plugin_datastore_mysql_LDADD = \
174  $(top_builddir)/src/util/libgnunetutil.la  
175
176 perf_plugin_datastore_mysql_SOURCES = \
177  perf_plugin_datastore.c
178 perf_plugin_datastore_mysql_LDADD = \
179  $(top_builddir)/src/util/libgnunetutil.la  
180
181
182 test_datastore_api_postgres_SOURCES = \
183  test_datastore_api.c
184 test_datastore_api_postgres_LDADD = \
185  $(top_builddir)/src/datastore/libgnunetdatastore.la \
186  $(top_builddir)/src/util/libgnunetutil.la  
187
188 test_datastore_api_management_postgres_SOURCES = \
189  test_datastore_api_management.c
190 test_datastore_api_management_postgres_LDADD = \
191  $(top_builddir)/src/datastore/libgnunetdatastore.la \
192  $(top_builddir)/src/util/libgnunetutil.la  
193
194 perf_datastore_api_postgres_SOURCES = \
195  perf_datastore_api.c
196 perf_datastore_api_postgres_LDADD = \
197  $(top_builddir)/src/datastore/libgnunetdatastore.la \
198  $(top_builddir)/src/util/libgnunetutil.la  
199
200 test_plugin_datastore_postgres_SOURCES = \
201  test_plugin_datastore.c
202 test_plugin_datastore_postgres_LDADD = \
203  $(top_builddir)/src/util/libgnunetutil.la  
204
205 perf_plugin_datastore_postgres_SOURCES = \
206  perf_plugin_datastore.c
207 perf_plugin_datastore_postgres_LDADD = \
208  $(top_builddir)/src/util/libgnunetutil.la  
209
210
211 EXTRA_DIST = \
212  test_datastore_api_data_sqlite.conf \
213  perf_plugin_datastore_data_sqlite.conf \
214  test_datastore_api_data_mysql.conf \
215  perf_plugin_datastore_data_mysql.conf \
216  test_datastore_api_data_postgres.conf \
217  perf_plugin_datastore_data_postgres.conf