Do not crash if key is NULL.
[oweals/gnunet.git] / src / fs / Makefile.am
1 AM_CPPFLAGS = -I$(top_srcdir)/src/include
2
3 if MINGW
4  WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
5 endif
6
7 if USE_COVERAGE
8   AM_CFLAGS = --coverage -O0
9   XLIB = -lgcov
10 endif
11
12 pkgcfgdir= $(pkgdatadir)/config.d/
13
14 libexecdir= $(pkglibdir)/libexec/
15
16 pkgcfg_DATA = \
17   fs.conf
18
19 plugindir = $(libdir)/gnunet
20
21
22 lib_LTLIBRARIES = libgnunetfs.la
23
24 plugin_LTLIBRARIES = \
25   libgnunet_plugin_block_fs.la
26
27 if HAVE_TESTING
28 noinst_LIBRARIES = libgnunetfstest.a
29 endif
30
31 libgnunetfs_la_SOURCES = \
32   fs_api.c fs_api.h fs.h \
33   fs_directory.c \
34   fs_dirmetascan.c \
35   fs_download.c \
36   fs_file_information.c \
37   fs_getopt.c \
38   fs_list_indexed.c \
39   fs_publish.c \
40   fs_publish_ksk.c \
41   fs_publish_ublock.c fs_publish_ublock.h \
42   fs_misc.c \
43   fs_namespace.c \
44   fs_search.c \
45   fs_sharetree.c \
46   fs_tree.c fs_tree.h \
47   fs_unindex.c \
48   fs_uri.c
49
50 libgnunetfs_la_LIBADD = \
51   $(top_builddir)/src/datastore/libgnunetdatastore.la \
52   $(top_builddir)/src/util/libgnunetutil.la \
53   $(GN_LIBINTL) $(XLIB) $(LIBGCRYPT_LIBS) -lunistring -lextractor
54
55 libgnunetfs_la_LDFLAGS = \
56   $(GN_LIB_LDFLAGS)  $(WINFLAGS) \
57   -version-info 3:1:1
58
59
60 libgnunetfstest_a_SOURCES = \
61   fs_test_lib.c fs_test_lib.h
62
63 libgnunetfstest_a_LIBADD = \
64   $(top_builddir)/src/testing/libgnunettesting.la \
65   $(top_builddir)/src/testbed/libgnunettestbed.la
66
67 libexec_PROGRAMS = \
68   gnunet-helper-fs-publish \
69   gnunet-service-fs
70
71 if HAVE_TESTING
72 noinst_PROGRAMS = \
73   gnunet-fs-profiler \
74   gnunet-daemon-fsprofiler
75 endif
76
77 bin_PROGRAMS = \
78   gnunet-auto-share \
79   gnunet-directory \
80   gnunet-download \
81   gnunet-publish \
82   gnunet-search \
83   gnunet-fs \
84   gnunet-unindex
85
86 bin_SCRIPTS = \
87   gnunet-download-manager.scm
88
89 gnunet_directory_SOURCES = \
90  gnunet-directory.c
91 gnunet_directory_LDADD = \
92   $(top_builddir)/src/fs/libgnunetfs.la \
93   $(top_builddir)/src/util/libgnunetutil.la \
94   -lextractor \
95   $(GN_LIBINTL)
96 gnunet_directory_DEPENDENCIES = \
97   libgnunetfs.la
98
99 gnunet_fs_profiler_SOURCES = \
100  gnunet-fs-profiler.c
101 gnunet_fs_profiler_LDADD = \
102   $(top_builddir)/src/testbed/libgnunettestbed.la \
103   $(top_builddir)/src/util/libgnunetutil.la \
104   $(GN_LIBINTL)
105
106 gnunet_fs_SOURCES = \
107  gnunet-fs.c
108 gnunet_fs_LDADD = \
109   $(top_builddir)/src/fs/libgnunetfs.la \
110   $(top_builddir)/src/util/libgnunetutil.la \
111   -lextractor \
112   $(GN_LIBINTL)
113 gnunet_fs_DEPENDENCIES = \
114   libgnunetfs.la
115
116 gnunet_download_SOURCES =  \
117  gnunet-download.c
118 gnunet_download_LDADD =  \
119  $(top_builddir)/src/fs/libgnunetfs.la \
120  $(top_builddir)/src/util/libgnunetutil.la \
121  $(GN_LIBINTL)
122 gnunet_download_DEPENDENCIES = \
123   libgnunetfs.la
124
125 gnunet_publish_SOURCES =  \
126  gnunet-publish.c
127 gnunet_publish_LDADD =  \
128  $(top_builddir)/src/identity/libgnunetidentity.la \
129  $(top_builddir)/src/fs/libgnunetfs.la \
130  $(top_builddir)/src/util/libgnunetutil.la \
131  -lextractor \
132  $(GN_LIBINTL)
133 gnunet_publish_DEPENDENCIES = \
134   libgnunetfs.la
135
136 gnunet_auto_share_SOURCES =  \
137  gnunet-auto-share.c
138 gnunet_auto_share_LDADD =  \
139  $(top_builddir)/src/util/libgnunetutil.la \
140  -lextractor \
141  $(GN_LIBINTL)
142 gnunet_auto_share_DEPENDENCIES = \
143   libgnunetfs.la
144
145 gnunet_helper_fs_publish_SOURCES =  \
146  gnunet-helper-fs-publish.c
147 gnunet_helper_fs_publish_LDADD =  \
148  $(top_builddir)/src/util/libgnunetutil.la \
149  -lextractor \
150  $(GN_LIBINTL)
151 gnunet_helper_fs_publish_DEPENDENCIES = \
152   libgnunetfs.la
153
154 gnunet_search_SOURCES = \
155  gnunet-search.c
156 gnunet_search_LDADD = \
157   $(top_builddir)/src/fs/libgnunetfs.la \
158   $(top_builddir)/src/util/libgnunetutil.la \
159  -lextractor \
160   $(GN_LIBINTL)
161 gnunet_search_DEPENDENCIES = \
162   libgnunetfs.la
163
164 gnunet_daemon_fsprofiler_SOURCES =  \
165  gnunet-daemon-fsprofiler.c
166 gnunet_daemon_fsprofiler_LDADD = \
167   $(top_builddir)/src/fs/libgnunetfs.la \
168   $(top_builddir)/src/statistics/libgnunetstatistics.la \
169   $(top_builddir)/src/util/libgnunetutil.la \
170   $(GN_LIBINTL)
171 gnunet_daemon_fsprofiler_DEPENDENCIES = \
172   libgnunetfs.la
173
174 gnunet_service_fs_SOURCES =  \
175  gnunet-service-fs.c gnunet-service-fs.h \
176  gnunet-service-fs_cp.c gnunet-service-fs_cp.h \
177  gnunet-service-fs_indexing.c gnunet-service-fs_indexing.h \
178  gnunet-service-fs_lc.c gnunet-service-fs_lc.h \
179  gnunet-service-fs_pe.c gnunet-service-fs_pe.h \
180  gnunet-service-fs_pr.c gnunet-service-fs_pr.h \
181  gnunet-service-fs_push.c gnunet-service-fs_push.h \
182  gnunet-service-fs_put.c gnunet-service-fs_put.h \
183  gnunet-service-fs_cadet_client.c gnunet-service-fs_cadet.h \
184  gnunet-service-fs_cadet_server.c
185 gnunet_service_fs_LDADD =  \
186  $(top_builddir)/src/fs/libgnunetfs.la \
187  $(top_builddir)/src/dht/libgnunetdht.la \
188  $(top_builddir)/src/block/libgnunetblock.la \
189  $(top_builddir)/src/datastore/libgnunetdatastore.la \
190  $(top_builddir)/src/statistics/libgnunetstatistics.la \
191  $(top_builddir)/src/cadet/libgnunetcadet.la \
192  $(top_builddir)/src/ats/libgnunetats.la \
193  $(top_builddir)/src/core/libgnunetcore.la \
194  $(top_builddir)/src/util/libgnunetutil.la \
195  $(top_builddir)/src/peerstore/libgnunetpeerstore.la \
196  $(GN_LIBINTL) -lm
197 gnunet_service_fs_DEPENDENCIES = \
198   libgnunetfs.la
199
200 gnunet_unindex_SOURCES = \
201  gnunet-unindex.c
202 gnunet_unindex_LDADD = \
203   $(top_builddir)/src/fs/libgnunetfs.la \
204   $(top_builddir)/src/util/libgnunetutil.la \
205   $(GN_LIBINTL)
206 gnunet_unindex_DEPENDENCIES = \
207   libgnunetfs.la
208
209
210 libgnunet_plugin_block_fs_la_SOURCES = \
211   plugin_block_fs.c
212 libgnunet_plugin_block_fs_la_LIBADD = \
213   $(top_builddir)/src/block/libgnunetblock.la \
214   $(top_builddir)/src/fs/libgnunetfs.la \
215   $(top_builddir)/src/util/libgnunetutil.la \
216   $(LTLIBINTL)
217 libgnunet_plugin_block_fs_la_LDFLAGS = \
218  $(GN_PLUGIN_LDFLAGS)
219 libgnunet_plugin_block_fs_la_DEPENDENCIES = \
220   $(top_builddir)/src/util/libgnunetutil.la \
221   $(top_builddir)/src/block/libgnunetblock.la \
222   libgnunetfs.la
223
224
225
226 if HAVE_BENCHMARKS
227  FS_BENCHMARKS = \
228  perf_gnunet_service_fs_p2p \
229  perf_gnunet_service_fs_p2p_dht \
230  perf_gnunet_service_fs_p2p_index \
231  perf_gnunet_service_fs_p2p_respect
232 endif
233
234 if HAVE_TESTING
235 check_PROGRAMS = \
236  test_plugin_block_fs \
237  test_fs_directory \
238  test_fs_download \
239  test_fs_download_cadet \
240  test_fs_download_indexed \
241  test_fs_download_persistence \
242  test_fs_file_information \
243  test_fs_getopt \
244  test_fs_list_indexed \
245  test_fs_namespace \
246  test_fs_namespace_list_updateable \
247  test_fs_publish \
248  test_fs_publish_persistence \
249  test_fs_search \
250  test_fs_search_probes \
251  test_fs_search_persistence \
252  test_fs_start_stop \
253  test_fs_test_lib \
254  test_fs_unindex \
255  test_fs_unindex_persistence \
256  test_fs_uri \
257  test_gnunet_service_fs_migration \
258  test_gnunet_service_fs_p2p \
259  test_gnunet_service_fs_p2p_cadet \
260  $(FS_BENCHMARKS)
261 endif
262
263 test_plugin_block_fs_SOURCES = \
264  test_plugin_block_fs.c
265 test_plugin_block_fs_LDADD = \
266  $(top_builddir)/src/block/libgnunetblock.la \
267  $(top_builddir)/src/util/libgnunetutil.la
268
269 if HAVE_PYTHON
270 check_SCRIPTS = \
271  test_gnunet_fs_psd.py \
272  test_gnunet_fs_rec.py \
273  test_gnunet_fs_idx.py
274 endif
275
276 if ENABLE_MONKEY
277  MONKEY = @MONKEYPREFIX@
278  AM_LDFLAGS = -no-install
279 endif
280
281
282 if ENABLE_TEST_RUN
283 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH; $(MONKEY)
284 TESTS = \
285  test_fs_directory \
286  test_fs_download \
287  test_fs_download_indexed \
288  test_fs_download_persistence \
289  test_fs_file_information \
290  test_fs_list_indexed \
291  test_fs_namespace \
292  test_fs_namespace_list_updateable \
293  test_fs_publish \
294  test_fs_publish_persistence \
295  test_fs_search \
296  test_fs_search_probes \
297  test_fs_search_persistence \
298  test_fs_start_stop \
299  test_fs_unindex \
300  test_fs_unindex_persistence \
301  test_fs_uri \
302  test_fs_test_lib \
303  test_gnunet_service_fs_migration \
304  test_gnunet_service_fs_p2p \
305  test_gnunet_service_fs_p2p_cadet \
306  perf_gnunet_service_fs_p2p \
307  perf_gnunet_service_fs_p2p_index \
308  perf_gnunet_service_fs_p2p_respect \
309  $(check_SCRIPTS)
310 endif
311
312
313 test_fs_directory_SOURCES = \
314  test_fs_directory.c
315 test_fs_directory_LDADD = \
316   -lextractor \
317   $(top_builddir)/src/fs/libgnunetfs.la  \
318   $(top_builddir)/src/util/libgnunetutil.la
319
320 test_fs_download_SOURCES = \
321  test_fs_download.c
322 test_fs_download_LDADD = \
323   $(top_builddir)/src/testing/libgnunettesting.la  \
324   $(top_builddir)/src/fs/libgnunetfs.la  \
325   $(top_builddir)/src/util/libgnunetutil.la
326
327 test_fs_download_indexed_SOURCES = \
328  test_fs_download.c
329 test_fs_download_indexed_LDADD = \
330   $(top_builddir)/src/testing/libgnunettesting.la  \
331   $(top_builddir)/src/fs/libgnunetfs.la  \
332   $(top_builddir)/src/util/libgnunetutil.la
333
334 test_fs_download_cadet_SOURCES = \
335  test_fs_download.c
336 test_fs_download_cadet_LDADD = \
337   $(top_builddir)/src/testing/libgnunettesting.la  \
338   $(top_builddir)/src/fs/libgnunetfs.la  \
339   $(top_builddir)/src/util/libgnunetutil.la
340
341 test_fs_download_persistence_SOURCES = \
342  test_fs_download_persistence.c
343 test_fs_download_persistence_LDADD = \
344   $(top_builddir)/src/testing/libgnunettesting.la  \
345   $(top_builddir)/src/fs/libgnunetfs.la  \
346   $(top_builddir)/src/util/libgnunetutil.la
347
348 test_fs_file_information_SOURCES = \
349  test_fs_file_information.c
350 test_fs_file_information_LDADD = \
351   -lextractor \
352   $(top_builddir)/src/fs/libgnunetfs.la  \
353   $(top_builddir)/src/util/libgnunetutil.la
354
355 test_fs_getopt_SOURCES = \
356  test_fs_getopt.c
357 test_fs_getopt_LDADD = \
358   $(top_builddir)/src/fs/libgnunetfs.la  \
359   $(top_builddir)/src/util/libgnunetutil.la
360
361 test_fs_list_indexed_SOURCES = \
362  test_fs_list_indexed.c
363 test_fs_list_indexed_LDADD = \
364   $(top_builddir)/src/testing/libgnunettesting.la \
365   $(top_builddir)/src/fs/libgnunetfs.la  \
366   $(top_builddir)/src/util/libgnunetutil.la
367
368 test_fs_namespace_SOURCES = \
369  test_fs_namespace.c
370 test_fs_namespace_LDADD = \
371   $(top_builddir)/src/testing/libgnunettesting.la \
372   $(top_builddir)/src/fs/libgnunetfs.la  \
373   $(top_builddir)/src/util/libgnunetutil.la
374
375 test_fs_namespace_list_updateable_SOURCES = \
376  test_fs_namespace_list_updateable.c
377 test_fs_namespace_list_updateable_LDADD = \
378   $(top_builddir)/src/testing/libgnunettesting.la \
379   $(top_builddir)/src/fs/libgnunetfs.la  \
380   $(top_builddir)/src/util/libgnunetutil.la
381
382 test_fs_publish_SOURCES = \
383  test_fs_publish.c
384 test_fs_publish_LDADD = \
385   $(top_builddir)/src/testing/libgnunettesting.la \
386   $(top_builddir)/src/fs/libgnunetfs.la  \
387   $(top_builddir)/src/util/libgnunetutil.la
388
389 test_fs_publish_persistence_SOURCES = \
390  test_fs_publish_persistence.c
391 test_fs_publish_persistence_LDADD = \
392   $(top_builddir)/src/testing/libgnunettesting.la \
393   $(top_builddir)/src/fs/libgnunetfs.la  \
394   $(top_builddir)/src/util/libgnunetutil.la
395
396 test_fs_search_SOURCES = \
397  test_fs_search.c
398 test_fs_search_LDADD = \
399   $(top_builddir)/src/testing/libgnunettesting.la \
400   $(top_builddir)/src/fs/libgnunetfs.la \
401   $(top_builddir)/src/util/libgnunetutil.la
402
403 test_fs_search_probes_SOURCES = \
404  test_fs_search_probes.c
405 test_fs_search_probes_LDADD = \
406   $(top_builddir)/src/testing/libgnunettesting.la \
407   $(top_builddir)/src/fs/libgnunetfs.la \
408   $(top_builddir)/src/util/libgnunetutil.la
409
410 test_fs_search_persistence_SOURCES = \
411  test_fs_search_persistence.c
412 test_fs_search_persistence_LDADD = \
413   $(top_builddir)/src/testing/libgnunettesting.la \
414   $(top_builddir)/src/fs/libgnunetfs.la \
415   $(top_builddir)/src/util/libgnunetutil.la
416
417 test_fs_start_stop_SOURCES = \
418  test_fs_start_stop.c
419 test_fs_start_stop_LDADD = \
420   $(top_builddir)/src/testing/libgnunettesting.la \
421   $(top_builddir)/src/fs/libgnunetfs.la  \
422   $(top_builddir)/src/util/libgnunetutil.la
423
424 test_fs_unindex_SOURCES = \
425  test_fs_unindex.c
426 test_fs_unindex_LDADD = \
427   $(top_builddir)/src/testing/libgnunettesting.la \
428   $(top_builddir)/src/fs/libgnunetfs.la \
429   $(top_builddir)/src/util/libgnunetutil.la
430
431 test_fs_unindex_persistence_SOURCES = \
432  test_fs_unindex_persistence.c
433 test_fs_unindex_persistence_LDADD = \
434   $(top_builddir)/src/testing/libgnunettesting.la \
435   $(top_builddir)/src/fs/libgnunetfs.la \
436   $(top_builddir)/src/util/libgnunetutil.la
437
438 test_fs_uri_SOURCES = \
439  test_fs_uri.c
440 test_fs_uri_LDADD = \
441   $(top_builddir)/src/fs/libgnunetfs.la  \
442   $(top_builddir)/src/util/libgnunetutil.la
443
444 test_fs_test_lib_SOURCES = \
445  test_fs_test_lib.c
446 test_fs_test_lib_LDADD = \
447   $(top_builddir)/src/fs/libgnunetfstest.a \
448   $(top_builddir)/src/testbed/libgnunettestbed.la \
449   $(top_builddir)/src/fs/libgnunetfs.la  \
450   $(top_builddir)/src/util/libgnunetutil.la
451
452 test_gnunet_service_fs_p2p_SOURCES = \
453  test_gnunet_service_fs_p2p.c
454 test_gnunet_service_fs_p2p_LDADD = \
455   $(top_builddir)/src/fs/libgnunetfstest.a \
456   $(top_builddir)/src/testbed/libgnunettestbed.la \
457   $(top_builddir)/src/fs/libgnunetfs.la  \
458   $(top_builddir)/src/util/libgnunetutil.la
459
460 test_gnunet_service_fs_p2p_cadet_SOURCES = \
461  test_gnunet_service_fs_p2p.c
462 test_gnunet_service_fs_p2p_cadet_LDADD = \
463   $(top_builddir)/src/fs/libgnunetfstest.a \
464   $(top_builddir)/src/testbed/libgnunettestbed.la \
465   $(top_builddir)/src/fs/libgnunetfs.la  \
466   $(top_builddir)/src/util/libgnunetutil.la
467
468 test_gnunet_service_fs_migration_SOURCES = \
469  test_gnunet_service_fs_migration.c
470 test_gnunet_service_fs_migration_LDADD = \
471   $(top_builddir)/src/fs/libgnunetfstest.a \
472   $(top_builddir)/src/testbed/libgnunettestbed.la \
473   $(top_builddir)/src/fs/libgnunetfs.la  \
474   $(top_builddir)/src/util/libgnunetutil.la
475
476 perf_gnunet_service_fs_p2p_SOURCES = \
477  perf_gnunet_service_fs_p2p.c
478 perf_gnunet_service_fs_p2p_LDADD = \
479   $(top_builddir)/src/fs/libgnunetfstest.a \
480   $(top_builddir)/src/statistics/libgnunetstatistics.la \
481   $(top_builddir)/src/testbed/libgnunettestbed.la \
482   $(top_builddir)/src/fs/libgnunetfs.la  \
483   $(top_builddir)/src/util/libgnunetutil.la
484
485 perf_gnunet_service_fs_p2p_index_SOURCES = \
486  perf_gnunet_service_fs_p2p.c
487 perf_gnunet_service_fs_p2p_index_LDADD = \
488   $(top_builddir)/src/fs/libgnunetfstest.a \
489   $(top_builddir)/src/statistics/libgnunetstatistics.la \
490   $(top_builddir)/src/testbed/libgnunettestbed.la \
491   $(top_builddir)/src/fs/libgnunetfs.la  \
492   $(top_builddir)/src/util/libgnunetutil.la
493
494 perf_gnunet_service_fs_p2p_dht_SOURCES = \
495  perf_gnunet_service_fs_p2p.c
496 perf_gnunet_service_fs_p2p_dht_LDADD = \
497   $(top_builddir)/src/fs/libgnunetfstest.a \
498   $(top_builddir)/src/statistics/libgnunetstatistics.la \
499   $(top_builddir)/src/testbed/libgnunettestbed.la \
500   $(top_builddir)/src/fs/libgnunetfs.la  \
501   $(top_builddir)/src/util/libgnunetutil.la
502
503 perf_gnunet_service_fs_p2p_respect_SOURCES = \
504  perf_gnunet_service_fs_p2p_respect.c
505 perf_gnunet_service_fs_p2p_respect_LDADD = \
506   $(top_builddir)/src/fs/libgnunetfstest.a \
507   $(top_builddir)/src/statistics/libgnunetstatistics.la \
508   $(top_builddir)/src/testbed/libgnunettestbed.la \
509   $(top_builddir)/src/fs/libgnunetfs.la  \
510   $(top_builddir)/src/util/libgnunetutil.la
511
512
513 do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g'
514
515 test_gnunet_fs_psd.py: test_gnunet_fs_psd.py.in Makefile
516         $(do_subst) < $(srcdir)/test_gnunet_fs_psd.py.in > test_gnunet_fs_psd.py
517         chmod +x test_gnunet_fs_psd.py
518
519 test_gnunet_fs_rec.py: test_gnunet_fs_rec.py.in Makefile
520         $(do_subst) < $(srcdir)/test_gnunet_fs_rec.py.in > test_gnunet_fs_rec.py
521         chmod +x test_gnunet_fs_rec.py
522
523 test_gnunet_fs_ns.py: test_gnunet_fs_ns.py.in Makefile
524         $(do_subst) < $(srcdir)/test_gnunet_fs_ns.py.in > test_gnunet_fs_ns.py
525         chmod +x test_gnunet_fs_ns.py
526
527 test_gnunet_fs_idx.py: test_gnunet_fs_idx.py.in Makefile
528         $(do_subst) < $(srcdir)/test_gnunet_fs_idx.py.in > test_gnunet_fs_idx.py
529         chmod +x test_gnunet_fs_idx.py
530
531
532 EXTRA_DIST = \
533   test_fs_defaults.conf \
534   fs_test_lib_data.conf \
535   test_fs_data.conf \
536   test_fs_download_data.conf \
537   test_fs_download_indexed.conf \
538   test_fs_download_cadet.conf \
539   test_fs_file_information_data.conf \
540   fs_test_lib_data.conf \
541   test_fs_list_indexed_data.conf \
542   test_fs_namespace_data.conf \
543   test_fs_publish_data.conf \
544   test_fs_search_data.conf \
545   test_fs_unindex_data.conf \
546   test_fs_uri_data.conf \
547   test_gnunet_service_fs_migration_data.conf \
548   test_gnunet_service_fs_p2p_cadet.conf \
549   test_gnunet_fs_idx_data.conf \
550   test_gnunet_fs_psd_data.conf \
551   test_gnunet_fs_rec_data.conf \
552   perf_gnunet_service_fs_p2p.conf \
553   test_gnunet_fs_rec_data.tgz \
554   test_gnunet_fs_psd.py.in \
555   test_gnunet_fs_rec.py.in \
556   test_gnunet_fs_idx.py.in \
557   test_pseudonym_data.conf \
558   $(bin_SCRIPTS)
559
560 CLEANFILES = $(check_SCRIPTS)