fix
[oweals/gnunet.git] / src / datacache / Makefile.am
1 INCLUDES = -I$(top_srcdir)/src/include
2
3 plugindir = $(libdir)/gnunet
4
5 if MINGW
6   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
7 endif
8
9 if USE_COVERAGE
10   AM_CFLAGS = --coverage -O0
11   XLIBS = -lgcov
12 endif
13
14 if HAVE_SQLITE
15   SQLITE_PLUGIN = libgnunet_plugin_datacache_sqlite.la
16 endif
17 if HAVE_MYSQL
18   MYSQL_PLUGIN = libgnunet_plugin_datacache_mysql.la
19 endif
20 if HAVE_POSTGRES
21   POSTGRES_PLUGIN = libgnunet_plugin_datacache_postgres.la
22 endif
23
24 lib_LTLIBRARIES = \
25   libgnunetdatacache.la
26
27 libgnunetdatacache_la_SOURCES = \
28   datacache.c 
29 libgnunetdatacache_la_LIBADD = \
30   $(top_builddir)/src/statistics/libgnunetstatistics.la \
31   $(top_builddir)/src/util/libgnunetutil.la \
32   $(GN_LIBINTL) 
33 libgnunetdatacache_la_LDFLAGS = \
34   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
35   -version-info 0:0:0
36
37
38 plugin_LTLIBRARIES = \
39   $(SQLITE_PLUGIN) \
40   $(MYSQL_PLUGIN) \
41   $(POSTGRES_PLUGIN) \
42   libgnunet_plugin_datacache_template.la 
43
44
45 libgnunet_plugin_datacache_sqlite_la_SOURCES = \
46   plugin_datacache_sqlite.c
47 libgnunet_plugin_datacache_sqlite_la_LIBADD = \
48   $(top_builddir)/src/statistics/libgnunetstatistics.la \
49   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3
50 libgnunet_plugin_datacache_sqlite_la_LDFLAGS = \
51  $(GN_PLUGIN_LDFLAGS)
52
53 libgnunet_plugin_datacache_mysql_la_SOURCES = \
54   plugin_datacache_mysql.c
55 libgnunet_plugin_datacache_mysql_la_LIBADD = \
56   $(top_builddir)/src/statistics/libgnunetstatistics.la \
57   $(top_builddir)/src/util/libgnunetutil.la \
58   $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
59 libgnunet_plugin_datacache_mysql_la_CPPFLAGS = \
60  $(MYSQL_CPPFLAGS)
61 libgnunet_plugin_datacache_mysql_la_LDFLAGS = \
62  $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
63
64 libgnunet_plugin_datacache_postgres_la_SOURCES = \
65   plugin_datacache_postgres.c
66 libgnunet_plugin_datacache_postgres_la_LIBADD = \
67   $(top_builddir)/src/statistics/libgnunetstatistics.la \
68   $(top_builddir)/src/util/libgnunetutil.la \
69   $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq
70 libgnunet_plugin_datacache_postgres_la_CPPFLAGS = \
71  $(POSTGRES_CPPFLAGS)
72 libgnunet_plugin_datacache_postgres_la_LDFLAGS = \
73  $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq
74
75 libgnunet_plugin_datacache_template_la_SOURCES = \
76   plugin_datacache_template.c
77 libgnunet_plugin_datacache_template_la_LIBADD = \
78   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS)
79 libgnunet_plugin_datacache_template_la_LDFLAGS = \
80  $(GN_PLUGIN_LDFLAGS)
81
82
83 if HAVE_SQLITE
84 if HAVE_BENCHMARKS
85  SQLITE_BENCHMARKS = \
86   perf_datacache_sqlite
87 endif
88 SQLITE_TESTS = \
89  test_datacache_sqlite \
90  test_datacache_quota_sqlite \
91  $(SQLITE_BENCHMARKS)
92 endif
93
94 if HAVE_MYSQL
95 if HAVE_BENCHMARKS
96  MYSQL_BENCHMARKS = \
97   perf_datacache_mysql
98 endif
99 MYSQL_TESTS = \
100  test_datacache_mysql \
101  test_datacache_quota_mysql \
102  $(MYSQL_BENCHMARKS)
103 endif
104
105 if HAVE_POSTGRES
106 if HAVE_BENCHMARKS
107  POSTGRES_BENCHMARKS = \
108   perf_datacache_postgres
109 endif
110 POSTGRES_TESTS = \
111  test_datacache_postgres \
112  test_datacache_quota_postgres \
113  $(POSTGRES_BENCHMARKS)
114 endif
115
116 check_PROGRAMS = \
117  $(SQLITE_TESTS) \
118  $(MYSQL_TESTS) \
119  $(POSTGRES_TESTS) 
120
121 if ENABLE_TEST_RUN
122 TESTS = $(check_PROGRAMS)
123 endif
124
125 test_datacache_sqlite_SOURCES = \
126  test_datacache.c
127 test_datacache_sqlite_LDADD = \
128  $(top_builddir)/src/datacache/libgnunetdatacache.la \
129  $(top_builddir)/src/util/libgnunetutil.la  
130
131 test_datacache_quota_sqlite_SOURCES = \
132  test_datacache_quota.c
133 test_datacache_quota_sqlite_LDADD = \
134  $(top_builddir)/src/datacache/libgnunetdatacache.la \
135  $(top_builddir)/src/util/libgnunetutil.la  
136
137 perf_datacache_sqlite_SOURCES = \
138  perf_datacache.c
139 perf_datacache_sqlite_LDADD = \
140  $(top_builddir)/src/datacache/libgnunetdatacache.la \
141  $(top_builddir)/src/util/libgnunetutil.la  
142
143 test_datacache_mysql_SOURCES = \
144  test_datacache.c
145 test_datacache_mysql_LDADD = \
146  $(top_builddir)/src/datacache/libgnunetdatacache.la \
147  $(top_builddir)/src/util/libgnunetutil.la  
148
149 test_datacache_quota_mysql_SOURCES = \
150  test_datacache_quota.c
151 test_datacache_quota_mysql_LDADD = \
152  $(top_builddir)/src/datacache/libgnunetdatacache.la \
153  $(top_builddir)/src/util/libgnunetutil.la  
154
155 perf_datacache_mysql_SOURCES = \
156  perf_datacache.c
157 perf_datacache_mysql_LDADD = \
158  $(top_builddir)/src/datacache/libgnunetdatacache.la \
159  $(top_builddir)/src/util/libgnunetutil.la  
160
161 test_datacache_postgres_SOURCES = \
162  test_datacache.c
163 test_datacache_postgres_LDADD = \
164  $(top_builddir)/src/datacache/libgnunetdatacache.la \
165  $(top_builddir)/src/util/libgnunetutil.la  
166
167 test_datacache_quota_postgres_SOURCES = \
168  test_datacache_quota.c
169 test_datacache_quota_postgres_LDADD = \
170  $(top_builddir)/src/datacache/libgnunetdatacache.la \
171  $(top_builddir)/src/util/libgnunetutil.la  
172
173 perf_datacache_postgres_SOURCES = \
174  perf_datacache.c
175 perf_datacache_postgres_LDADD = \
176  $(top_builddir)/src/datacache/libgnunetdatacache.la \
177  $(top_builddir)/src/util/libgnunetutil.la  
178
179 EXTRA_DIST = \
180  test_datacache_data_sqlite.conf \
181  perf_datacache_data_sqlite.conf \
182  test_datacache_data_mysql.conf \
183  perf_datacache_data_mysql.conf \
184  test_datacache_data_postgres.conf \
185  perf_datacache_data_postgres.conf