- fix
[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_MYSQL
23   MYSQL_PLUGIN = libgnunet_plugin_datacache_mysql.la
24 endif
25 if HAVE_POSTGRES
26   POSTGRES_PLUGIN = libgnunet_plugin_datacache_postgres.la
27 endif
28
29 lib_LTLIBRARIES = \
30   libgnunetdatacache.la
31
32 libgnunetdatacache_la_SOURCES = \
33   datacache.c 
34 libgnunetdatacache_la_LIBADD = \
35   $(top_builddir)/src/statistics/libgnunetstatistics.la \
36   $(top_builddir)/src/util/libgnunetutil.la \
37   $(GN_LIBINTL) 
38 libgnunetdatacache_la_LDFLAGS = \
39   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
40   -version-info 0:1:0
41
42
43 plugin_LTLIBRARIES = \
44   $(SQLITE_PLUGIN) \
45   $(MYSQL_PLUGIN) \
46   $(POSTGRES_PLUGIN) \
47   libgnunet_plugin_datacache_template.la 
48
49
50 libgnunet_plugin_datacache_sqlite_la_SOURCES = \
51   plugin_datacache_sqlite.c
52 libgnunet_plugin_datacache_sqlite_la_LIBADD = \
53   $(top_builddir)/src/statistics/libgnunetstatistics.la \
54   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3
55 libgnunet_plugin_datacache_sqlite_la_LDFLAGS = \
56  $(GN_PLUGIN_LDFLAGS)
57
58 libgnunet_plugin_datacache_mysql_la_SOURCES = \
59   plugin_datacache_mysql.c
60 libgnunet_plugin_datacache_mysql_la_LIBADD = \
61   $(top_builddir)/src/statistics/libgnunetstatistics.la \
62   $(top_builddir)/src/mysql/libgnunetmysql.la \
63   $(top_builddir)/src/util/libgnunetutil.la \
64   $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
65 libgnunet_plugin_datacache_mysql_la_CPPFLAGS = \
66  $(MYSQL_CPPFLAGS)
67 libgnunet_plugin_datacache_mysql_la_LDFLAGS = \
68  $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
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) $(POSTGRES_LDFLAGS) -lpq
77 libgnunet_plugin_datacache_postgres_la_CPPFLAGS = \
78  $(POSTGRES_CPPFLAGS)
79 libgnunet_plugin_datacache_postgres_la_LDFLAGS = \
80  $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq
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 libgnunet_plugin_datacache_template_la_LDFLAGS = \
87  $(GN_PLUGIN_LDFLAGS)
88
89
90 if HAVE_SQLITE
91 if HAVE_BENCHMARKS
92  SQLITE_BENCHMARKS = \
93   perf_datacache_sqlite
94 endif
95 SQLITE_TESTS = \
96  test_datacache_sqlite \
97  test_datacache_quota_sqlite \
98  $(SQLITE_BENCHMARKS)
99 endif
100
101 if HAVE_MYSQL
102 if HAVE_BENCHMARKS
103  MYSQL_BENCHMARKS = \
104   perf_datacache_mysql
105 endif
106 MYSQL_TESTS = \
107  test_datacache_mysql \
108  test_datacache_quota_mysql \
109  $(MYSQL_BENCHMARKS)
110 endif
111
112 if HAVE_POSTGRES
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
123 check_PROGRAMS = \
124  $(SQLITE_TESTS) \
125  $(MYSQL_TESTS) \
126  $(POSTGRES_TESTS) 
127
128 if ENABLE_TEST_RUN
129 TESTS = $(check_PROGRAMS)
130 endif
131
132 test_datacache_sqlite_SOURCES = \
133  test_datacache.c
134 test_datacache_sqlite_LDADD = \
135  $(top_builddir)/src/datacache/libgnunetdatacache.la \
136  $(top_builddir)/src/util/libgnunetutil.la  
137
138 test_datacache_quota_sqlite_SOURCES = \
139  test_datacache_quota.c
140 test_datacache_quota_sqlite_LDADD = \
141  $(top_builddir)/src/datacache/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/datacache/libgnunetdatacache.la \
148  $(top_builddir)/src/util/libgnunetutil.la  
149
150 test_datacache_mysql_SOURCES = \
151  test_datacache.c
152 test_datacache_mysql_LDADD = \
153  $(top_builddir)/src/datacache/libgnunetdatacache.la \
154  $(top_builddir)/src/util/libgnunetutil.la  
155
156 test_datacache_quota_mysql_SOURCES = \
157  test_datacache_quota.c
158 test_datacache_quota_mysql_LDADD = \
159  $(top_builddir)/src/datacache/libgnunetdatacache.la \
160  $(top_builddir)/src/util/libgnunetutil.la  
161
162 perf_datacache_mysql_SOURCES = \
163  perf_datacache.c
164 perf_datacache_mysql_LDADD = \
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/datacache/libgnunetdatacache.la \
172  $(top_builddir)/src/util/libgnunetutil.la  
173
174 test_datacache_quota_postgres_SOURCES = \
175  test_datacache_quota.c
176 test_datacache_quota_postgres_LDADD = \
177  $(top_builddir)/src/datacache/libgnunetdatacache.la \
178  $(top_builddir)/src/util/libgnunetutil.la  
179
180 perf_datacache_postgres_SOURCES = \
181  perf_datacache.c
182 perf_datacache_postgres_LDADD = \
183  $(top_builddir)/src/datacache/libgnunetdatacache.la \
184  $(top_builddir)/src/util/libgnunetutil.la  
185
186 EXTRA_DIST = \
187  test_datacache_data_sqlite.conf \
188  perf_datacache_data_sqlite.conf \
189  test_datacache_data_mysql.conf \
190  perf_datacache_data_mysql.conf \
191  test_datacache_data_postgres.conf \
192  perf_datacache_data_postgres.conf