clean up zone iteration logic
[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.nc \
49  test_namestore_api_store_update.nc \
50  test_namestore_api_lookup_public.nc \
51  test_namestore_api_lookup_private.nc \
52  test_namestore_api_lookup_nick.nc \
53  test_namestore_api_lookup_shadow.nc \
54  test_namestore_api_lookup_shadow_filter.nc \
55  test_namestore_api_remove.nc \
56  test_namestore_api_remove_not_existing_record.nc \
57  test_namestore_api_zone_iteration.nc \
58  test_namestore_api_zone_iteration_nick.nc \
59  test_namestore_api_zone_iteration_specific_zone.nc \
60  test_namestore_api_zone_iteration_stop.nc \
61  test_namestore_api_monitoring.nc \
62  test_namestore_api_monitoring_existing.nc \
63  test_namestore_api_zone_to_name
64 endif
65
66 # Declare .nc (NO-CONCURRENCY) as a test extension so that we can impart
67 # sequential execution order for them
68 TEST_EXTENSIONS = .nc
69 test_namestore_api_store.log: test_namestore_api_store_update.log
70 test_namestore_api_store_update.log: test_namestore_api_lookup_public.log
71 test_namestore_api_lookup_public.log: test_namestore_api_lookup_private.log
72 test_namestore_api_lookup_private.log: test_namestore_api_lookup_nick.log
73 test_namestore_api_lookup_nick.log: test_namestore_api_lookup_shadow.log
74 test_namestore_api_lookup_shadow.log: test_namestore_api_lookup_shadow_filter.log
75 test_namestore_api_lookup_shadow_filter.log: test_namestore_api_remove.log
76 test_namestore_api_remove.log: test_namestore_api_remove_not_existing_record.log
77 test_namestore_api_remove_not_existing_record.log: test_namestore_api_zone_iteration.log
78 test_namestore_api_zone_iteration.log: test_namestore_api_zone_iteration_nick.log
79 test_namestore_api_zone_iteration_nick.log: test_namestore_api_zone_iteration_specific_zone.log
80 test_namestore_api_zone_iteration_specific_zone.log: test_namestore_api_zone_iteration_stop.log
81 test_namestore_api_zone_iteration_stop.log: test_namestore_api_monitoring.log
82 test_namestore_api_monitoring.log: test_namestore_api_monitoring_existing.log
83
84
85 if HAVE_SQLITE
86 check_PROGRAMS = \
87  $(SQLITE_TESTS) \
88  $(POSTGRES_TESTS) \
89  $(FLAT_TESTS) \
90  $(TESTING_TESTS)
91 endif
92
93 if HAVE_MHD
94 if HAVE_JSON
95 REST_PLUGIN=libgnunet_plugin_rest_namestore.la
96 endif
97 endif
98
99 if ENABLE_TEST_RUN
100 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
101 TESTS = \
102   $(check_PROGRAMS) \
103   $(check_SCRIPTS)
104 endif
105
106 lib_LTLIBRARIES = \
107   libgnunetnamestore.la
108
109
110 libgnunetnamestore_la_SOURCES = \
111   namestore_api.c \
112   namestore_api_monitor.c \
113   namestore.h
114 libgnunetnamestore_la_LIBADD = \
115   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
116   $(top_builddir)/src/statistics/libgnunetstatistics.la \
117   $(top_builddir)/src/util/libgnunetutil.la \
118   $(GN_LIBINTL)
119 libgnunetnamestore_la_LDFLAGS = \
120   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
121   -version-info 0:1:0
122
123 libexec_PROGRAMS = \
124  gnunet-service-namestore
125
126 bin_PROGRAMS = \
127  gnunet-namestore \
128  gnunet-zoneimport
129
130 if HAVE_MHD
131 libexec_PROGRAMS += \
132  gnunet-namestore-fcfsd
133 endif
134
135
136 gnunet_zoneimport_SOURCES = \
137  gnunet-zoneimport.c
138 gnunet_zoneimport_LDADD = \
139   libgnunetnamestore.la \
140   $(top_builddir)/src/identity/libgnunetidentity.la \
141   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
142   $(top_builddir)/src/dns/libgnunetdnsparser.la \
143   $(top_builddir)/src/dns/libgnunetdnsstub.la \
144   $(top_builddir)/src/util/libgnunetutil.la \
145   $(GN_LIBINTL)
146
147 gnunet_namestore_SOURCES = \
148  gnunet-namestore.c
149 gnunet_namestore_LDADD = \
150   $(top_builddir)/src/identity/libgnunetidentity.la \
151   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
152   $(top_builddir)/src/util/libgnunetutil.la \
153   libgnunetnamestore.la \
154   $(GN_LIBINTL)
155
156
157 gnunet_namestore_fcfsd_SOURCES = \
158  gnunet-namestore-fcfsd.c
159 gnunet_namestore_fcfsd_LDADD = -lmicrohttpd \
160   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
161   $(top_builddir)/src/identity/libgnunetidentity.la \
162   libgnunetnamestore.la \
163   $(top_builddir)/src/util/libgnunetutil.la \
164   $(GN_LIBINTL)
165
166
167
168 gnunet_service_namestore_SOURCES = \
169  gnunet-service-namestore.c
170
171 gnunet_service_namestore_LDADD = \
172   $(top_builddir)/src/namecache/libgnunetnamecache.la \
173   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
174   $(top_builddir)/src/statistics/libgnunetstatistics.la \
175   $(top_builddir)/src/util/libgnunetutil.la \
176   libgnunetnamestore.la \
177   $(GN_LIBINTL)
178
179
180 plugin_LTLIBRARIES = \
181   $(SQLITE_PLUGIN) \
182   $(POSTGRES_PLUGIN) \
183         $(FLAT_PLUGIN) \
184         $(REST_PLUGIN)
185
186
187
188 libgnunet_plugin_namestore_flat_la_SOURCES = \
189   plugin_namestore_flat.c
190 libgnunet_plugin_namestore_flat_la_LIBADD = \
191   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
192   $(top_builddir)/src/statistics/libgnunetstatistics.la \
193   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
194   $(LTLIBINTL)
195 libgnunet_plugin_namestore_flat_la_LDFLAGS = \
196  $(GN_PLUGIN_LDFLAGS)
197
198
199 libgnunet_plugin_namestore_sqlite_la_SOURCES = \
200   plugin_namestore_sqlite.c
201 libgnunet_plugin_namestore_sqlite_la_LIBADD = \
202   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
203   $(top_builddir)/src/sq/libgnunetsq.la \
204   $(top_builddir)/src/statistics/libgnunetstatistics.la \
205   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
206   $(LTLIBINTL)
207 libgnunet_plugin_namestore_sqlite_la_LDFLAGS = \
208  $(GN_PLUGIN_LDFLAGS)
209
210 libgnunet_plugin_namestore_postgres_la_SOURCES = \
211   plugin_namestore_postgres.c
212 libgnunet_plugin_namestore_postgres_la_LIBADD = \
213   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
214   $(top_builddir)/src/pq/libgnunetpq.la  \
215   $(top_builddir)/src/statistics/libgnunetstatistics.la \
216   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq \
217   $(LTLIBINTL)
218 libgnunet_plugin_namestore_postgres_la_LDFLAGS = \
219  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
220
221 libgnunet_plugin_rest_namestore_la_SOURCES = \
222   plugin_rest_namestore.c
223 libgnunet_plugin_rest_namestore_la_LIBADD = \
224   libgnunetnamestore.la \
225   $(top_builddir)/src/rest/libgnunetrest.la \
226   $(top_builddir)/src/identity/libgnunetidentity.la \
227         $(top_builddir)/src/jsonapi/libgnunetjsonapi.la \
228   $(top_builddir)/src/jsonapi/libgnunetjsonapiutils.la \
229   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
230   $(LTLIBINTL) -ljansson -lmicrohttpd
231 libgnunet_plugin_rest_namestore_la_LDFLAGS = \
232  $(GN_PLUGIN_LDFLAGS)
233
234
235 test_namestore_api_store_nc_SOURCES = \
236  test_namestore_api_store.c
237 test_namestore_api_store_nc_LDADD = \
238   $(top_builddir)/src/testing/libgnunettesting.la \
239   $(top_builddir)/src/util/libgnunetutil.la \
240   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
241   libgnunetnamestore.la
242
243 test_namestore_api_store_update_nc_SOURCES = \
244  test_namestore_api_store_update.c
245 test_namestore_api_store_update_nc_LDADD = \
246   $(top_builddir)/src/testing/libgnunettesting.la \
247   $(top_builddir)/src/util/libgnunetutil.la \
248   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
249   $(top_builddir)/src/namecache/libgnunetnamecache.la \
250   libgnunetnamestore.la
251
252 test_namestore_api_lookup_public_nc_SOURCES = \
253  test_namestore_api_lookup_public.c
254 test_namestore_api_lookup_public_nc_LDADD = \
255   $(top_builddir)/src/testing/libgnunettesting.la \
256   $(top_builddir)/src/util/libgnunetutil.la \
257   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
258   $(top_builddir)/src/namecache/libgnunetnamecache.la \
259   libgnunetnamestore.la
260
261 test_namestore_api_lookup_nick_nc_SOURCES = \
262  test_namestore_api_lookup_nick.c
263 test_namestore_api_lookup_nick_nc_LDADD = \
264   $(top_builddir)/src/testing/libgnunettesting.la \
265   $(top_builddir)/src/util/libgnunetutil.la \
266   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
267   $(top_builddir)/src/namecache/libgnunetnamecache.la \
268   libgnunetnamestore.la
269
270 test_namestore_api_lookup_private_nc_SOURCES = \
271  test_namestore_api_lookup_private.c
272 test_namestore_api_lookup_private_nc_LDADD = \
273   $(top_builddir)/src/testing/libgnunettesting.la \
274   $(top_builddir)/src/util/libgnunetutil.la \
275   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
276   $(top_builddir)/src/namecache/libgnunetnamecache.la \
277   libgnunetnamestore.la
278
279 test_namestore_api_lookup_shadow_nc_SOURCES = \
280  test_namestore_api_lookup_shadow.c
281 test_namestore_api_lookup_shadow_nc_LDADD = \
282   $(top_builddir)/src/testing/libgnunettesting.la \
283   $(top_builddir)/src/util/libgnunetutil.la \
284   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
285   $(top_builddir)/src/namecache/libgnunetnamecache.la \
286   libgnunetnamestore.la
287
288 test_namestore_api_lookup_shadow_filter_nc_SOURCES = \
289  test_namestore_api_lookup_shadow_filter.c
290 test_namestore_api_lookup_shadow_filter_nc_LDADD = \
291   $(top_builddir)/src/testing/libgnunettesting.la \
292   $(top_builddir)/src/util/libgnunetutil.la \
293   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
294   $(top_builddir)/src/namecache/libgnunetnamecache.la \
295   libgnunetnamestore.la
296
297 test_namestore_api_remove_nc_SOURCES = \
298  test_namestore_api_remove.c
299 test_namestore_api_remove_nc_LDADD = \
300   $(top_builddir)/src/testing/libgnunettesting.la \
301   $(top_builddir)/src/util/libgnunetutil.la \
302   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
303   libgnunetnamestore.la
304
305 test_namestore_api_remove_not_existing_record_nc_SOURCES = \
306  test_namestore_api_remove_not_existing_record.c
307 test_namestore_api_remove_not_existing_record_nc_LDADD = \
308   $(top_builddir)/src/testing/libgnunettesting.la \
309   $(top_builddir)/src/util/libgnunetutil.la \
310   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
311   libgnunetnamestore.la
312
313 test_namestore_api_zone_to_name_SOURCES = \
314  test_namestore_api_zone_to_name.c
315 test_namestore_api_zone_to_name_LDADD = \
316   $(top_builddir)/src/testing/libgnunettesting.la \
317   $(top_builddir)/src/util/libgnunetutil.la \
318   libgnunetnamestore.la
319
320 test_namestore_api_monitoring_nc_SOURCES = \
321  test_namestore_api_monitoring.c
322 test_namestore_api_monitoring_nc_LDADD = \
323   $(top_builddir)/src/testing/libgnunettesting.la \
324   libgnunetnamestore.la \
325   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
326   $(top_builddir)/src/util/libgnunetutil.la
327
328 test_namestore_api_monitoring_existing_nc_SOURCES = \
329  test_namestore_api_monitoring_existing.c
330 test_namestore_api_monitoring_existing_nc_LDADD = \
331   $(top_builddir)/src/testing/libgnunettesting.la \
332   libgnunetnamestore.la \
333   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
334   $(top_builddir)/src/util/libgnunetutil.la
335
336 test_namestore_api_zone_iteration_nc_SOURCES = \
337  test_namestore_api_zone_iteration.c
338 test_namestore_api_zone_iteration_nc_LDADD = \
339   $(top_builddir)/src/testing/libgnunettesting.la \
340   $(top_builddir)/src/util/libgnunetutil.la \
341   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
342   libgnunetnamestore.la
343
344 test_namestore_api_zone_iteration_nick_nc_SOURCES = \
345  test_namestore_api_zone_iteration_nick.c
346 test_namestore_api_zone_iteration_nick_nc_LDADD = \
347   $(top_builddir)/src/testing/libgnunettesting.la \
348   $(top_builddir)/src/util/libgnunetutil.la \
349   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
350   libgnunetnamestore.la
351
352
353 test_namestore_api_zone_iteration_specific_zone_nc_SOURCES = \
354  test_namestore_api_zone_iteration_specific_zone.c
355 test_namestore_api_zone_iteration_specific_zone_nc_LDADD = \
356   $(top_builddir)/src/testing/libgnunettesting.la \
357   $(top_builddir)/src/util/libgnunetutil.la \
358   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
359   libgnunetnamestore.la
360
361 test_namestore_api_zone_iteration_stop_nc_SOURCES = \
362  test_namestore_api_zone_iteration_stop.c
363 test_namestore_api_zone_iteration_stop_nc_LDADD = \
364   $(top_builddir)/src/testing/libgnunettesting.la \
365   $(top_builddir)/src/util/libgnunetutil.la \
366   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
367   libgnunetnamestore.la
368
369 test_plugin_namestore_flat_SOURCES = \
370  test_plugin_namestore.c
371 test_plugin_namestore_flat_LDADD = \
372  $(top_builddir)/src/testing/libgnunettesting.la \
373  $(top_builddir)/src/util/libgnunetutil.la
374
375 test_plugin_namestore_sqlite_SOURCES = \
376  test_plugin_namestore.c
377 test_plugin_namestore_sqlite_LDADD = \
378  $(top_builddir)/src/testing/libgnunettesting.la \
379  $(top_builddir)/src/util/libgnunetutil.la
380
381 test_plugin_namestore_postgres_SOURCES = \
382  test_plugin_namestore.c
383 test_plugin_namestore_postgres_LDADD = \
384  $(top_builddir)/src/testing/libgnunettesting.la \
385  $(top_builddir)/src/util/libgnunetutil.la
386
387 check_SCRIPTS = \
388   test_namestore_put.sh \
389   test_namestore_lookup.sh \
390   test_namestore_delete.sh
391
392 EXTRA_DIST = \
393   test_namestore_api.conf \
394   test_plugin_namestore_sqlite.conf \
395   test_plugin_namestore_postgres.conf \
396   test_plugin_namestore_flat.conf \
397   test_hostkey \
398   zonefiles/S5I9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey \
399   zonefiles/AQ835GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey \
400   zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey \
401   zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey \
402   $(check_SCRIPTS)