Merge branch 'master' of gnunet.org:gnunet
[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 #bin_SCRIPTS = \
93 #  gnunet-download-manager.scm
94 noinst_SCRIPTS = gnunet-download-manager.scm
95
96 gnunet_directory_SOURCES = \
97  gnunet-directory.c
98 gnunet_directory_LDADD = \
99   libgnunetfs.la \
100   $(top_builddir)/src/util/libgnunetutil.la \
101   $(GN_LIBINTL)
102
103 if HAVE_LIBEXTRACTOR
104 gnunet_directory_LDADD += \
105   -lextractor
106 endif
107
108 gnunet_fs_profiler_SOURCES = \
109  gnunet-fs-profiler.c
110 gnunet_fs_profiler_LDADD = \
111   $(top_builddir)/src/testbed/libgnunettestbed.la \
112   $(top_builddir)/src/util/libgnunetutil.la \
113   $(GN_LIBINTL)
114
115 gnunet_fs_SOURCES = \
116  gnunet-fs.c
117 gnunet_fs_LDADD = \
118   libgnunetfs.la \
119   $(top_builddir)/src/util/libgnunetutil.la \
120   $(GN_LIBINTL)
121
122 if HAVE_LIBEXTRACTOR
123 gnunet_fs_LDADD += \
124   -lextractor
125 endif
126
127 gnunet_download_SOURCES =  \
128  gnunet-download.c
129 gnunet_download_LDADD =  \
130  libgnunetfs.la \
131  $(top_builddir)/src/util/libgnunetutil.la \
132  $(GN_LIBINTL)
133
134 gnunet_publish_SOURCES =  \
135  gnunet-publish.c
136 gnunet_publish_LDADD =  \
137  $(top_builddir)/src/identity/libgnunetidentity.la \
138  libgnunetfs.la \
139  $(top_builddir)/src/util/libgnunetutil.la \
140  $(GN_LIBINTL)
141
142 if HAVE_LIBEXTRACTOR
143 gnunet_publish_LDADD += \
144   -lextractor
145 endif
146
147 gnunet_auto_share_SOURCES =  \
148  gnunet-auto-share.c
149 gnunet_auto_share_LDADD =  \
150  $(top_builddir)/src/util/libgnunetutil.la \
151  $(GN_LIBINTL)
152
153 if HAVE_LIBEXTRACTOR
154 gnunet_auto_share_LDADD += \
155   -lextractor
156 endif
157
158 gnunet_helper_fs_publish_SOURCES =  \
159  gnunet-helper-fs-publish.c
160 gnunet_helper_fs_publish_LDADD =  \
161  $(top_builddir)/src/util/libgnunetutil.la \
162  $(GN_LIBINTL)
163
164 if HAVE_LIBEXTRACTOR
165 gnunet_helper_fs_publish_LDADD += \
166   -lextractor
167 endif
168
169 gnunet_search_SOURCES = \
170  gnunet-search.c
171 gnunet_search_LDADD = \
172   libgnunetfs.la \
173   $(top_builddir)/src/util/libgnunetutil.la \
174   $(GN_LIBINTL)
175
176 if HAVE_LIBEXTRACTOR
177 gnunet_search_LDADD += \
178   -lextractor
179 endif
180
181
182 gnunet_daemon_fsprofiler_SOURCES =  \
183  gnunet-daemon-fsprofiler.c
184 gnunet_daemon_fsprofiler_LDADD = \
185   libgnunetfs.la \
186   $(top_builddir)/src/statistics/libgnunetstatistics.la \
187   $(top_builddir)/src/util/libgnunetutil.la \
188   $(GN_LIBINTL)
189
190 gnunet_service_fs_SOURCES =  \
191  gnunet-service-fs.c gnunet-service-fs.h \
192  gnunet-service-fs_cp.c gnunet-service-fs_cp.h \
193  gnunet-service-fs_indexing.c gnunet-service-fs_indexing.h \
194  gnunet-service-fs_pe.c gnunet-service-fs_pe.h \
195  gnunet-service-fs_pr.c gnunet-service-fs_pr.h \
196  gnunet-service-fs_push.c gnunet-service-fs_push.h \
197  gnunet-service-fs_put.c gnunet-service-fs_put.h \
198  gnunet-service-fs_cadet_client.c gnunet-service-fs_cadet.h \
199  gnunet-service-fs_cadet_server.c
200 gnunet_service_fs_LDADD =  \
201  libgnunetfs.la \
202  $(top_builddir)/src/dht/libgnunetdht.la \
203  $(top_builddir)/src/block/libgnunetblock.la \
204  $(top_builddir)/src/datastore/libgnunetdatastore.la \
205  $(top_builddir)/src/statistics/libgnunetstatistics.la \
206  $(top_builddir)/src/cadet/libgnunetcadet.la \
207  $(top_builddir)/src/ats/libgnunetats.la \
208  $(top_builddir)/src/core/libgnunetcore.la \
209  $(top_builddir)/src/util/libgnunetutil.la \
210  $(top_builddir)/src/peerstore/libgnunetpeerstore.la \
211  $(GN_LIBINTL) -lm
212
213 gnunet_unindex_SOURCES = \
214  gnunet-unindex.c
215 gnunet_unindex_LDADD = \
216   libgnunetfs.la \
217   $(top_builddir)/src/util/libgnunetutil.la \
218   $(GN_LIBINTL)
219
220 libgnunet_plugin_block_fs_la_SOURCES = \
221   plugin_block_fs.c
222 libgnunet_plugin_block_fs_la_LIBADD = \
223   $(top_builddir)/src/block/libgnunetblockgroup.la \
224   $(top_builddir)/src/block/libgnunetblock.la \
225   libgnunetfs.la \
226   $(top_builddir)/src/util/libgnunetutil.la \
227   $(LTLIBINTL)
228 libgnunet_plugin_block_fs_la_LDFLAGS = \
229  $(GN_PLUGIN_LDFLAGS)
230
231 if HAVE_BENCHMARKS
232  FS_BENCHMARKS = \
233  perf_gnunet_service_fs_p2p \
234  perf_gnunet_service_fs_p2p_dht \
235  perf_gnunet_service_fs_p2p_index \
236  perf_gnunet_service_fs_p2p_respect
237 endif
238
239 if HAVE_TESTING
240 check_PROGRAMS = \
241  test_plugin_block_fs \
242  test_fs_directory \
243  test_fs_download \
244  test_fs_download_cadet \
245  test_fs_download_indexed \
246  test_fs_download_persistence \
247  test_fs_file_information \
248  test_fs_getopt \
249  test_fs_list_indexed \
250  test_fs_namespace \
251  test_fs_namespace_list_updateable \
252  test_fs_publish \
253  test_fs_publish_persistence \
254  test_fs_search \
255  test_fs_search_with_and \
256  test_fs_search_probes \
257  test_fs_search_persistence \
258  test_fs_start_stop \
259  test_fs_test_lib \
260  test_fs_unindex \
261  test_fs_unindex_persistence \
262  test_fs_uri \
263  test_gnunet_service_fs_migration \
264  test_gnunet_service_fs_p2p \
265  test_gnunet_service_fs_p2p_cadet \
266  $(FS_BENCHMARKS)
267 endif
268
269 test_plugin_block_fs_SOURCES = \
270  test_plugin_block_fs.c
271 test_plugin_block_fs_LDADD = \
272  $(top_builddir)/src/block/libgnunetblock.la \
273  $(top_builddir)/src/util/libgnunetutil.la
274
275 if HAVE_PYTHON
276 check_SCRIPTS = \
277  test_gnunet_fs_rec.py \
278  test_gnunet_fs_idx.py
279
280 if HAVE_LIBEXTRACTOR
281 check_SCRIPTS += \
282  test_gnunet_fs_psd.py
283 endif
284 endif
285
286
287 if ENABLE_TEST_RUN
288 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)
289 TESTS = \
290  test_fs_directory \
291  test_fs_download \
292  test_fs_download_indexed \
293  test_fs_download_persistence \
294  test_fs_file_information \
295  test_fs_list_indexed \
296  test_fs_namespace \
297  test_fs_namespace_list_updateable \
298  test_fs_publish \
299  test_fs_publish_persistence \
300  test_fs_search \
301  test_fs_search_with_and \
302  test_fs_search_probes \
303  test_fs_search_persistence \
304  test_fs_start_stop \
305  test_fs_unindex \
306  test_fs_unindex_persistence \
307  test_fs_uri \
308  test_fs_test_lib \
309  test_gnunet_service_fs_migration \
310  test_gnunet_service_fs_p2p \
311  test_gnunet_service_fs_p2p_cadet \
312  perf_gnunet_service_fs_p2p \
313  perf_gnunet_service_fs_p2p_index \
314  perf_gnunet_service_fs_p2p_respect \
315  $(check_SCRIPTS)
316 endif
317
318
319 test_fs_directory_SOURCES = \
320  test_fs_directory.c
321 test_fs_directory_LDADD = \
322   libgnunetfs.la  \
323   $(top_builddir)/src/util/libgnunetutil.la
324
325 if HAVE_LIBEXTRACTOR
326 test_fs_directory_LDADD += \
327   -lextractor
328 endif
329
330
331 test_fs_download_SOURCES = \
332  test_fs_download.c
333 test_fs_download_LDADD = \
334   $(top_builddir)/src/testing/libgnunettesting.la  \
335   libgnunetfs.la  \
336   $(top_builddir)/src/util/libgnunetutil.la
337
338 test_fs_download_indexed_SOURCES = \
339  test_fs_download.c
340 test_fs_download_indexed_LDADD = \
341   $(top_builddir)/src/testing/libgnunettesting.la  \
342   libgnunetfs.la  \
343   $(top_builddir)/src/util/libgnunetutil.la
344
345 test_fs_download_cadet_SOURCES = \
346  test_fs_download.c
347 test_fs_download_cadet_LDADD = \
348   $(top_builddir)/src/testing/libgnunettesting.la  \
349   libgnunetfs.la  \
350   $(top_builddir)/src/util/libgnunetutil.la
351
352 test_fs_download_persistence_SOURCES = \
353  test_fs_download_persistence.c
354 test_fs_download_persistence_LDADD = \
355   $(top_builddir)/src/testing/libgnunettesting.la  \
356   libgnunetfs.la  \
357   $(top_builddir)/src/util/libgnunetutil.la
358
359 test_fs_file_information_SOURCES = \
360  test_fs_file_information.c
361 test_fs_file_information_LDADD = \
362   libgnunetfs.la  \
363   $(top_builddir)/src/util/libgnunetutil.la
364
365 if HAVE_LIBEXTRACTOR
366 test_fs_file_information_LDADD += \
367   -lextractor
368 endif
369
370
371 test_fs_getopt_SOURCES = \
372  test_fs_getopt.c
373 test_fs_getopt_LDADD = \
374   libgnunetfs.la  \
375   $(top_builddir)/src/util/libgnunetutil.la
376
377 test_fs_list_indexed_SOURCES = \
378  test_fs_list_indexed.c
379 test_fs_list_indexed_LDADD = \
380   $(top_builddir)/src/testing/libgnunettesting.la \
381   libgnunetfs.la  \
382   $(top_builddir)/src/util/libgnunetutil.la
383
384 test_fs_namespace_SOURCES = \
385  test_fs_namespace.c
386 test_fs_namespace_LDADD = \
387   $(top_builddir)/src/testing/libgnunettesting.la \
388   libgnunetfs.la  \
389   $(top_builddir)/src/util/libgnunetutil.la
390
391 test_fs_namespace_list_updateable_SOURCES = \
392  test_fs_namespace_list_updateable.c
393 test_fs_namespace_list_updateable_LDADD = \
394   $(top_builddir)/src/testing/libgnunettesting.la \
395   libgnunetfs.la  \
396   $(top_builddir)/src/util/libgnunetutil.la
397
398 test_fs_publish_SOURCES = \
399  test_fs_publish.c
400 test_fs_publish_LDADD = \
401   $(top_builddir)/src/testing/libgnunettesting.la \
402   libgnunetfs.la  \
403   $(top_builddir)/src/util/libgnunetutil.la
404
405 test_fs_publish_persistence_SOURCES = \
406  test_fs_publish_persistence.c
407 test_fs_publish_persistence_LDADD = \
408   $(top_builddir)/src/testing/libgnunettesting.la \
409   libgnunetfs.la  \
410   $(top_builddir)/src/util/libgnunetutil.la
411
412 test_fs_search_SOURCES = \
413  test_fs_search.c
414 test_fs_search_LDADD = \
415   $(top_builddir)/src/testing/libgnunettesting.la \
416   libgnunetfs.la        \
417   $(top_builddir)/src/util/libgnunetutil.la
418
419 test_fs_search_with_and_SOURCES = \
420  test_fs_search_with_and.c
421 test_fs_search_with_and_LDADD = \
422   $(top_builddir)/src/testing/libgnunettesting.la \
423   libgnunetfs.la        \
424   $(top_builddir)/src/util/libgnunetutil.la
425
426 test_fs_search_probes_SOURCES = \
427  test_fs_search_probes.c
428 test_fs_search_probes_LDADD = \
429   $(top_builddir)/src/testing/libgnunettesting.la \
430   libgnunetfs.la        \
431   $(top_builddir)/src/util/libgnunetutil.la
432
433 test_fs_search_persistence_SOURCES = \
434  test_fs_search_persistence.c
435 test_fs_search_persistence_LDADD = \
436   $(top_builddir)/src/testing/libgnunettesting.la \
437   libgnunetfs.la        \
438   $(top_builddir)/src/util/libgnunetutil.la
439
440 test_fs_start_stop_SOURCES = \
441  test_fs_start_stop.c
442 test_fs_start_stop_LDADD = \
443   $(top_builddir)/src/testing/libgnunettesting.la \
444   libgnunetfs.la  \
445   $(top_builddir)/src/util/libgnunetutil.la
446
447 test_fs_unindex_SOURCES = \
448  test_fs_unindex.c
449 test_fs_unindex_LDADD = \
450   $(top_builddir)/src/testing/libgnunettesting.la \
451   libgnunetfs.la \
452   $(top_builddir)/src/util/libgnunetutil.la
453
454 test_fs_unindex_persistence_SOURCES = \
455  test_fs_unindex_persistence.c
456 test_fs_unindex_persistence_LDADD = \
457   $(top_builddir)/src/testing/libgnunettesting.la \
458   libgnunetfs.la \
459   $(top_builddir)/src/util/libgnunetutil.la
460
461 test_fs_uri_SOURCES = \
462  test_fs_uri.c
463 test_fs_uri_LDADD = \
464   libgnunetfs.la  \
465   $(top_builddir)/src/util/libgnunetutil.la
466
467 test_fs_test_lib_SOURCES = \
468  test_fs_test_lib.c
469 test_fs_test_lib_LDADD = \
470   libgnunetfstest.a \
471   $(top_builddir)/src/testbed/libgnunettestbed.la \
472   libgnunetfs.la  \
473   $(top_builddir)/src/util/libgnunetutil.la
474
475 test_gnunet_service_fs_p2p_SOURCES = \
476  test_gnunet_service_fs_p2p.c
477 test_gnunet_service_fs_p2p_LDADD = \
478   libgnunetfstest.a \
479   $(top_builddir)/src/testbed/libgnunettestbed.la \
480   libgnunetfs.la  \
481   $(top_builddir)/src/util/libgnunetutil.la
482
483 test_gnunet_service_fs_p2p_cadet_SOURCES = \
484  test_gnunet_service_fs_p2p.c
485 test_gnunet_service_fs_p2p_cadet_LDADD = \
486   libgnunetfstest.a \
487   $(top_builddir)/src/testbed/libgnunettestbed.la \
488   libgnunetfs.la  \
489   $(top_builddir)/src/util/libgnunetutil.la
490
491 test_gnunet_service_fs_migration_SOURCES = \
492  test_gnunet_service_fs_migration.c
493 test_gnunet_service_fs_migration_LDADD = \
494   libgnunetfstest.a \
495   $(top_builddir)/src/testbed/libgnunettestbed.la \
496   libgnunetfs.la  \
497   $(top_builddir)/src/util/libgnunetutil.la
498
499 perf_gnunet_service_fs_p2p_SOURCES = \
500  perf_gnunet_service_fs_p2p.c
501 perf_gnunet_service_fs_p2p_LDADD = \
502   libgnunetfstest.a \
503   $(top_builddir)/src/statistics/libgnunetstatistics.la \
504   $(top_builddir)/src/testbed/libgnunettestbed.la \
505   libgnunetfs.la  \
506   $(top_builddir)/src/util/libgnunetutil.la
507
508 perf_gnunet_service_fs_p2p_index_SOURCES = \
509  perf_gnunet_service_fs_p2p.c
510 perf_gnunet_service_fs_p2p_index_LDADD = \
511   libgnunetfstest.a \
512   $(top_builddir)/src/statistics/libgnunetstatistics.la \
513   $(top_builddir)/src/testbed/libgnunettestbed.la \
514   libgnunetfs.la  \
515   $(top_builddir)/src/util/libgnunetutil.la
516
517 perf_gnunet_service_fs_p2p_dht_SOURCES = \
518  perf_gnunet_service_fs_p2p.c
519 perf_gnunet_service_fs_p2p_dht_LDADD = \
520   libgnunetfstest.a \
521   $(top_builddir)/src/statistics/libgnunetstatistics.la \
522   $(top_builddir)/src/testbed/libgnunettestbed.la \
523   libgnunetfs.la  \
524   $(top_builddir)/src/util/libgnunetutil.la
525
526 perf_gnunet_service_fs_p2p_respect_SOURCES = \
527  perf_gnunet_service_fs_p2p_respect.c
528 perf_gnunet_service_fs_p2p_respect_LDADD = \
529   libgnunetfstest.a \
530   $(top_builddir)/src/statistics/libgnunetstatistics.la \
531   $(top_builddir)/src/testbed/libgnunettestbed.la \
532   libgnunetfs.la  \
533   $(top_builddir)/src/util/libgnunetutil.la
534
535
536 do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g'
537
538 test_gnunet_fs_psd.py: test_gnunet_fs_psd.py.in Makefile
539         $(do_subst) < $(srcdir)/test_gnunet_fs_psd.py.in > test_gnunet_fs_psd.py
540         chmod +x test_gnunet_fs_psd.py
541
542 test_gnunet_fs_rec.py: test_gnunet_fs_rec.py.in Makefile
543         $(do_subst) < $(srcdir)/test_gnunet_fs_rec.py.in > test_gnunet_fs_rec.py
544         chmod +x test_gnunet_fs_rec.py
545
546 test_gnunet_fs_ns.py: test_gnunet_fs_ns.py.in Makefile
547         $(do_subst) < $(srcdir)/test_gnunet_fs_ns.py.in > test_gnunet_fs_ns.py
548         chmod +x test_gnunet_fs_ns.py
549
550 test_gnunet_fs_idx.py: test_gnunet_fs_idx.py.in Makefile
551         $(do_subst) < $(srcdir)/test_gnunet_fs_idx.py.in > test_gnunet_fs_idx.py
552         chmod +x test_gnunet_fs_idx.py
553
554
555 EXTRA_DIST = \
556   fs_test_lib_data.conf \
557   perf_gnunet_service_fs_p2p.conf \
558   test_fs_data.conf \
559   test_fs_defaults.conf \
560   test_fs_download_data.conf \
561   test_fs_download_indexed.conf \
562   test_fs_file_information_data.conf \
563   test_fs_list_indexed_data.conf \
564   test_fs_namespace_data.conf \
565   test_fs_publish_data.conf \
566   test_fs_search_data.conf \
567   test_fs_unindex_data.conf \
568   test_gnunet_fs_idx_data.conf \
569   test_gnunet_fs_psd_data.conf \
570   test_gnunet_fs_rec_data.conf \
571   test_gnunet_fs_rec_data.tgz \
572   test_gnunet_fs_psd.py.in \
573   test_gnunet_fs_rec.py.in \
574   test_gnunet_fs_idx.py.in \
575   test_gnunet_service_fs_migration_data.conf \
576   test_gnunet_service_fs_p2p_cadet.conf \
577   test_pseudonym_data.conf \
578   $(noinst_SCRIPTS)
579
580 CLEANFILES = $(check_SCRIPTS)