-docu
[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/util/libgnunetutil.la \
63   $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
64 libgnunet_plugin_datacache_mysql_la_CPPFLAGS = \
65  $(MYSQL_CPPFLAGS)
66 libgnunet_plugin_datacache_mysql_la_LDFLAGS = \
67  $(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
68
69 libgnunet_plugin_datacache_postgres_la_SOURCES = \
70   plugin_datacache_postgres.c
71 libgnunet_plugin_datacache_postgres_la_LIBADD = \
72   $(top_builddir)/src/statistics/libgnunetstatistics.la \
73   $(top_builddir)/src/util/libgnunetutil.la \
74   $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq
75 libgnunet_plugin_datacache_postgres_la_CPPFLAGS = \
76  $(POSTGRES_CPPFLAGS)
77 libgnunet_plugin_datacache_postgres_la_LDFLAGS = \
78  $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq
79
80 libgnunet_plugin_datacache_template_la_SOURCES = \
81   plugin_datacache_template.c
82 libgnunet_plugin_datacache_template_la_LIBADD = \
83   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS)
84 libgnunet_plugin_datacache_template_la_LDFLAGS = \
85  $(GN_PLUGIN_LDFLAGS)
86
87
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_MYSQL
100 if HAVE_BENCHMARKS
101  MYSQL_BENCHMARKS = \
102   perf_datacache_mysql
103 endif
104 MYSQL_TESTS = \
105  test_datacache_mysql \
106  test_datacache_quota_mysql \
107  $(MYSQL_BENCHMARKS)
108 endif
109
110 if HAVE_POSTGRES
111 if HAVE_BENCHMARKS
112  POSTGRES_BENCHMARKS = \
113   perf_datacache_postgres
114 endif
115 POSTGRES_TESTS = \
116  test_datacache_postgres \
117  test_datacache_quota_postgres \
118  $(POSTGRES_BENCHMARKS)
119 endif
120
121 check_PROGRAMS = \
122  $(SQLITE_TESTS) \
123  $(MYSQL_TESTS) \
124  $(POSTGRES_TESTS) 
125
126 if ENABLE_TEST_RUN
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/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/datacache/libgnunetdatacache.la \
140  $(top_builddir)/src/util/libgnunetutil.la  
141
142 perf_datacache_sqlite_SOURCES = \
143  perf_datacache.c
144 perf_datacache_sqlite_LDADD = \
145  $(top_builddir)/src/datacache/libgnunetdatacache.la \
146  $(top_builddir)/src/util/libgnunetutil.la  
147
148 test_datacache_mysql_SOURCES = \
149  test_datacache.c
150 test_datacache_mysql_LDADD = \
151  $(top_builddir)/src/datacache/libgnunetdatacache.la \
152  $(top_builddir)/src/util/libgnunetutil.la  
153
154 test_datacache_quota_mysql_SOURCES = \
155  test_datacache_quota.c
156 test_datacache_quota_mysql_LDADD = \
157  $(top_builddir)/src/datacache/libgnunetdatacache.la \
158  $(top_builddir)/src/util/libgnunetutil.la  
159
160 perf_datacache_mysql_SOURCES = \
161  perf_datacache.c
162 perf_datacache_mysql_LDADD = \
163  $(top_builddir)/src/datacache/libgnunetdatacache.la \
164  $(top_builddir)/src/util/libgnunetutil.la  
165
166 test_datacache_postgres_SOURCES = \
167  test_datacache.c
168 test_datacache_postgres_LDADD = \
169  $(top_builddir)/src/datacache/libgnunetdatacache.la \
170  $(top_builddir)/src/util/libgnunetutil.la  
171
172 test_datacache_quota_postgres_SOURCES = \
173  test_datacache_quota.c
174 test_datacache_quota_postgres_LDADD = \
175  $(top_builddir)/src/datacache/libgnunetdatacache.la \
176  $(top_builddir)/src/util/libgnunetutil.la  
177
178 perf_datacache_postgres_SOURCES = \
179  perf_datacache.c
180 perf_datacache_postgres_LDADD = \
181  $(top_builddir)/src/datacache/libgnunetdatacache.la \
182  $(top_builddir)/src/util/libgnunetutil.la  
183
184 EXTRA_DIST = \
185  test_datacache_data_sqlite.conf \
186  perf_datacache_data_sqlite.conf \
187  test_datacache_data_mysql.conf \
188  perf_datacache_data_mysql.conf \
189  test_datacache_data_postgres.conf \
190  perf_datacache_data_postgres.conf