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