670a64926e38cbea58ed920fd439313e0f9687b8
[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/statistics/libgnunetstatistics.la \
76   $(top_builddir)/src/util/libgnunetutil.la \
77   $(GN_PLUGIN_LDFLAGS) -lpq
78 libgnunet_plugin_datacache_postgres_la_CPPFLAGS = \
79  $(POSTGRESQL_CPPFLAGS) $(AM_CPPFLAGS)
80 libgnunet_plugin_datacache_postgres_la_LDFLAGS = \
81  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
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_TESTING
93 if HAVE_SQLITE
94 if HAVE_BENCHMARKS
95  SQLITE_BENCHMARKS = \
96   perf_datacache_sqlite
97 endif
98 SQLITE_TESTS = \
99  test_datacache_sqlite \
100  test_datacache_quota_sqlite \
101  $(SQLITE_BENCHMARKS)
102 endif
103
104 if HAVE_BENCHMARKS
105  HEAP_BENCHMARKS = \
106   perf_datacache_heap
107 endif
108 HEAP_TESTS = \
109  test_datacache_heap \
110  test_datacache_quota_heap \
111  $(HEAP_BENCHMARKS)
112
113 if HAVE_POSTGRESQL
114 if HAVE_BENCHMARKS
115  POSTGRES_BENCHMARKS = \
116   perf_datacache_postgres
117 endif
118 POSTGRES_TESTS = \
119  test_datacache_postgres \
120  test_datacache_quota_postgres \
121  $(POSTGRES_BENCHMARKS)
122 endif
123 endif
124
125 check_PROGRAMS = \
126  $(SQLITE_TESTS) \
127  $(HEAP_TESTS) \
128  $(POSTGRES_TESTS)
129
130 if ENABLE_TEST_RUN
131 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
132 TESTS = $(check_PROGRAMS)
133 endif
134
135 test_datacache_sqlite_SOURCES = \
136  test_datacache.c
137 test_datacache_sqlite_LDADD = \
138  $(top_builddir)/src/testing/libgnunettesting.la \
139  libgnunetdatacache.la \
140  $(top_builddir)/src/util/libgnunetutil.la
141
142 test_datacache_quota_sqlite_SOURCES = \
143  test_datacache_quota.c
144 test_datacache_quota_sqlite_LDADD = \
145  $(top_builddir)/src/testing/libgnunettesting.la \
146  libgnunetdatacache.la \
147  $(top_builddir)/src/util/libgnunetutil.la
148
149 perf_datacache_sqlite_SOURCES = \
150  perf_datacache.c
151 perf_datacache_sqlite_LDADD = \
152  $(top_builddir)/src/testing/libgnunettesting.la \
153  libgnunetdatacache.la \
154  $(top_builddir)/src/util/libgnunetutil.la
155
156 test_datacache_heap_SOURCES = \
157  test_datacache.c
158 test_datacache_heap_LDADD = \
159  $(top_builddir)/src/testing/libgnunettesting.la \
160  libgnunetdatacache.la \
161  $(top_builddir)/src/util/libgnunetutil.la
162
163 test_datacache_quota_heap_SOURCES = \
164  test_datacache_quota.c
165 test_datacache_quota_heap_LDADD = \
166  $(top_builddir)/src/testing/libgnunettesting.la \
167  libgnunetdatacache.la \
168  $(top_builddir)/src/util/libgnunetutil.la
169
170 perf_datacache_heap_SOURCES = \
171  perf_datacache.c
172 perf_datacache_heap_LDADD = \
173  $(top_builddir)/src/testing/libgnunettesting.la \
174  libgnunetdatacache.la \
175  $(top_builddir)/src/util/libgnunetutil.la
176
177 test_datacache_postgres_SOURCES = \
178  test_datacache.c
179 test_datacache_postgres_LDADD = \
180  $(top_builddir)/src/testing/libgnunettesting.la \
181  libgnunetdatacache.la \
182  $(top_builddir)/src/util/libgnunetutil.la
183
184 test_datacache_quota_postgres_SOURCES = \
185  test_datacache_quota.c
186 test_datacache_quota_postgres_LDADD = \
187  $(top_builddir)/src/testing/libgnunettesting.la \
188  libgnunetdatacache.la \
189  $(top_builddir)/src/util/libgnunetutil.la
190
191 perf_datacache_postgres_SOURCES = \
192  perf_datacache.c
193 perf_datacache_postgres_LDADD = \
194  $(top_builddir)/src/testing/libgnunettesting.la \
195  libgnunetdatacache.la \
196  $(top_builddir)/src/util/libgnunetutil.la
197
198 EXTRA_DIST = \
199  test_datacache_data_sqlite.conf \
200  perf_datacache_data_sqlite.conf \
201  test_datacache_data_heap.conf \
202  perf_datacache_data_heap.conf \
203  test_datacache_data_postgres.conf \
204  perf_datacache_data_postgres.conf