Merge branch 'master' of gnunet.org:gnunet
[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/dns/libgnunetdnsparser.la \
118   $(top_builddir)/src/util/libgnunetutil.la \
119   $(GN_LIBINTL)
120 libgnunetnamestore_la_LDFLAGS = \
121   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
122   -version-info 0:1:0
123
124 libexec_PROGRAMS = \
125  gnunet-service-namestore
126
127 bin_PROGRAMS = \
128  gnunet-namestore
129
130 if HAVE_MHD
131 libexec_PROGRAMS += \
132  gnunet-namestore-fcfsd
133 endif
134
135
136 gnunet_namestore_SOURCES = \
137  gnunet-namestore.c
138 gnunet_namestore_LDADD = \
139   $(top_builddir)/src/identity/libgnunetidentity.la \
140   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
141   $(top_builddir)/src/util/libgnunetutil.la \
142   libgnunetnamestore.la \
143   $(GN_LIBINTL)
144
145
146 gnunet_namestore_fcfsd_SOURCES = \
147  gnunet-namestore-fcfsd.c
148 gnunet_namestore_fcfsd_LDADD = -lmicrohttpd \
149   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
150   $(top_builddir)/src/identity/libgnunetidentity.la \
151   libgnunetnamestore.la \
152   $(top_builddir)/src/util/libgnunetutil.la \
153   $(GN_LIBINTL)
154
155
156
157 gnunet_service_namestore_SOURCES = \
158  gnunet-service-namestore.c
159
160 gnunet_service_namestore_LDADD = \
161   $(top_builddir)/src/namecache/libgnunetnamecache.la \
162   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
163   $(top_builddir)/src/statistics/libgnunetstatistics.la \
164   $(top_builddir)/src/util/libgnunetutil.la \
165   libgnunetnamestore.la \
166   $(GN_LIBINTL)
167
168
169 plugin_LTLIBRARIES = \
170   $(SQLITE_PLUGIN) \
171   $(POSTGRES_PLUGIN) \
172         $(FLAT_PLUGIN) \
173         $(REST_PLUGIN)
174
175
176
177 libgnunet_plugin_namestore_flat_la_SOURCES = \
178   plugin_namestore_flat.c
179 libgnunet_plugin_namestore_flat_la_LIBADD = \
180   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
181   $(top_builddir)/src/statistics/libgnunetstatistics.la \
182   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
183   $(LTLIBINTL)
184 libgnunet_plugin_namestore_flat_la_LDFLAGS = \
185  $(GN_PLUGIN_LDFLAGS)
186
187
188 libgnunet_plugin_namestore_sqlite_la_SOURCES = \
189   plugin_namestore_sqlite.c
190 libgnunet_plugin_namestore_sqlite_la_LIBADD = \
191   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
192   $(top_builddir)/src/statistics/libgnunetstatistics.la \
193   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
194   $(LTLIBINTL)
195 libgnunet_plugin_namestore_sqlite_la_LDFLAGS = \
196  $(GN_PLUGIN_LDFLAGS)
197
198 libgnunet_plugin_namestore_postgres_la_SOURCES = \
199   plugin_namestore_postgres.c
200 libgnunet_plugin_namestore_postgres_la_LIBADD = \
201   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
202   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
203   $(top_builddir)/src/pq/libgnunetpq.la  \
204   $(top_builddir)/src/statistics/libgnunetstatistics.la \
205   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq \
206   $(LTLIBINTL)
207 libgnunet_plugin_namestore_postgres_la_LDFLAGS = \
208  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
209
210 libgnunet_plugin_rest_namestore_la_SOURCES = \
211   plugin_rest_namestore.c
212 libgnunet_plugin_rest_namestore_la_LIBADD = \
213   libgnunetnamestore.la \
214   $(top_builddir)/src/rest/libgnunetrest.la \
215   $(top_builddir)/src/identity/libgnunetidentity.la \
216         $(top_builddir)/src/jsonapi/libgnunetjsonapi.la \
217   $(top_builddir)/src/jsonapi/libgnunetjsonapiutils.la \
218   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
219   $(LTLIBINTL) -ljansson -lmicrohttpd
220 libgnunet_plugin_rest_namestore_la_LDFLAGS = \
221  $(GN_PLUGIN_LDFLAGS)
222
223
224 test_namestore_api_store_nc_SOURCES = \
225  test_namestore_api_store.c
226 test_namestore_api_store_nc_LDADD = \
227   $(top_builddir)/src/testing/libgnunettesting.la \
228   $(top_builddir)/src/util/libgnunetutil.la \
229   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
230   libgnunetnamestore.la
231
232 test_namestore_api_store_update_nc_SOURCES = \
233  test_namestore_api_store_update.c
234 test_namestore_api_store_update_nc_LDADD = \
235   $(top_builddir)/src/testing/libgnunettesting.la \
236   $(top_builddir)/src/util/libgnunetutil.la \
237   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
238   $(top_builddir)/src/namecache/libgnunetnamecache.la \
239   libgnunetnamestore.la
240
241 test_namestore_api_lookup_public_nc_SOURCES = \
242  test_namestore_api_lookup_public.c
243 test_namestore_api_lookup_public_nc_LDADD = \
244   $(top_builddir)/src/testing/libgnunettesting.la \
245   $(top_builddir)/src/util/libgnunetutil.la \
246   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
247   $(top_builddir)/src/namecache/libgnunetnamecache.la \
248   libgnunetnamestore.la
249
250 test_namestore_api_lookup_nick_nc_SOURCES = \
251  test_namestore_api_lookup_nick.c
252 test_namestore_api_lookup_nick_nc_LDADD = \
253   $(top_builddir)/src/testing/libgnunettesting.la \
254   $(top_builddir)/src/util/libgnunetutil.la \
255   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
256   $(top_builddir)/src/namecache/libgnunetnamecache.la \
257   libgnunetnamestore.la
258
259 test_namestore_api_lookup_private_nc_SOURCES = \
260  test_namestore_api_lookup_private.c
261 test_namestore_api_lookup_private_nc_LDADD = \
262   $(top_builddir)/src/testing/libgnunettesting.la \
263   $(top_builddir)/src/util/libgnunetutil.la \
264   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
265   $(top_builddir)/src/namecache/libgnunetnamecache.la \
266   libgnunetnamestore.la
267
268 test_namestore_api_lookup_shadow_nc_SOURCES = \
269  test_namestore_api_lookup_shadow.c
270 test_namestore_api_lookup_shadow_nc_LDADD = \
271   $(top_builddir)/src/testing/libgnunettesting.la \
272   $(top_builddir)/src/util/libgnunetutil.la \
273   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
274   $(top_builddir)/src/namecache/libgnunetnamecache.la \
275   libgnunetnamestore.la
276
277 test_namestore_api_lookup_shadow_filter_nc_SOURCES = \
278  test_namestore_api_lookup_shadow_filter.c
279 test_namestore_api_lookup_shadow_filter_nc_LDADD = \
280   $(top_builddir)/src/testing/libgnunettesting.la \
281   $(top_builddir)/src/util/libgnunetutil.la \
282   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
283   $(top_builddir)/src/namecache/libgnunetnamecache.la \
284   libgnunetnamestore.la
285
286 test_namestore_api_remove_nc_SOURCES = \
287  test_namestore_api_remove.c
288 test_namestore_api_remove_nc_LDADD = \
289   $(top_builddir)/src/testing/libgnunettesting.la \
290   $(top_builddir)/src/util/libgnunetutil.la \
291   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
292   libgnunetnamestore.la
293
294 test_namestore_api_remove_not_existing_record_nc_SOURCES = \
295  test_namestore_api_remove_not_existing_record.c
296 test_namestore_api_remove_not_existing_record_nc_LDADD = \
297   $(top_builddir)/src/testing/libgnunettesting.la \
298   $(top_builddir)/src/util/libgnunetutil.la \
299   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
300   libgnunetnamestore.la
301
302 #test_namestore_api_zone_to_name_SOURCES = \
303 # test_namestore_api_zone_to_name.c
304 #test_namestore_api_zone_to_name_LDADD = \
305 #  $(top_builddir)/src/testing/libgnunettesting.la \
306 #  $(top_builddir)/src/util/libgnunetutil.la \
307 #  libgnunetnamestore.la
308
309 test_namestore_api_monitoring_nc_SOURCES = \
310  test_namestore_api_monitoring.c
311 test_namestore_api_monitoring_nc_LDADD = \
312   $(top_builddir)/src/testing/libgnunettesting.la \
313   libgnunetnamestore.la \
314   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
315   $(top_builddir)/src/util/libgnunetutil.la
316
317 test_namestore_api_monitoring_existing_nc_SOURCES = \
318  test_namestore_api_monitoring_existing.c
319 test_namestore_api_monitoring_existing_nc_LDADD = \
320   $(top_builddir)/src/testing/libgnunettesting.la \
321   libgnunetnamestore.la \
322   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
323   $(top_builddir)/src/util/libgnunetutil.la
324
325 test_namestore_api_zone_iteration_nc_SOURCES = \
326  test_namestore_api_zone_iteration.c
327 test_namestore_api_zone_iteration_nc_LDADD = \
328   $(top_builddir)/src/testing/libgnunettesting.la \
329   $(top_builddir)/src/util/libgnunetutil.la \
330   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
331   libgnunetnamestore.la
332
333 test_namestore_api_zone_iteration_nick_nc_SOURCES = \
334  test_namestore_api_zone_iteration_nick.c
335 test_namestore_api_zone_iteration_nick_nc_LDADD = \
336   $(top_builddir)/src/testing/libgnunettesting.la \
337   $(top_builddir)/src/util/libgnunetutil.la \
338   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
339   libgnunetnamestore.la
340
341
342 test_namestore_api_zone_iteration_specific_zone_nc_SOURCES = \
343  test_namestore_api_zone_iteration_specific_zone.c
344 test_namestore_api_zone_iteration_specific_zone_nc_LDADD = \
345   $(top_builddir)/src/testing/libgnunettesting.la \
346   $(top_builddir)/src/util/libgnunetutil.la \
347   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
348   libgnunetnamestore.la
349
350 test_namestore_api_zone_iteration_stop_nc_SOURCES = \
351  test_namestore_api_zone_iteration_stop.c
352 test_namestore_api_zone_iteration_stop_nc_LDADD = \
353   $(top_builddir)/src/testing/libgnunettesting.la \
354   $(top_builddir)/src/util/libgnunetutil.la \
355   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
356   libgnunetnamestore.la
357
358 test_plugin_namestore_flat_SOURCES = \
359  test_plugin_namestore.c
360 test_plugin_namestore_flat_LDADD = \
361  $(top_builddir)/src/testing/libgnunettesting.la \
362  $(top_builddir)/src/util/libgnunetutil.la
363
364 test_plugin_namestore_sqlite_SOURCES = \
365  test_plugin_namestore.c
366 test_plugin_namestore_sqlite_LDADD = \
367  $(top_builddir)/src/testing/libgnunettesting.la \
368  $(top_builddir)/src/util/libgnunetutil.la
369
370 test_plugin_namestore_postgres_SOURCES = \
371  test_plugin_namestore.c
372 test_plugin_namestore_postgres_LDADD = \
373  $(top_builddir)/src/testing/libgnunettesting.la \
374  $(top_builddir)/src/util/libgnunetutil.la
375
376 check_SCRIPTS = \
377   test_namestore_put.sh \
378   test_namestore_lookup.sh \
379   test_namestore_delete.sh
380
381 EXTRA_DIST = \
382   test_namestore_api.conf \
383   test_plugin_namestore_sqlite.conf \
384   test_plugin_namestore_postgres.conf \
385   test_plugin_namestore_flat.conf \
386   test_hostkey \
387   zonefiles/S5I9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey \
388   zonefiles/AQ835GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey \
389   zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey \
390   zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey \
391   $(check_SCRIPTS)