more work on pq-ification of datacache
[oweals/gnunet.git] / src / datacache / Makefile.am
1 # This Makefile.am is in the public domain
2 AM_CPPFLAGS = -I$(top_srcdir)/src/include
3
4 plugindir = $(libdir)/gnunet
5
6 pkgcfgdir= $(pkgdatadir)/config.d/
7
8 dist_pkgcfg_DATA = \
9   datacache.conf
10
11 if MINGW
12   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
13 endif
14
15 if USE_COVERAGE
16   AM_CFLAGS = --coverage -O0
17   XLIBS = -lgcov
18 endif
19
20 if HAVE_SQLITE
21   SQLITE_PLUGIN = libgnunet_plugin_datacache_sqlite.la
22 endif
23 if HAVE_POSTGRESQL
24   POSTGRES_PLUGIN = libgnunet_plugin_datacache_postgres.la
25 endif
26
27 lib_LTLIBRARIES = \
28   libgnunetdatacache.la
29
30 libgnunetdatacache_la_SOURCES = \
31   datacache.c
32 libgnunetdatacache_la_LIBADD = \
33   $(top_builddir)/src/statistics/libgnunetstatistics.la \
34   $(top_builddir)/src/util/libgnunetutil.la \
35   $(GN_LIBINTL)
36 libgnunetdatacache_la_LDFLAGS = \
37   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
38   -version-info 0:1:0
39
40
41 plugin_LTLIBRARIES = \
42   $(SQLITE_PLUGIN) \
43   $(POSTGRES_PLUGIN) \
44   libgnunet_plugin_datacache_heap.la
45
46 # Real plugins should of course go into
47 # plugin_LTLIBRARIES
48 noinst_LTLIBRARIES = \
49   libgnunet_plugin_datacache_template.la
50
51
52 libgnunet_plugin_datacache_sqlite_la_SOURCES = \
53   plugin_datacache_sqlite.c
54 libgnunet_plugin_datacache_sqlite_la_LIBADD = \
55   $(top_builddir)/src/statistics/libgnunetstatistics.la \
56   $(top_builddir)/src/sq/libgnunetsq.la \
57   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
58   $(LTLIBINTL)
59 libgnunet_plugin_datacache_sqlite_la_LDFLAGS = \
60  $(GN_PLUGIN_LDFLAGS)
61
62 libgnunet_plugin_datacache_heap_la_SOURCES = \
63   plugin_datacache_heap.c
64 libgnunet_plugin_datacache_heap_la_LIBADD = \
65   $(top_builddir)/src/statistics/libgnunetstatistics.la \
66   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
67   $(LTLIBINTL)
68 libgnunet_plugin_datacache_heap_la_LDFLAGS = \
69  $(GN_PLUGIN_LDFLAGS)
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/pq/libgnunetpq.la \
76   $(top_builddir)/src/statistics/libgnunetstatistics.la \
77   $(top_builddir)/src/util/libgnunetutil.la \
78   $(GN_PLUGIN_LDFLAGS) -lpq
79 libgnunet_plugin_datacache_postgres_la_CPPFLAGS = \
80  $(POSTGRESQL_CPPFLAGS) $(AM_CPPFLAGS)
81 libgnunet_plugin_datacache_postgres_la_LDFLAGS = \
82  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
83
84 libgnunet_plugin_datacache_template_la_SOURCES = \
85   plugin_datacache_template.c
86 libgnunet_plugin_datacache_template_la_LIBADD = \
87   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
88   $(LTLIBINTL)
89 libgnunet_plugin_datacache_template_la_LDFLAGS = \
90  $(GN_PLUGIN_LDFLAGS)
91
92
93 if HAVE_TESTING
94 if HAVE_SQLITE
95 if HAVE_BENCHMARKS
96  SQLITE_BENCHMARKS = \
97   perf_datacache_sqlite
98 endif
99 SQLITE_TESTS = \
100  test_datacache_sqlite \
101  test_datacache_quota_sqlite \
102  $(SQLITE_BENCHMARKS)
103 endif
104
105 if HAVE_BENCHMARKS
106  HEAP_BENCHMARKS = \
107   perf_datacache_heap
108 endif
109 HEAP_TESTS = \
110  test_datacache_heap \
111  test_datacache_quota_heap \
112  $(HEAP_BENCHMARKS)
113
114 if HAVE_POSTGRESQL
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 endif
125
126 check_PROGRAMS = \
127  $(SQLITE_TESTS) \
128  $(HEAP_TESTS) \
129  $(POSTGRES_TESTS)
130
131 if ENABLE_TEST_RUN
132 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
133 TESTS = $(check_PROGRAMS)
134 endif
135
136 test_datacache_sqlite_SOURCES = \
137  test_datacache.c
138 test_datacache_sqlite_LDADD = \
139  $(top_builddir)/src/testing/libgnunettesting.la \
140  libgnunetdatacache.la \
141  $(top_builddir)/src/util/libgnunetutil.la
142
143 test_datacache_quota_sqlite_SOURCES = \
144  test_datacache_quota.c
145 test_datacache_quota_sqlite_LDADD = \
146  $(top_builddir)/src/testing/libgnunettesting.la \
147  libgnunetdatacache.la \
148  $(top_builddir)/src/util/libgnunetutil.la
149
150 perf_datacache_sqlite_SOURCES = \
151  perf_datacache.c
152 perf_datacache_sqlite_LDADD = \
153  $(top_builddir)/src/testing/libgnunettesting.la \
154  libgnunetdatacache.la \
155  $(top_builddir)/src/util/libgnunetutil.la
156
157 test_datacache_heap_SOURCES = \
158  test_datacache.c
159 test_datacache_heap_LDADD = \
160  $(top_builddir)/src/testing/libgnunettesting.la \
161  libgnunetdatacache.la \
162  $(top_builddir)/src/util/libgnunetutil.la
163
164 test_datacache_quota_heap_SOURCES = \
165  test_datacache_quota.c
166 test_datacache_quota_heap_LDADD = \
167  $(top_builddir)/src/testing/libgnunettesting.la \
168  libgnunetdatacache.la \
169  $(top_builddir)/src/util/libgnunetutil.la
170
171 perf_datacache_heap_SOURCES = \
172  perf_datacache.c
173 perf_datacache_heap_LDADD = \
174  $(top_builddir)/src/testing/libgnunettesting.la \
175  libgnunetdatacache.la \
176  $(top_builddir)/src/util/libgnunetutil.la
177
178 test_datacache_postgres_SOURCES = \
179  test_datacache.c
180 test_datacache_postgres_LDADD = \
181  $(top_builddir)/src/testing/libgnunettesting.la \
182  libgnunetdatacache.la \
183  $(top_builddir)/src/util/libgnunetutil.la
184
185 test_datacache_quota_postgres_SOURCES = \
186  test_datacache_quota.c
187 test_datacache_quota_postgres_LDADD = \
188  $(top_builddir)/src/testing/libgnunettesting.la \
189  libgnunetdatacache.la \
190  $(top_builddir)/src/util/libgnunetutil.la
191
192 perf_datacache_postgres_SOURCES = \
193  perf_datacache.c
194 perf_datacache_postgres_LDADD = \
195  $(top_builddir)/src/testing/libgnunettesting.la \
196  libgnunetdatacache.la \
197  $(top_builddir)/src/util/libgnunetutil.la
198
199 EXTRA_DIST = \
200  test_datacache_data_sqlite.conf \
201  perf_datacache_data_sqlite.conf \
202  test_datacache_data_heap.conf \
203  perf_datacache_data_heap.conf \
204  test_datacache_data_postgres.conf \
205  perf_datacache_data_postgres.conf