changing datacache API to separate put-paths from data (so that plugins can test...
[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_POSTGRES
23   POSTGRES_PLUGIN = libgnunet_plugin_datacache_postgres.la
24 endif
25
26 lib_LTLIBRARIES = \
27   libgnunetdatacache.la
28
29 libgnunetdatacache_la_SOURCES = \
30   datacache.c 
31 libgnunetdatacache_la_LIBADD = \
32   $(top_builddir)/src/statistics/libgnunetstatistics.la \
33   $(top_builddir)/src/util/libgnunetutil.la \
34   $(GN_LIBINTL) 
35 libgnunetdatacache_la_LDFLAGS = \
36   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
37   -version-info 0:1:0
38
39
40 plugin_LTLIBRARIES = \
41   $(SQLITE_PLUGIN) \
42   $(POSTGRES_PLUGIN) \
43   libgnunet_plugin_datacache_heap.la \
44   libgnunet_plugin_datacache_template.la 
45
46
47 libgnunet_plugin_datacache_sqlite_la_SOURCES = \
48   plugin_datacache_sqlite.c
49 libgnunet_plugin_datacache_sqlite_la_LIBADD = \
50   $(top_builddir)/src/statistics/libgnunetstatistics.la \
51   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
52   $(LTLIBINTL)
53 libgnunet_plugin_datacache_sqlite_la_LDFLAGS = \
54  $(GN_PLUGIN_LDFLAGS)
55
56 libgnunet_plugin_datacache_heap_la_SOURCES = \
57   plugin_datacache_heap.c
58 libgnunet_plugin_datacache_heap_la_LIBADD = \
59   $(top_builddir)/src/statistics/libgnunetstatistics.la \
60   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
61   $(LTLIBINTL)
62 libgnunet_plugin_datacache_heap_la_LDFLAGS = \
63  $(GN_PLUGIN_LDFLAGS)
64
65 libgnunet_plugin_datacache_postgres_la_SOURCES = \
66   plugin_datacache_postgres.c
67 libgnunet_plugin_datacache_postgres_la_LIBADD = \
68   $(top_builddir)/src/postgres/libgnunetpostgres.la \
69   $(top_builddir)/src/statistics/libgnunetstatistics.la \
70   $(top_builddir)/src/util/libgnunetutil.la \
71   $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq
72 libgnunet_plugin_datacache_postgres_la_CPPFLAGS = \
73  $(POSTGRES_CPPFLAGS)
74 libgnunet_plugin_datacache_postgres_la_LDFLAGS = \
75  $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq
76
77 libgnunet_plugin_datacache_template_la_SOURCES = \
78   plugin_datacache_template.c
79 libgnunet_plugin_datacache_template_la_LIBADD = \
80   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
81   $(LTLIBINTL)
82 libgnunet_plugin_datacache_template_la_LDFLAGS = \
83  $(GN_PLUGIN_LDFLAGS)
84
85
86 if HAVE_SQLITE
87 if HAVE_BENCHMARKS
88  SQLITE_BENCHMARKS = \
89   perf_datacache_sqlite
90 endif
91 SQLITE_TESTS = \
92  test_datacache_sqlite \
93  test_datacache_quota_sqlite \
94  $(SQLITE_BENCHMARKS)
95 endif
96
97 if HAVE_BENCHMARKS
98  HEAP_BENCHMARKS = \
99   perf_datacache_heap
100 endif
101 HEAP_TESTS = \
102  test_datacache_heap \
103  test_datacache_quota_heap \
104  $(HEAP_BENCHMARKS)
105
106 if HAVE_POSTGRES
107 if HAVE_BENCHMARKS
108  POSTGRES_BENCHMARKS = \
109   perf_datacache_postgres
110 endif
111 POSTGRES_TESTS = \
112  test_datacache_postgres \
113  test_datacache_quota_postgres \
114  $(POSTGRES_BENCHMARKS)
115 endif
116
117 check_PROGRAMS = \
118  $(SQLITE_TESTS) \
119  $(HEAP_TESTS) \
120  $(POSTGRES_TESTS) 
121
122 if ENABLE_TEST_RUN
123 TESTS = $(check_PROGRAMS)
124 endif
125
126 test_datacache_sqlite_SOURCES = \
127  test_datacache.c
128 test_datacache_sqlite_LDADD = \
129  $(top_builddir)/src/testing/libgnunettesting.la \
130  $(top_builddir)/src/datacache/libgnunetdatacache.la \
131  $(top_builddir)/src/util/libgnunetutil.la  
132
133 test_datacache_quota_sqlite_SOURCES = \
134  test_datacache_quota.c
135 test_datacache_quota_sqlite_LDADD = \
136  $(top_builddir)/src/testing/libgnunettesting.la \
137  $(top_builddir)/src/datacache/libgnunetdatacache.la \
138  $(top_builddir)/src/util/libgnunetutil.la  
139
140 perf_datacache_sqlite_SOURCES = \
141  perf_datacache.c
142 perf_datacache_sqlite_LDADD = \
143  $(top_builddir)/src/testing/libgnunettesting.la \
144  $(top_builddir)/src/datacache/libgnunetdatacache.la \
145  $(top_builddir)/src/util/libgnunetutil.la  
146
147 test_datacache_heap_SOURCES = \
148  test_datacache.c
149 test_datacache_heap_LDADD = \
150  $(top_builddir)/src/testing/libgnunettesting.la \
151  $(top_builddir)/src/datacache/libgnunetdatacache.la \
152  $(top_builddir)/src/util/libgnunetutil.la  
153
154 test_datacache_quota_heap_SOURCES = \
155  test_datacache_quota.c
156 test_datacache_quota_heap_LDADD = \
157  $(top_builddir)/src/testing/libgnunettesting.la \
158  $(top_builddir)/src/datacache/libgnunetdatacache.la \
159  $(top_builddir)/src/util/libgnunetutil.la  
160
161 perf_datacache_heap_SOURCES = \
162  perf_datacache.c
163 perf_datacache_heap_LDADD = \
164  $(top_builddir)/src/testing/libgnunettesting.la \
165  $(top_builddir)/src/datacache/libgnunetdatacache.la \
166  $(top_builddir)/src/util/libgnunetutil.la  
167
168 test_datacache_postgres_SOURCES = \
169  test_datacache.c
170 test_datacache_postgres_LDADD = \
171  $(top_builddir)/src/testing/libgnunettesting.la \
172  $(top_builddir)/src/datacache/libgnunetdatacache.la \
173  $(top_builddir)/src/util/libgnunetutil.la  
174
175 test_datacache_quota_postgres_SOURCES = \
176  test_datacache_quota.c
177 test_datacache_quota_postgres_LDADD = \
178  $(top_builddir)/src/testing/libgnunettesting.la \
179  $(top_builddir)/src/datacache/libgnunetdatacache.la \
180  $(top_builddir)/src/util/libgnunetutil.la  
181
182 perf_datacache_postgres_SOURCES = \
183  perf_datacache.c
184 perf_datacache_postgres_LDADD = \
185  $(top_builddir)/src/testing/libgnunettesting.la \
186  $(top_builddir)/src/datacache/libgnunetdatacache.la \
187  $(top_builddir)/src/util/libgnunetutil.la  
188
189 EXTRA_DIST = \
190  test_datacache_data_sqlite.conf \
191  perf_datacache_data_sqlite.conf \
192  test_datacache_data_heap.conf \
193  perf_datacache_data_heap.conf \
194  test_datacache_data_postgres.conf \
195  perf_datacache_data_postgres.conf