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