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