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