-bringing copyright tags up to FSF standard
[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 gnunet_namestore_SOURCES = \
102  gnunet-namestore.c
103 gnunet_namestore_LDADD = \
104   $(top_builddir)/src/identity/libgnunetidentity.la \
105   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
106   $(top_builddir)/src/util/libgnunetutil.la \
107   libgnunetnamestore.la \
108   $(GN_LIBINTL)
109
110
111 gnunet_namestore_fcfsd_SOURCES = \
112  gnunet-namestore-fcfsd.c
113 gnunet_namestore_fcfsd_LDADD = -lmicrohttpd \
114   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
115   $(top_builddir)/src/identity/libgnunetidentity.la \
116   libgnunetnamestore.la \
117   $(top_builddir)/src/util/libgnunetutil.la \
118   $(GN_LIBINTL)
119
120
121
122 gnunet_service_namestore_SOURCES = \
123  gnunet-service-namestore.c
124
125 gnunet_service_namestore_LDADD = \
126   $(top_builddir)/src/namecache/libgnunetnamecache.la \
127   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
128   $(top_builddir)/src/statistics/libgnunetstatistics.la \
129   $(top_builddir)/src/util/libgnunetutil.la \
130   libgnunetnamestore.la \
131   $(GN_LIBINTL)
132
133
134 plugin_LTLIBRARIES = \
135   $(SQLITE_PLUGIN) \
136   $(POSTGRES_PLUGIN)
137
138 libgnunet_plugin_namestore_sqlite_la_SOURCES = \
139   plugin_namestore_sqlite.c
140 libgnunet_plugin_namestore_sqlite_la_LIBADD = \
141   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
142   $(top_builddir)/src/statistics/libgnunetstatistics.la \
143   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
144   $(LTLIBINTL)
145 libgnunet_plugin_namestore_sqlite_la_LDFLAGS = \
146  $(GN_PLUGIN_LDFLAGS)
147
148 libgnunet_plugin_namestore_postgres_la_SOURCES = \
149   plugin_namestore_postgres.c
150 libgnunet_plugin_namestore_postgres_la_LIBADD = \
151   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
152   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
153   $(top_builddir)/src/statistics/libgnunetstatistics.la \
154   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq \
155   $(LTLIBINTL)
156 libgnunet_plugin_namestore_postgres_la_LDFLAGS = \
157  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
158
159 test_namestore_api_store_SOURCES = \
160  test_namestore_api_store.c
161 test_namestore_api_store_LDADD = \
162   $(top_builddir)/src/testing/libgnunettesting.la \
163   $(top_builddir)/src/util/libgnunetutil.la \
164   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
165   libgnunetnamestore.la
166
167 test_namestore_api_store_update_SOURCES = \
168  test_namestore_api_store_update.c
169 test_namestore_api_store_update_LDADD = \
170   $(top_builddir)/src/testing/libgnunettesting.la \
171   $(top_builddir)/src/util/libgnunetutil.la \
172   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
173   $(top_builddir)/src/namecache/libgnunetnamecache.la \
174   libgnunetnamestore.la
175
176 test_namestore_api_lookup_public_SOURCES = \
177  test_namestore_api_lookup_public.c
178 test_namestore_api_lookup_public_LDADD = \
179   $(top_builddir)/src/testing/libgnunettesting.la \
180   $(top_builddir)/src/util/libgnunetutil.la \
181   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
182   $(top_builddir)/src/namecache/libgnunetnamecache.la \
183   libgnunetnamestore.la
184
185 test_namestore_api_lookup_nick_SOURCES = \
186  test_namestore_api_lookup_nick.c
187 test_namestore_api_lookup_nick_LDADD = \
188   $(top_builddir)/src/testing/libgnunettesting.la \
189   $(top_builddir)/src/util/libgnunetutil.la \
190   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
191   $(top_builddir)/src/namecache/libgnunetnamecache.la \
192   libgnunetnamestore.la
193
194 test_namestore_api_lookup_private_SOURCES = \
195  test_namestore_api_lookup_private.c
196 test_namestore_api_lookup_private_LDADD = \
197   $(top_builddir)/src/testing/libgnunettesting.la \
198   $(top_builddir)/src/util/libgnunetutil.la \
199   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
200   $(top_builddir)/src/namecache/libgnunetnamecache.la \
201   libgnunetnamestore.la
202
203 test_namestore_api_lookup_shadow_SOURCES = \
204  test_namestore_api_lookup_shadow.c
205 test_namestore_api_lookup_shadow_LDADD = \
206   $(top_builddir)/src/testing/libgnunettesting.la \
207   $(top_builddir)/src/util/libgnunetutil.la \
208   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
209   $(top_builddir)/src/namecache/libgnunetnamecache.la \
210   libgnunetnamestore.la
211
212 test_namestore_api_lookup_shadow_filter_SOURCES = \
213  test_namestore_api_lookup_shadow_filter.c
214 test_namestore_api_lookup_shadow_filter_LDADD = \
215   $(top_builddir)/src/testing/libgnunettesting.la \
216   $(top_builddir)/src/util/libgnunetutil.la \
217   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
218   $(top_builddir)/src/namecache/libgnunetnamecache.la \
219   libgnunetnamestore.la
220
221 test_namestore_api_remove_SOURCES = \
222  test_namestore_api_remove.c
223 test_namestore_api_remove_LDADD = \
224   $(top_builddir)/src/testing/libgnunettesting.la \
225   $(top_builddir)/src/util/libgnunetutil.la \
226   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
227   libgnunetnamestore.la
228
229 test_namestore_api_remove_not_existing_record_SOURCES = \
230  test_namestore_api_remove_not_existing_record.c
231 test_namestore_api_remove_not_existing_record_LDADD = \
232   $(top_builddir)/src/testing/libgnunettesting.la \
233   $(top_builddir)/src/util/libgnunetutil.la \
234   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
235   libgnunetnamestore.la
236
237 #test_namestore_api_zone_to_name_SOURCES = \
238 # test_namestore_api_zone_to_name.c
239 #test_namestore_api_zone_to_name_LDADD = \
240 #  $(top_builddir)/src/testing/libgnunettesting.la \
241 #  $(top_builddir)/src/util/libgnunetutil.la \
242 #  libgnunetnamestore.la
243
244 test_namestore_api_monitoring_SOURCES = \
245  test_namestore_api_monitoring.c
246 test_namestore_api_monitoring_LDADD = \
247   $(top_builddir)/src/testing/libgnunettesting.la \
248   libgnunetnamestore.la \
249   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
250   $(top_builddir)/src/util/libgnunetutil.la
251
252 test_namestore_api_monitoring_existing_SOURCES = \
253  test_namestore_api_monitoring_existing.c
254 test_namestore_api_monitoring_existing_LDADD = \
255   $(top_builddir)/src/testing/libgnunettesting.la \
256   libgnunetnamestore.la \
257   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
258   $(top_builddir)/src/util/libgnunetutil.la
259
260 test_namestore_api_zone_iteration_SOURCES = \
261  test_namestore_api_zone_iteration.c
262 test_namestore_api_zone_iteration_LDADD = \
263   $(top_builddir)/src/testing/libgnunettesting.la \
264   $(top_builddir)/src/util/libgnunetutil.la \
265   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
266   libgnunetnamestore.la
267
268 test_namestore_api_zone_iteration_nick_SOURCES = \
269  test_namestore_api_zone_iteration_nick.c
270 test_namestore_api_zone_iteration_nick_LDADD = \
271   $(top_builddir)/src/testing/libgnunettesting.la \
272   $(top_builddir)/src/util/libgnunetutil.la \
273   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
274   libgnunetnamestore.la
275
276
277 test_namestore_api_zone_iteration_specific_zone_SOURCES = \
278  test_namestore_api_zone_iteration_specific_zone.c
279 test_namestore_api_zone_iteration_specific_zone_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_stop_SOURCES = \
286  test_namestore_api_zone_iteration_stop.c
287 test_namestore_api_zone_iteration_stop_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 test_plugin_namestore_sqlite_SOURCES = \
294  test_plugin_namestore.c
295 test_plugin_namestore_sqlite_LDADD = \
296  $(top_builddir)/src/testing/libgnunettesting.la \
297  $(top_builddir)/src/util/libgnunetutil.la
298
299 test_plugin_namestore_postgres_SOURCES = \
300  test_plugin_namestore.c
301 test_plugin_namestore_postgres_LDADD = \
302  $(top_builddir)/src/testing/libgnunettesting.la \
303  $(top_builddir)/src/util/libgnunetutil.la
304
305 check_SCRIPTS = \
306         test_namestore_put.sh \
307         test_namestore_lookup.sh \
308         test_namestore_delete.sh
309
310 EXTRA_DIST = \
311   test_namestore_api.conf \
312   test_plugin_namestore_sqlite.conf \
313   test_plugin_namestore_postgres.conf \
314   test_hostkey \
315   zonefiles/S5I9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey \
316   zonefiles/AQ835GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey \
317   zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey \
318   zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey \
319   $(check_SCRIPTS)
320