added lookup test + fix in test
[oweals/gnunet.git] / src / namestore / Makefile.am
1 AM_CPPFLAGS = -I$(top_srcdir)/src/include
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_POSTGRES
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_remove \
45  test_namestore_api_remove_not_existing_record \
46  test_namestore_api_zone_iteration \
47  test_namestore_api_zone_iteration_specific_zone \
48  test_namestore_api_zone_iteration_stop \
49  test_namestore_api_monitoring \
50  test_namestore_api_monitoring_existing
51 #test_namestore_api_zone_to_name
52 endif
53
54 if HAVE_SQLITE
55 check_PROGRAMS = \
56  $(SQLITE_TESTS) \
57  $(POSTGRES_TESTS) \
58  $(TESTING_TESTS)
59 endif
60
61 if ENABLE_TEST_RUN
62 TESTS = \
63   $(check_PROGRAMS) \
64   $(check_SCRIPTS)
65 endif
66
67 lib_LTLIBRARIES = \
68   libgnunetnamestore.la
69
70 libgnunetnamestore_la_SOURCES = \
71   namestore_api.c \
72   namestore_api_monitor.c \
73   namestore.h
74 libgnunetnamestore_la_LIBADD = \
75   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
76   $(top_builddir)/src/statistics/libgnunetstatistics.la \
77   $(top_builddir)/src/dns/libgnunetdnsparser.la \
78   $(top_builddir)/src/util/libgnunetutil.la \
79   $(GN_LIBINTL)
80 libgnunetnamestore_la_LDFLAGS = \
81   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
82   -version-info 0:1:0
83
84 libexec_PROGRAMS = \
85  gnunet-service-namestore
86
87 bin_PROGRAMS = \
88  gnunet-namestore
89
90 if HAVE_MHD
91 libexec_PROGRAMS += \
92  gnunet-namestore-fcfsd
93 endif
94
95 gnunet_namestore_SOURCES = \
96  gnunet-namestore.c
97 gnunet_namestore_LDADD = \
98   $(top_builddir)/src/identity/libgnunetidentity.la \
99   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
100   $(top_builddir)/src/util/libgnunetutil.la \
101   libgnunetnamestore.la \
102   $(GN_LIBINTL)
103 gnunet_namestore_DEPENDENCIES = \
104   $(top_builddir)/src/identity/libgnunetidentity.la \
105   $(top_builddir)/src/util/libgnunetutil.la \
106   libgnunetnamestore.la
107
108
109 gnunet_namestore_fcfsd_SOURCES = \
110  gnunet-namestore-fcfsd.c
111 gnunet_namestore_fcfsd_LDADD = -lmicrohttpd \
112   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
113   $(top_builddir)/src/identity/libgnunetidentity.la \
114   $(top_builddir)/src/namestore/libgnunetnamestore.la \
115   $(top_builddir)/src/util/libgnunetutil.la \
116   $(GN_LIBINTL)
117 gnunet_namestore_fcfsd_DEPENDENCIES = \
118   $(top_builddir)/src/util/libgnunetutil.la \
119   libgnunetnamestore.la
120
121
122
123 gnunet_service_namestore_SOURCES = \
124  gnunet-service-namestore.c
125
126 gnunet_service_namestore_LDADD = \
127   $(top_builddir)/src/namecache/libgnunetnamecache.la \
128   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
129   $(top_builddir)/src/statistics/libgnunetstatistics.la \
130   $(top_builddir)/src/util/libgnunetutil.la \
131   libgnunetnamestore.la \
132   $(GN_LIBINTL)
133 gnunet_service_namestore_DEPENDENCIES = \
134   $(top_builddir)/src/statistics/libgnunetstatistics.la \
135   $(top_builddir)/src/util/libgnunetutil.la \
136   libgnunetnamestore.la
137
138
139 plugin_LTLIBRARIES = \
140   $(SQLITE_PLUGIN) \
141   $(POSTGRES_PLUGIN)
142
143 libgnunet_plugin_namestore_sqlite_la_SOURCES = \
144   plugin_namestore_sqlite.c
145 libgnunet_plugin_namestore_sqlite_la_LIBADD = \
146   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
147   $(top_builddir)/src/statistics/libgnunetstatistics.la \
148   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
149   $(LTLIBINTL)
150 libgnunet_plugin_namestore_sqlite_la_LDFLAGS = \
151  $(GN_PLUGIN_LDFLAGS)
152 libgnunet_plugin_namestore_sqlite_la_DEPENDENCIES = \
153   $(top_builddir)/src/statistics/libgnunetstatistics.la \
154   $(top_builddir)/src/util/libgnunetutil.la \
155   libgnunetnamestore.la
156
157
158 libgnunet_plugin_namestore_postgres_la_SOURCES = \
159   plugin_namestore_postgres.c
160 libgnunet_plugin_namestore_postgres_la_LIBADD = \
161   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la  \
162   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
163   $(top_builddir)/src/statistics/libgnunetstatistics.la \
164   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq \
165   $(LTLIBINTL)
166 libgnunet_plugin_namestore_postgres_la_LDFLAGS = \
167  $(GN_PLUGIN_LDFLAGS)
168 libgnunet_plugin_namestore_postgres_la_DEPENDENCIES = \
169   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
170   $(top_builddir)/src/statistics/libgnunetstatistics.la \
171   $(top_builddir)/src/util/libgnunetutil.la \
172   libgnunetnamestore.la
173
174 test_namestore_api_store_SOURCES = \
175  test_namestore_api_store.c
176 test_namestore_api_store_LDADD = \
177   $(top_builddir)/src/testing/libgnunettesting.la \
178   $(top_builddir)/src/util/libgnunetutil.la \
179   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
180   $(top_builddir)/src/namestore/libgnunetnamestore.la
181
182 test_namestore_api_store_update_SOURCES = \
183  test_namestore_api_store_update.c
184 test_namestore_api_store_update_LDADD = \
185   $(top_builddir)/src/testing/libgnunettesting.la \
186   $(top_builddir)/src/util/libgnunetutil.la \
187   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
188   $(top_builddir)/src/namecache/libgnunetnamecache.la \
189   $(top_builddir)/src/namestore/libgnunetnamestore.la
190
191 test_namestore_api_lookup_public_SOURCES = \
192  test_namestore_api_lookup_public.c
193 test_namestore_api_lookup_public_LDADD = \
194   $(top_builddir)/src/testing/libgnunettesting.la \
195   $(top_builddir)/src/util/libgnunetutil.la \
196   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
197   $(top_builddir)/src/namecache/libgnunetnamecache.la \
198   $(top_builddir)/src/namestore/libgnunetnamestore.la
199
200 test_namestore_api_lookup_private_SOURCES = \
201  test_namestore_api_lookup_private.c
202 test_namestore_api_lookup_private_LDADD = \
203   $(top_builddir)/src/testing/libgnunettesting.la \
204   $(top_builddir)/src/util/libgnunetutil.la \
205   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
206   $(top_builddir)/src/namecache/libgnunetnamecache.la \
207   $(top_builddir)/src/namestore/libgnunetnamestore.la
208
209 test_namestore_api_put_SOURCES = \
210  test_namestore_api_put.c
211 test_namestore_api_put_LDADD = \
212   $(top_builddir)/src/testing/libgnunettesting.la \
213   $(top_builddir)/src/util/libgnunetutil.la \
214   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
215   $(top_builddir)/src/namestore/libgnunetnamestore.la
216
217 test_namestore_api_remove_SOURCES = \
218  test_namestore_api_remove.c
219 test_namestore_api_remove_LDADD = \
220   $(top_builddir)/src/testing/libgnunettesting.la \
221   $(top_builddir)/src/util/libgnunetutil.la \
222   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
223   $(top_builddir)/src/namestore/libgnunetnamestore.la
224
225 test_namestore_api_remove_not_existing_record_SOURCES = \
226  test_namestore_api_remove_not_existing_record.c
227 test_namestore_api_remove_not_existing_record_LDADD = \
228   $(top_builddir)/src/testing/libgnunettesting.la \
229   $(top_builddir)/src/util/libgnunetutil.la \
230   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
231   $(top_builddir)/src/namestore/libgnunetnamestore.la
232
233 test_namestore_api_zone_to_name_SOURCES = \
234  test_namestore_api_zone_to_name.c
235 test_namestore_api_zone_to_name_LDADD = \
236   $(top_builddir)/src/testing/libgnunettesting.la \
237   $(top_builddir)/src/util/libgnunetutil.la \
238   $(top_builddir)/src/namestore/libgnunetnamestore.la
239
240 test_namestore_api_monitoring_SOURCES = \
241  test_namestore_api_monitoring.c
242 test_namestore_api_monitoring_LDADD = \
243   $(top_builddir)/src/testing/libgnunettesting.la \
244   $(top_builddir)/src/namestore/libgnunetnamestore.la \
245   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
246   $(top_builddir)/src/util/libgnunetutil.la
247
248 test_namestore_api_monitoring_existing_SOURCES = \
249  test_namestore_api_monitoring_existing.c
250 test_namestore_api_monitoring_existing_LDADD = \
251   $(top_builddir)/src/testing/libgnunettesting.la \
252   $(top_builddir)/src/namestore/libgnunetnamestore.la \
253   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
254   $(top_builddir)/src/util/libgnunetutil.la
255
256 test_namestore_api_zone_iteration_SOURCES = \
257  test_namestore_api_zone_iteration.c
258 test_namestore_api_zone_iteration_LDADD = \
259   $(top_builddir)/src/testing/libgnunettesting.la \
260   $(top_builddir)/src/util/libgnunetutil.la \
261   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
262   $(top_builddir)/src/namestore/libgnunetnamestore.la
263
264 test_namestore_api_zone_iteration_specific_zone_SOURCES = \
265  test_namestore_api_zone_iteration_specific_zone.c
266 test_namestore_api_zone_iteration_specific_zone_LDADD = \
267   $(top_builddir)/src/testing/libgnunettesting.la \
268   $(top_builddir)/src/util/libgnunetutil.la \
269   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
270   $(top_builddir)/src/namestore/libgnunetnamestore.la
271
272 test_namestore_api_zone_iteration_stop_SOURCES = \
273  test_namestore_api_zone_iteration_stop.c
274 test_namestore_api_zone_iteration_stop_LDADD = \
275   $(top_builddir)/src/testing/libgnunettesting.la \
276   $(top_builddir)/src/util/libgnunetutil.la \
277   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
278   $(top_builddir)/src/namestore/libgnunetnamestore.la
279
280 test_plugin_namestore_sqlite_SOURCES = \
281  test_plugin_namestore.c
282 test_plugin_namestore_sqlite_LDADD = \
283  $(top_builddir)/src/testing/libgnunettesting.la \
284  $(top_builddir)/src/util/libgnunetutil.la
285
286 test_plugin_namestore_postgres_SOURCES = \
287  test_plugin_namestore.c
288 test_plugin_namestore_postgres_LDADD = \
289  $(top_builddir)/src/testing/libgnunettesting.la \
290  $(top_builddir)/src/util/libgnunetutil.la
291
292 check_SCRIPTS = \
293         test_namestore_put.sh \
294         test_namestore_lookup.sh \
295         test_namestore_delete.sh
296
297 EXTRA_DIST = \
298   test_namestore_api.conf \
299   test_plugin_namestore_sqlite.conf \
300   test_plugin_namestore_postgres.conf \
301   test_namestore_defaults.conf \
302   test_hostkey \
303   zonefiles/S5I9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey \
304   zonefiles/AQ835GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey \
305   zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey \
306   zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey \
307   $(check_SCRIPTS)
308