-using new testing api to determine plugin name
[oweals/gnunet.git] / src / datacache / Makefile.am
1 INCLUDES = -I$(top_srcdir)/src/include
2
3 plugindir = $(libdir)/gnunet
4
5 pkgcfgdir= $(pkgdatadir)/config.d/
6
7 dist_pkgcfg_DATA = \
8   datacache.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 if HAVE_SQLITE
20   SQLITE_PLUGIN = libgnunet_plugin_datacache_sqlite.la
21 endif
22 if HAVE_MYSQL
23   MYSQL_PLUGIN = libgnunet_plugin_datacache_mysql.la
24 endif
25 if HAVE_POSTGRES
26   POSTGRES_PLUGIN = libgnunet_plugin_datacache_postgres.la
27 endif
28
29 lib_LTLIBRARIES = \
30   libgnunetdatacache.la
31
32 libgnunetdatacache_la_SOURCES = \
33   datacache.c 
34 libgnunetdatacache_la_LIBADD = \
35   $(top_builddir)/src/statistics/libgnunetstatistics.la \
36   $(top_builddir)/src/util/libgnunetutil.la \
37   $(GN_LIBINTL) 
38 libgnunetdatacache_la_LDFLAGS = \
39   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
40   -version-info 0:1:0
41
42
43 plugin_LTLIBRARIES = \
44   $(SQLITE_PLUGIN) \
45   $(MYSQL_PLUGIN) \
46   $(POSTGRES_PLUGIN) \
47   libgnunet_plugin_datacache_template.la 
48
49
50 libgnunet_plugin_datacache_sqlite_la_SOURCES = \
51   plugin_datacache_sqlite.c
52 libgnunet_plugin_datacache_sqlite_la_LIBADD = \
53   $(top_builddir)/src/statistics/libgnunetstatistics.la \
54   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
55   $(LTLIBINTL)
56 libgnunet_plugin_datacache_sqlite_la_LDFLAGS = \
57  $(GN_PLUGIN_LDFLAGS)
58
59 libgnunet_plugin_datacache_mysql_la_SOURCES = \
60   plugin_datacache_mysql.c
61 libgnunet_plugin_datacache_mysql_la_LIBADD = \
62   $(top_builddir)/src/statistics/libgnunetstatistics.la \
63   $(top_builddir)/src/mysql/libgnunetmysql.la \
64   $(top_builddir)/src/util/libgnunetutil.la \
65   $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
66 libgnunet_plugin_datacache_mysql_la_CPPFLAGS = \
67  $(MYSQL_CPPFLAGS)
68 libgnunet_plugin_datacache_mysql_la_LDFLAGS = \
69  $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
70
71 libgnunet_plugin_datacache_postgres_la_SOURCES = \
72   plugin_datacache_postgres.c
73 libgnunet_plugin_datacache_postgres_la_LIBADD = \
74   $(top_builddir)/src/postgres/libgnunetpostgres.la \
75   $(top_builddir)/src/statistics/libgnunetstatistics.la \
76   $(top_builddir)/src/util/libgnunetutil.la \
77   $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq
78 libgnunet_plugin_datacache_postgres_la_CPPFLAGS = \
79  $(POSTGRES_CPPFLAGS)
80 libgnunet_plugin_datacache_postgres_la_LDFLAGS = \
81  $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq
82
83 libgnunet_plugin_datacache_template_la_SOURCES = \
84   plugin_datacache_template.c
85 libgnunet_plugin_datacache_template_la_LIBADD = \
86   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
87   $(LTLIBINTL)
88 libgnunet_plugin_datacache_template_la_LDFLAGS = \
89  $(GN_PLUGIN_LDFLAGS)
90
91
92 if HAVE_SQLITE
93 if HAVE_BENCHMARKS
94  SQLITE_BENCHMARKS = \
95   perf_datacache_sqlite
96 endif
97 SQLITE_TESTS = \
98  test_datacache_sqlite \
99  test_datacache_quota_sqlite \
100  $(SQLITE_BENCHMARKS)
101 endif
102
103 if HAVE_MYSQL
104 if HAVE_BENCHMARKS
105  MYSQL_BENCHMARKS = \
106   perf_datacache_mysql
107 endif
108 MYSQL_TESTS = \
109  test_datacache_mysql \
110  test_datacache_quota_mysql \
111  $(MYSQL_BENCHMARKS)
112 endif
113
114 if HAVE_POSTGRES
115 if HAVE_BENCHMARKS
116  POSTGRES_BENCHMARKS = \
117   perf_datacache_postgres
118 endif
119 POSTGRES_TESTS = \
120  test_datacache_postgres \
121  test_datacache_quota_postgres \
122  $(POSTGRES_BENCHMARKS)
123 endif
124
125 check_PROGRAMS = \
126  $(SQLITE_TESTS) \
127  $(MYSQL_TESTS) \
128  $(POSTGRES_TESTS) 
129
130 if ENABLE_TEST_RUN
131 TESTS = $(check_PROGRAMS)
132 endif
133
134 test_datacache_sqlite_SOURCES = \
135  test_datacache.c
136 test_datacache_sqlite_LDADD = \
137  $(top_builddir)/src/testing/libgnunettesting.la \
138  $(top_builddir)/src/datacache/libgnunetdatacache.la \
139  $(top_builddir)/src/util/libgnunetutil.la  
140
141 test_datacache_quota_sqlite_SOURCES = \
142  test_datacache_quota.c
143 test_datacache_quota_sqlite_LDADD = \
144  $(top_builddir)/src/testing/libgnunettesting.la \
145  $(top_builddir)/src/datacache/libgnunetdatacache.la \
146  $(top_builddir)/src/util/libgnunetutil.la  
147
148 perf_datacache_sqlite_SOURCES = \
149  perf_datacache.c
150 perf_datacache_sqlite_LDADD = \
151  $(top_builddir)/src/testing/libgnunettesting.la \
152  $(top_builddir)/src/datacache/libgnunetdatacache.la \
153  $(top_builddir)/src/util/libgnunetutil.la  
154
155 test_datacache_mysql_SOURCES = \
156  test_datacache.c
157 test_datacache_mysql_LDADD = \
158  $(top_builddir)/src/testing/libgnunettesting.la \
159  $(top_builddir)/src/datacache/libgnunetdatacache.la \
160  $(top_builddir)/src/util/libgnunetutil.la  
161
162 test_datacache_quota_mysql_SOURCES = \
163  test_datacache_quota.c
164 test_datacache_quota_mysql_LDADD = \
165  $(top_builddir)/src/testing/libgnunettesting.la \
166  $(top_builddir)/src/datacache/libgnunetdatacache.la \
167  $(top_builddir)/src/util/libgnunetutil.la  
168
169 perf_datacache_mysql_SOURCES = \
170  perf_datacache.c
171 perf_datacache_mysql_LDADD = \
172  $(top_builddir)/src/testing/libgnunettesting.la \
173  $(top_builddir)/src/datacache/libgnunetdatacache.la \
174  $(top_builddir)/src/util/libgnunetutil.la  
175
176 test_datacache_postgres_SOURCES = \
177  test_datacache.c
178 test_datacache_postgres_LDADD = \
179  $(top_builddir)/src/testing/libgnunettesting.la \
180  $(top_builddir)/src/datacache/libgnunetdatacache.la \
181  $(top_builddir)/src/util/libgnunetutil.la  
182
183 test_datacache_quota_postgres_SOURCES = \
184  test_datacache_quota.c
185 test_datacache_quota_postgres_LDADD = \
186  $(top_builddir)/src/testing/libgnunettesting.la \
187  $(top_builddir)/src/datacache/libgnunetdatacache.la \
188  $(top_builddir)/src/util/libgnunetutil.la  
189
190 perf_datacache_postgres_SOURCES = \
191  perf_datacache.c
192 perf_datacache_postgres_LDADD = \
193  $(top_builddir)/src/testing/libgnunettesting.la \
194  $(top_builddir)/src/datacache/libgnunetdatacache.la \
195  $(top_builddir)/src/util/libgnunetutil.la  
196
197 EXTRA_DIST = \
198  test_datacache_data_sqlite.conf \
199  perf_datacache_data_sqlite.conf \
200  test_datacache_data_mysql.conf \
201  perf_datacache_data_mysql.conf \
202  test_datacache_data_postgres.conf \
203  perf_datacache_data_postgres.conf