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 SQLITE_TESTS = \
85  test_datacache_sqlite \
86  test_datacache_quota_sqlite \
87  perf_datacache_sqlite
88 endif
89
90 if HAVE_MYSQL
91 MYSQL_TESTS = \
92  test_datacache_mysql \
93  test_datacache_quota_mysql \
94  perf_datacache_mysql
95 endif
96
97 if HAVE_POSTGRES
98 POSTGRES_TESTS = \
99  test_datacache_postgres \
100  test_datacache_quota_postgres \
101  perf_datacache_postgres
102 endif
103
104 check_PROGRAMS = \
105  $(SQLITE_TESTS) \
106  $(MYSQL_TESTS) \
107  $(POSTGRES_TESTS) 
108
109 if !DISABLE_TEST_RUN
110 TESTS = $(check_PROGRAMS)
111 endif
112
113 test_datacache_sqlite_SOURCES = \
114  test_datacache.c
115 test_datacache_sqlite_LDADD = \
116  $(top_builddir)/src/datacache/libgnunetdatacache.la \
117  $(top_builddir)/src/util/libgnunetutil.la  
118
119 test_datacache_quota_sqlite_SOURCES = \
120  test_datacache_quota.c
121 test_datacache_quota_sqlite_LDADD = \
122  $(top_builddir)/src/datacache/libgnunetdatacache.la \
123  $(top_builddir)/src/util/libgnunetutil.la  
124
125 perf_datacache_sqlite_SOURCES = \
126  perf_datacache.c
127 perf_datacache_sqlite_LDADD = \
128  $(top_builddir)/src/datacache/libgnunetdatacache.la \
129  $(top_builddir)/src/util/libgnunetutil.la  
130
131 test_datacache_mysql_SOURCES = \
132  test_datacache.c
133 test_datacache_mysql_LDADD = \
134  $(top_builddir)/src/datacache/libgnunetdatacache.la \
135  $(top_builddir)/src/util/libgnunetutil.la  
136
137 test_datacache_quota_mysql_SOURCES = \
138  test_datacache_quota.c
139 test_datacache_quota_mysql_LDADD = \
140  $(top_builddir)/src/datacache/libgnunetdatacache.la \
141  $(top_builddir)/src/util/libgnunetutil.la  
142
143 perf_datacache_mysql_SOURCES = \
144  perf_datacache.c
145 perf_datacache_mysql_LDADD = \
146  $(top_builddir)/src/datacache/libgnunetdatacache.la \
147  $(top_builddir)/src/util/libgnunetutil.la  
148
149 test_datacache_postgres_SOURCES = \
150  test_datacache.c
151 test_datacache_postgres_LDADD = \
152  $(top_builddir)/src/datacache/libgnunetdatacache.la \
153  $(top_builddir)/src/util/libgnunetutil.la  
154
155 test_datacache_quota_postgres_SOURCES = \
156  test_datacache_quota.c
157 test_datacache_quota_postgres_LDADD = \
158  $(top_builddir)/src/datacache/libgnunetdatacache.la \
159  $(top_builddir)/src/util/libgnunetutil.la  
160
161 perf_datacache_postgres_SOURCES = \
162  perf_datacache.c
163 perf_datacache_postgres_LDADD = \
164  $(top_builddir)/src/datacache/libgnunetdatacache.la \
165  $(top_builddir)/src/util/libgnunetutil.la  
166
167 EXTRA_DIST = \
168  test_datacache_data_sqlite.conf \
169  perf_datacache_data_sqlite.conf \
170  test_datacache_data_mysql.conf \
171  perf_datacache_data_mysql.conf \
172  test_datacache_data_postgres.conf \
173  perf_datacache_data_postgres.conf