- refactor kx sending, unify under send_kx
[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   libgnunet_plugin_datacache_template.la 
46
47
48 libgnunet_plugin_datacache_sqlite_la_SOURCES = \
49   plugin_datacache_sqlite.c
50 libgnunet_plugin_datacache_sqlite_la_LIBADD = \
51   $(top_builddir)/src/statistics/libgnunetstatistics.la \
52   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
53   $(LTLIBINTL)
54 libgnunet_plugin_datacache_sqlite_la_LDFLAGS = \
55  $(GN_PLUGIN_LDFLAGS)
56
57 libgnunet_plugin_datacache_heap_la_SOURCES = \
58   plugin_datacache_heap.c
59 libgnunet_plugin_datacache_heap_la_LIBADD = \
60   $(top_builddir)/src/statistics/libgnunetstatistics.la \
61   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
62   $(LTLIBINTL)
63 libgnunet_plugin_datacache_heap_la_LDFLAGS = \
64  $(GN_PLUGIN_LDFLAGS)
65
66 libgnunet_plugin_datacache_postgres_la_SOURCES = \
67   plugin_datacache_postgres.c
68 libgnunet_plugin_datacache_postgres_la_LIBADD = \
69   $(top_builddir)/src/postgres/libgnunetpostgres.la \
70   $(top_builddir)/src/statistics/libgnunetstatistics.la \
71   $(top_builddir)/src/util/libgnunetutil.la \
72   $(GN_PLUGIN_LDFLAGS) -lpq
73 libgnunet_plugin_datacache_postgres_la_CPPFLAGS = \
74  $(POSTGRESQL_CPPFLAGS) $(AM_CPPFLAGS)
75 libgnunet_plugin_datacache_postgres_la_LDFLAGS = \
76  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
77
78 libgnunet_plugin_datacache_template_la_SOURCES = \
79   plugin_datacache_template.c
80 libgnunet_plugin_datacache_template_la_LIBADD = \
81   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
82   $(LTLIBINTL)
83 libgnunet_plugin_datacache_template_la_LDFLAGS = \
84  $(GN_PLUGIN_LDFLAGS)
85
86
87 if HAVE_TESTING
88 if HAVE_SQLITE
89 if HAVE_BENCHMARKS
90  SQLITE_BENCHMARKS = \
91   perf_datacache_sqlite
92 endif
93 SQLITE_TESTS = \
94  test_datacache_sqlite \
95  test_datacache_quota_sqlite \
96  $(SQLITE_BENCHMARKS)
97 endif
98
99 if HAVE_BENCHMARKS
100  HEAP_BENCHMARKS = \
101   perf_datacache_heap
102 endif
103 HEAP_TESTS = \
104  test_datacache_heap \
105  test_datacache_quota_heap \
106  $(HEAP_BENCHMARKS)
107
108 if HAVE_POSTGRESQL
109 if HAVE_BENCHMARKS
110  POSTGRES_BENCHMARKS = \
111   perf_datacache_postgres
112 endif
113 POSTGRES_TESTS = \
114  test_datacache_postgres \
115  test_datacache_quota_postgres \
116  $(POSTGRES_BENCHMARKS)
117 endif
118 endif
119
120 check_PROGRAMS = \
121  $(SQLITE_TESTS) \
122  $(HEAP_TESTS) \
123  $(POSTGRES_TESTS) 
124
125 if ENABLE_TEST_RUN
126 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
127 TESTS = $(check_PROGRAMS)
128 endif
129
130 test_datacache_sqlite_SOURCES = \
131  test_datacache.c
132 test_datacache_sqlite_LDADD = \
133  $(top_builddir)/src/testing/libgnunettesting.la \
134  libgnunetdatacache.la \
135  $(top_builddir)/src/util/libgnunetutil.la  
136
137 test_datacache_quota_sqlite_SOURCES = \
138  test_datacache_quota.c
139 test_datacache_quota_sqlite_LDADD = \
140  $(top_builddir)/src/testing/libgnunettesting.la \
141  libgnunetdatacache.la \
142  $(top_builddir)/src/util/libgnunetutil.la  
143
144 perf_datacache_sqlite_SOURCES = \
145  perf_datacache.c
146 perf_datacache_sqlite_LDADD = \
147  $(top_builddir)/src/testing/libgnunettesting.la \
148  libgnunetdatacache.la \
149  $(top_builddir)/src/util/libgnunetutil.la  
150
151 test_datacache_heap_SOURCES = \
152  test_datacache.c
153 test_datacache_heap_LDADD = \
154  $(top_builddir)/src/testing/libgnunettesting.la \
155  libgnunetdatacache.la \
156  $(top_builddir)/src/util/libgnunetutil.la  
157
158 test_datacache_quota_heap_SOURCES = \
159  test_datacache_quota.c
160 test_datacache_quota_heap_LDADD = \
161  $(top_builddir)/src/testing/libgnunettesting.la \
162  libgnunetdatacache.la \
163  $(top_builddir)/src/util/libgnunetutil.la  
164
165 perf_datacache_heap_SOURCES = \
166  perf_datacache.c
167 perf_datacache_heap_LDADD = \
168  $(top_builddir)/src/testing/libgnunettesting.la \
169  libgnunetdatacache.la \
170  $(top_builddir)/src/util/libgnunetutil.la  
171
172 test_datacache_postgres_SOURCES = \
173  test_datacache.c
174 test_datacache_postgres_LDADD = \
175  $(top_builddir)/src/testing/libgnunettesting.la \
176  libgnunetdatacache.la \
177  $(top_builddir)/src/util/libgnunetutil.la  
178
179 test_datacache_quota_postgres_SOURCES = \
180  test_datacache_quota.c
181 test_datacache_quota_postgres_LDADD = \
182  $(top_builddir)/src/testing/libgnunettesting.la \
183  libgnunetdatacache.la \
184  $(top_builddir)/src/util/libgnunetutil.la  
185
186 perf_datacache_postgres_SOURCES = \
187  perf_datacache.c
188 perf_datacache_postgres_LDADD = \
189  $(top_builddir)/src/testing/libgnunettesting.la \
190  libgnunetdatacache.la \
191  $(top_builddir)/src/util/libgnunetutil.la  
192
193 EXTRA_DIST = \
194  test_datacache_data_sqlite.conf \
195  perf_datacache_data_sqlite.conf \
196  test_datacache_data_heap.conf \
197  perf_datacache_data_heap.conf \
198  test_datacache_data_postgres.conf \
199  perf_datacache_data_postgres.conf