Merge branch 'credentials' of git+ssh://gnunet.org/gnunet into credentials
[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/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
57   $(LTLIBINTL)
58 libgnunet_plugin_datacache_sqlite_la_LDFLAGS = \
59  $(GN_PLUGIN_LDFLAGS)
60
61 libgnunet_plugin_datacache_heap_la_SOURCES = \
62   plugin_datacache_heap.c
63 libgnunet_plugin_datacache_heap_la_LIBADD = \
64   $(top_builddir)/src/statistics/libgnunetstatistics.la \
65   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
66   $(LTLIBINTL)
67 libgnunet_plugin_datacache_heap_la_LDFLAGS = \
68  $(GN_PLUGIN_LDFLAGS)
69
70 libgnunet_plugin_datacache_postgres_la_SOURCES = \
71   plugin_datacache_postgres.c
72 libgnunet_plugin_datacache_postgres_la_LIBADD = \
73   $(top_builddir)/src/postgres/libgnunetpostgres.la \
74   $(top_builddir)/src/statistics/libgnunetstatistics.la \
75   $(top_builddir)/src/util/libgnunetutil.la \
76   $(GN_PLUGIN_LDFLAGS) -lpq
77 libgnunet_plugin_datacache_postgres_la_CPPFLAGS = \
78  $(POSTGRESQL_CPPFLAGS) $(AM_CPPFLAGS)
79 libgnunet_plugin_datacache_postgres_la_LDFLAGS = \
80  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
81
82 libgnunet_plugin_datacache_template_la_SOURCES = \
83   plugin_datacache_template.c
84 libgnunet_plugin_datacache_template_la_LIBADD = \
85   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
86   $(LTLIBINTL)
87 libgnunet_plugin_datacache_template_la_LDFLAGS = \
88  $(GN_PLUGIN_LDFLAGS)
89
90
91 if HAVE_TESTING
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_BENCHMARKS
104  HEAP_BENCHMARKS = \
105   perf_datacache_heap
106 endif
107 HEAP_TESTS = \
108  test_datacache_heap \
109  test_datacache_quota_heap \
110  $(HEAP_BENCHMARKS)
111
112 if HAVE_POSTGRESQL
113 if HAVE_BENCHMARKS
114  POSTGRES_BENCHMARKS = \
115   perf_datacache_postgres
116 endif
117 POSTGRES_TESTS = \
118  test_datacache_postgres \
119  test_datacache_quota_postgres \
120  $(POSTGRES_BENCHMARKS)
121 endif
122 endif
123
124 check_PROGRAMS = \
125  $(SQLITE_TESTS) \
126  $(HEAP_TESTS) \
127  $(POSTGRES_TESTS)
128
129 if ENABLE_TEST_RUN
130 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
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  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  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  libgnunetdatacache.la \
153  $(top_builddir)/src/util/libgnunetutil.la
154
155 test_datacache_heap_SOURCES = \
156  test_datacache.c
157 test_datacache_heap_LDADD = \
158  $(top_builddir)/src/testing/libgnunettesting.la \
159  libgnunetdatacache.la \
160  $(top_builddir)/src/util/libgnunetutil.la
161
162 test_datacache_quota_heap_SOURCES = \
163  test_datacache_quota.c
164 test_datacache_quota_heap_LDADD = \
165  $(top_builddir)/src/testing/libgnunettesting.la \
166  libgnunetdatacache.la \
167  $(top_builddir)/src/util/libgnunetutil.la
168
169 perf_datacache_heap_SOURCES = \
170  perf_datacache.c
171 perf_datacache_heap_LDADD = \
172  $(top_builddir)/src/testing/libgnunettesting.la \
173  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  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  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  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_heap.conf \
201  perf_datacache_data_heap.conf \
202  test_datacache_data_postgres.conf \
203  perf_datacache_data_postgres.conf