- move rest plugins into rest directory where they belong
[oweals/gnunet.git] / src / namestore / Makefile.am
1 # This Makefile.am is in the public domain
2 AM_CPPFLAGS = -I$(top_srcdir)/src/include $(POSTGRESQL_CPPFLAGS)
3
4 plugindir = $(libdir)/gnunet
5
6 pkgcfgdir= $(pkgdatadir)/config.d/
7
8 libexecdir= $(pkglibdir)/libexec/
9
10 pkgcfg_DATA = \
11    namestore.conf
12
13
14 if MINGW
15   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
16 endif
17
18 if USE_COVERAGE
19   AM_CFLAGS = --coverage -O0
20   XLIBS = -lgcov
21 endif
22
23 if HAVE_EXPERIMENTAL
24 FLAT_PLUGIN = libgnunet_plugin_namestore_flat.la
25 if HAVE_TESTING
26 FLAT_TESTS = test_plugin_namestore_flat
27 endif
28 endif
29
30 if HAVE_SQLITE
31 SQLITE_PLUGIN = libgnunet_plugin_namestore_sqlite.la
32 if HAVE_TESTING
33 SQLITE_TESTS = test_plugin_namestore_sqlite
34 endif
35 endif
36
37 if HAVE_POSTGRESQL
38 # postgres doesn't even build yet; thus: experimental!
39 POSTGRES_PLUGIN = libgnunet_plugin_namestore_postgres.la
40 if HAVE_TESTING
41 POSTGRES_TESTS = test_plugin_namestore_postgres
42 endif
43 endif
44
45 # testcases do not even build yet; thus: experimental!
46 if HAVE_TESTING
47 TESTING_TESTS = \
48  test_namestore_api_store \
49  test_namestore_api_store_update \
50  test_namestore_api_lookup_public \
51  test_namestore_api_lookup_private \
52  test_namestore_api_lookup_nick \
53  test_namestore_api_lookup_shadow \
54  test_namestore_api_lookup_shadow_filter \
55  test_namestore_api_remove \
56  test_namestore_api_remove_not_existing_record \
57  test_namestore_api_zone_iteration \
58  test_namestore_api_zone_iteration_nick \
59  test_namestore_api_zone_iteration_specific_zone \
60  test_namestore_api_zone_iteration_stop \
61  test_namestore_api_monitoring \
62  test_namestore_api_monitoring_existing
63 # test_namestore_api_zone_to_name
64 endif
65
66 if HAVE_SQLITE
67 check_PROGRAMS = \
68  $(SQLITE_TESTS) \
69  $(POSTGRES_TESTS) \
70  $(FLAT_TESTS) \
71  $(TESTING_TESTS)
72 endif
73
74 if ENABLE_TEST_RUN
75 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
76 TESTS = \
77   $(check_PROGRAMS) \
78   $(check_SCRIPTS)
79 endif
80
81 lib_LTLIBRARIES = \
82   libgnunetnamestore.la
83
84 libgnunetnamestore_la_SOURCES = \
85   namestore_api.c \
86   namestore_api_monitor.c \
87   namestore.h
88 libgnunetnamestore_la_LIBADD = \
89   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
90   $(top_builddir)/src/statistics/libgnunetstatistics.la \
91   $(top_builddir)/src/dns/libgnunetdnsparser.la \
92   $(top_builddir)/src/util/libgnunetutil.la \
93   $(GN_LIBINTL)
94 libgnunetnamestore_la_LDFLAGS = \
95   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
96   -version-info 0:1:0
97
98 libexec_PROGRAMS = \
99  gnunet-service-namestore
100
101 bin_PROGRAMS = \
102  gnunet-namestore
103
104 if HAVE_MHD
105 libexec_PROGRAMS += \
106  gnunet-namestore-fcfsd
107 endif
108
109
110 gnunet_namestore_SOURCES = \
111  gnunet-namestore.c
112 gnunet_namestore_LDADD = \
113   $(top_builddir)/src/identity/libgnunetidentity.la \
114   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
115   $(top_builddir)/src/util/libgnunetutil.la \
116   libgnunetnamestore.la \
117   $(GN_LIBINTL)
118
119
120 gnunet_namestore_fcfsd_SOURCES = \
121  gnunet-namestore-fcfsd.c
122 gnunet_namestore_fcfsd_LDADD = -lmicrohttpd \
123   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
124   $(top_builddir)/src/identity/libgnunetidentity.la \
125   libgnunetnamestore.la \
126   $(top_builddir)/src/util/libgnunetutil.la \
127   $(GN_LIBINTL)
128
129
130
131 gnunet_service_namestore_SOURCES = \
132  gnunet-service-namestore.c
133
134 gnunet_service_namestore_LDADD = \
135   $(top_builddir)/src/namecache/libgnunetnamecache.la \
136   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
137   $(top_builddir)/src/statistics/libgnunetstatistics.la \
138   $(top_builddir)/src/util/libgnunetutil.la \
139   libgnunetnamestore.la \
140   $(GN_LIBINTL)
141
142
143 plugin_LTLIBRARIES = \
144   $(SQLITE_PLUGIN) \
145   $(POSTGRES_PLUGIN) \
146         $(FLAT_PLUGIN)
147
148 libgnunet_plugin_namestore_flat_la_SOURCES = \
149   plugin_namestore_flat.c
150 libgnunet_plugin_namestore_flat_la_LIBADD = \
151   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
152   $(top_builddir)/src/statistics/libgnunetstatistics.la \
153   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
154   $(LTLIBINTL)
155 libgnunet_plugin_namestore_flat_la_LDFLAGS = \
156  $(GN_PLUGIN_LDFLAGS)
157
158
159 libgnunet_plugin_namestore_sqlite_la_SOURCES = \
160   plugin_namestore_sqlite.c
161 libgnunet_plugin_namestore_sqlite_la_LIBADD = \
162   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
163   $(top_builddir)/src/statistics/libgnunetstatistics.la \
164   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
165   $(LTLIBINTL)
166 libgnunet_plugin_namestore_sqlite_la_LDFLAGS = \
167  $(GN_PLUGIN_LDFLAGS)
168
169 libgnunet_plugin_namestore_postgres_la_SOURCES = \
170   plugin_namestore_postgres.c
171 libgnunet_plugin_namestore_postgres_la_LIBADD = \
172   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
173   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
174   $(top_builddir)/src/statistics/libgnunetstatistics.la \
175   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq \
176   $(LTLIBINTL)
177 libgnunet_plugin_namestore_postgres_la_LDFLAGS = \
178  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
179
180 test_namestore_api_store_SOURCES = \
181  test_namestore_api_store.c
182 test_namestore_api_store_LDADD = \
183   $(top_builddir)/src/testing/libgnunettesting.la \
184   $(top_builddir)/src/util/libgnunetutil.la \
185   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
186   libgnunetnamestore.la
187
188 test_namestore_api_store_update_SOURCES = \
189  test_namestore_api_store_update.c
190 test_namestore_api_store_update_LDADD = \
191   $(top_builddir)/src/testing/libgnunettesting.la \
192   $(top_builddir)/src/util/libgnunetutil.la \
193   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
194   $(top_builddir)/src/namecache/libgnunetnamecache.la \
195   libgnunetnamestore.la
196
197 test_namestore_api_lookup_public_SOURCES = \
198  test_namestore_api_lookup_public.c
199 test_namestore_api_lookup_public_LDADD = \
200   $(top_builddir)/src/testing/libgnunettesting.la \
201   $(top_builddir)/src/util/libgnunetutil.la \
202   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
203   $(top_builddir)/src/namecache/libgnunetnamecache.la \
204   libgnunetnamestore.la
205
206 test_namestore_api_lookup_nick_SOURCES = \
207  test_namestore_api_lookup_nick.c
208 test_namestore_api_lookup_nick_LDADD = \
209   $(top_builddir)/src/testing/libgnunettesting.la \
210   $(top_builddir)/src/util/libgnunetutil.la \
211   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
212   $(top_builddir)/src/namecache/libgnunetnamecache.la \
213   libgnunetnamestore.la
214
215 test_namestore_api_lookup_private_SOURCES = \
216  test_namestore_api_lookup_private.c
217 test_namestore_api_lookup_private_LDADD = \
218   $(top_builddir)/src/testing/libgnunettesting.la \
219   $(top_builddir)/src/util/libgnunetutil.la \
220   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
221   $(top_builddir)/src/namecache/libgnunetnamecache.la \
222   libgnunetnamestore.la
223
224 test_namestore_api_lookup_shadow_SOURCES = \
225  test_namestore_api_lookup_shadow.c
226 test_namestore_api_lookup_shadow_LDADD = \
227   $(top_builddir)/src/testing/libgnunettesting.la \
228   $(top_builddir)/src/util/libgnunetutil.la \
229   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
230   $(top_builddir)/src/namecache/libgnunetnamecache.la \
231   libgnunetnamestore.la
232
233 test_namestore_api_lookup_shadow_filter_SOURCES = \
234  test_namestore_api_lookup_shadow_filter.c
235 test_namestore_api_lookup_shadow_filter_LDADD = \
236   $(top_builddir)/src/testing/libgnunettesting.la \
237   $(top_builddir)/src/util/libgnunetutil.la \
238   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
239   $(top_builddir)/src/namecache/libgnunetnamecache.la \
240   libgnunetnamestore.la
241
242 test_namestore_api_remove_SOURCES = \
243  test_namestore_api_remove.c
244 test_namestore_api_remove_LDADD = \
245   $(top_builddir)/src/testing/libgnunettesting.la \
246   $(top_builddir)/src/util/libgnunetutil.la \
247   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
248   libgnunetnamestore.la
249
250 test_namestore_api_remove_not_existing_record_SOURCES = \
251  test_namestore_api_remove_not_existing_record.c
252 test_namestore_api_remove_not_existing_record_LDADD = \
253   $(top_builddir)/src/testing/libgnunettesting.la \
254   $(top_builddir)/src/util/libgnunetutil.la \
255   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
256   libgnunetnamestore.la
257
258 #test_namestore_api_zone_to_name_SOURCES = \
259 # test_namestore_api_zone_to_name.c
260 #test_namestore_api_zone_to_name_LDADD = \
261 #  $(top_builddir)/src/testing/libgnunettesting.la \
262 #  $(top_builddir)/src/util/libgnunetutil.la \
263 #  libgnunetnamestore.la
264
265 test_namestore_api_monitoring_SOURCES = \
266  test_namestore_api_monitoring.c
267 test_namestore_api_monitoring_LDADD = \
268   $(top_builddir)/src/testing/libgnunettesting.la \
269   libgnunetnamestore.la \
270   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
271   $(top_builddir)/src/util/libgnunetutil.la
272
273 test_namestore_api_monitoring_existing_SOURCES = \
274  test_namestore_api_monitoring_existing.c
275 test_namestore_api_monitoring_existing_LDADD = \
276   $(top_builddir)/src/testing/libgnunettesting.la \
277   libgnunetnamestore.la \
278   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
279   $(top_builddir)/src/util/libgnunetutil.la
280
281 test_namestore_api_zone_iteration_SOURCES = \
282  test_namestore_api_zone_iteration.c
283 test_namestore_api_zone_iteration_LDADD = \
284   $(top_builddir)/src/testing/libgnunettesting.la \
285   $(top_builddir)/src/util/libgnunetutil.la \
286   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
287   libgnunetnamestore.la
288
289 test_namestore_api_zone_iteration_nick_SOURCES = \
290  test_namestore_api_zone_iteration_nick.c
291 test_namestore_api_zone_iteration_nick_LDADD = \
292   $(top_builddir)/src/testing/libgnunettesting.la \
293   $(top_builddir)/src/util/libgnunetutil.la \
294   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
295   libgnunetnamestore.la
296
297
298 test_namestore_api_zone_iteration_specific_zone_SOURCES = \
299  test_namestore_api_zone_iteration_specific_zone.c
300 test_namestore_api_zone_iteration_specific_zone_LDADD = \
301   $(top_builddir)/src/testing/libgnunettesting.la \
302   $(top_builddir)/src/util/libgnunetutil.la \
303   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
304   libgnunetnamestore.la
305
306 test_namestore_api_zone_iteration_stop_SOURCES = \
307  test_namestore_api_zone_iteration_stop.c
308 test_namestore_api_zone_iteration_stop_LDADD = \
309   $(top_builddir)/src/testing/libgnunettesting.la \
310   $(top_builddir)/src/util/libgnunetutil.la \
311   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
312   libgnunetnamestore.la
313
314 test_plugin_namestore_flat_SOURCES = \
315  test_plugin_namestore.c
316 test_plugin_namestore_flat_LDADD = \
317  $(top_builddir)/src/testing/libgnunettesting.la \
318  $(top_builddir)/src/util/libgnunetutil.la
319
320 test_plugin_namestore_sqlite_SOURCES = \
321  test_plugin_namestore.c
322 test_plugin_namestore_sqlite_LDADD = \
323  $(top_builddir)/src/testing/libgnunettesting.la \
324  $(top_builddir)/src/util/libgnunetutil.la
325
326 test_plugin_namestore_postgres_SOURCES = \
327  test_plugin_namestore.c
328 test_plugin_namestore_postgres_LDADD = \
329  $(top_builddir)/src/testing/libgnunettesting.la \
330  $(top_builddir)/src/util/libgnunetutil.la
331
332 check_SCRIPTS = \
333         test_namestore_put.sh \
334         test_namestore_lookup.sh \
335         test_namestore_delete.sh
336
337 EXTRA_DIST = \
338   test_namestore_api.conf \
339   test_plugin_namestore_sqlite.conf \
340   test_plugin_namestore_postgres.conf \
341         test_plugin_namestore_flat.conf \
342   test_hostkey \
343   zonefiles/S5I9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey \
344   zonefiles/AQ835GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey \
345   zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey \
346   zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey \
347   $(check_SCRIPTS)
348