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