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