move copying to rest
[oweals/gnunet.git] / src / util / Makefile.am
1 # This Makefile.am is in the public domain
2 AM_CPPFLAGS = -I$(top_srcdir)/src/include
3
4 plugindir = $(libdir)/gnunet
5
6 libexecdir= $(pkglibdir)/libexec/
7
8 pkgcfgdir= $(pkgdatadir)/config.d/
9
10 dist_pkgcfg_DATA = \
11   util.conf
12
13 pkgcfg_DATA = \
14   resolver.conf
15
16 if MINGW
17 noinst_LTLIBRARIES = \
18   libgnunetutilwin.la
19 libgnunetutilwin_la_SOURCES = \
20   win.c \
21   winproc.c
22 libgnunetutilwin_la_LDFLAGS = \
23   -no-undefined -Wl,--export-all-symbols
24 libgnunetutilwin_la_LIBADD = \
25   -lshell32 -liconv -lstdc++ \
26   -lcomdlg32 -lgdi32 -liphlpapi
27 WINLIB = libgnunetutilwin.la
28 W32CAT = w32cat
29 W32CONSOLEHELPER = gnunet-helper-w32-console
30 endif
31
32 if !MINGW
33  TEST_CLIENT_UNIX_NC = test_client_unix.nc
34 else
35  TEST_CLIENT_UNIX_NC =
36 endif
37
38 if USE_COVERAGE
39   AM_CFLAGS = --coverage -O0
40   XLIB = -lgcov
41 endif
42
43 if ENABLE_BENCHMARK
44   BENCHMARK = benchmark.c benchmark.h
45   PTHREAD = -lpthread
46 endif
47
48 w32cat_SOURCES = w32cat.c
49
50 gnunet_helper_w32_console_SOURCES = \
51   gnunet-helper-w32-console.c \
52   gnunet-helper-w32-console.h
53 gnunet_helper_w32_console_LDADD = \
54   libgnunetutil.la
55
56 gnunet_config_diff_SOURCES = \
57  gnunet-config-diff.c
58 gnunet_config_diff_LDADD = \
59  libgnunetutil.la
60
61 test_common_logging_dummy_SOURCES = \
62  test_common_logging_dummy.c
63 test_common_logging_dummy_LDADD = \
64  libgnunetutil.la
65
66 libgnunetutil_la_SOURCES = \
67   bandwidth.c \
68   $(BENCHMARK) \
69   bio.c \
70   client.c \
71   common_allocation.c \
72   common_endian.c \
73   common_logging.c \
74   configuration.c \
75   configuration_loader.c \
76   container_bloomfilter.c \
77   container_heap.c \
78   container_meta_data.c \
79   container_multihashmap.c \
80   container_multishortmap.c \
81   container_multipeermap.c \
82   container_multihashmap32.c \
83   crypto_symmetric.c \
84   crypto_crc.c \
85   crypto_ecc.c \
86   crypto_ecc_dlog.c \
87   crypto_ecc_setup.c \
88   crypto_hash.c \
89   crypto_hash_file.c \
90   crypto_hkdf.c \
91   crypto_kdf.c \
92   crypto_mpi.c \
93   crypto_paillier.c \
94   crypto_random.c \
95   crypto_rsa.c \
96   disk.c \
97   disk.h \
98   dnsparser.c \
99   dnsstub.c \
100   getopt.c \
101   getopt_helpers.c \
102   helper.c \
103   load.c \
104   mst.c \
105   mq.c \
106   nc.c \
107   network.c \
108   op.c \
109   os_installation.c \
110   os_network.c \
111   os_priority.c \
112   peer.c \
113   plugin.c \
114   program.c \
115   regex.c \
116   resolver_api.c resolver.h \
117   scheduler.c \
118   service.c \
119   signal.c \
120   strings.c \
121   time.c \
122   tun.c \
123   speedup.c speedup.h \
124   proc_compat.c
125
126 if HAVE_LIBATOMIC
127 if DARWIN
128         LIBATOMIC=
129 else
130   LIBATOMIC= -latomic
131 endif
132 else
133   LIBATOMIC=
134 endif
135
136 if HAVE_LIBIDN
137   LIBIDN= -lidn
138 else
139   LIBIDN=
140 endif
141
142 if HAVE_LIBIDN2
143   LIBIDN2= -lidn2
144 else
145   LIBIDN2=
146 endif
147
148 libgnunetutil_la_LIBADD = \
149   $(GCLIBADD) $(WINLIB) \
150   $(LIBATOMIC) \
151   $(LIBGCRYPT_LIBS) \
152   $(LTLIBICONV) \
153   $(LTLIBINTL) \
154   -lltdl \
155   $(LIBIDN) $(LIBIDN2) \
156   $(Z_LIBS) \
157   -lunistring \
158   $(XLIB) \
159   $(PTHREAD)
160
161 libgnunetutil_la_LDFLAGS = \
162   $(GN_LIB_LDFLAGS) \
163   -version-info 13:0:0
164
165 libgnunetutil_taler_wallet_la_SOURCES = \
166   common_allocation.c \
167   common_endian.c \
168   common_logging.c \
169   container_heap.c \
170   container_multihashmap.c \
171   container_multihashmap32.c \
172   crypto_symmetric.c \
173   crypto_crc.c \
174   crypto_ecc.c \
175   crypto_hash.c \
176   crypto_hkdf.c \
177   crypto_kdf.c \
178   crypto_mpi.c \
179   crypto_random.c \
180   crypto_rsa.c \
181   strings.c \
182   time.c
183
184 libgnunetutil_taler_wallet_la_LIBADD = \
185   $(LIBGCRYPT_LIBS) \
186   -lunistring
187
188 libgnunetutil_taler_wallet_la_LDFLAGS = \
189   $(GN_LIB_LDFLAGS) \
190   -version-info 0:0:0
191
192 if HAVE_TESTING
193   GNUNET_ECC = gnunet-ecc
194   GNUNET_SCRYPT = gnunet-scrypt
195 endif
196
197 if TALER_ONLY
198 lib_LTLIBRARIES = libgnunetutil_taler_wallet.la
199 else
200 lib_LTLIBRARIES = libgnunetutil.la
201
202 libexec_PROGRAMS = \
203  gnunet-service-resolver \
204  gnunet-timeout \
205  $(W32CONSOLEHELPER)
206
207 do_subst = $(SED) -e 's,[@]PREFIX[@],$(prefix),g'
208
209 gnunet-qr: gnunet-qr.in Makefile
210         $(do_subst) < $(srcdir)/gnunet-qr.in > gnunet-qr
211         chmod +x gnunet-qr
212
213 CLEANFILES = gnunet-qr
214
215 pkgdata_DATA = \
216   gnunet-qr.py
217
218 bin_SCRIPTS =\
219  gnunet-qr
220
221 bin_PROGRAMS = \
222  gnunet-resolver \
223  gnunet-config \
224  $(GNUNET_ECC) \
225  $(GNUNET_SCRYPT) \
226  gnunet-uri
227
228 noinst_PROGRAMS = \
229  gnunet-config-diff \
230  $(W32CAT) \
231  test_common_logging_dummy
232
233
234 if ENABLE_TEST_RUN
235 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
236 TESTS = $(check_PROGRAMS)
237 endif
238
239 endif
240
241
242 if !MINGW
243 gnunet_timeout_SOURCES = \
244  gnunet-timeout.c
245 else
246 gnunet_timeout_SOURCES = \
247  gnunet-timeout-w32.c
248 endif
249
250 gnunet_service_resolver_SOURCES = \
251  gnunet-service-resolver.c
252 gnunet_service_resolver_LDADD = \
253   libgnunetutil.la \
254   $(GN_LIBINTL)
255 if HAVE_GETADDRINFO_A
256 gnunet_service_resolver_LDADD += -lanl
257 endif
258
259
260 gnunet_resolver_SOURCES = \
261  gnunet-resolver.c
262 gnunet_resolver_LDADD = \
263   libgnunetutil.la \
264   $(GN_LIBINTL)
265
266
267 gnunet_ecc_SOURCES = \
268  gnunet-ecc.c
269 gnunet_ecc_LDADD = \
270   libgnunetutil.la \
271   $(GN_LIBINTL) -lgcrypt
272
273 gnunet_scrypt_SOURCES = \
274  gnunet-scrypt.c
275 gnunet_scrypt_LDADD = \
276   libgnunetutil.la \
277   $(GN_LIBINTL) -lgcrypt
278
279
280 gnunet_config_SOURCES = \
281  gnunet-config.c
282 gnunet_config_LDADD = \
283   libgnunetutil.la \
284   $(GN_LIBINTL)
285
286
287 gnunet_uri_SOURCES = \
288  gnunet-uri.c
289 gnunet_uri_LDADD = \
290   libgnunetutil.la \
291   $(GN_LIBINTL)
292
293 plugin_LTLIBRARIES = \
294   libgnunet_plugin_test.la
295
296 libgnunet_plugin_test_la_SOURCES = \
297   test_plugin_plug.c
298 libgnunet_plugin_test_la_LDFLAGS = \
299  $(GN_PLUGIN_LDFLAGS)
300
301 if HAVE_BENCHMARKS
302  BENCHMARKS = \
303   perf_crypto_hash \
304   perf_crypto_ecc_dlog \
305   perf_crypto_rsa \
306   perf_crypto_paillier \
307   perf_crypto_symmetric \
308   perf_crypto_asymmetric \
309   perf_malloc
310 endif
311
312 if HAVE_SSH_KEY
313 # SSH_USING_TESTS = test_socks.nc
314 endif
315
316 check_PROGRAMS = \
317  test_bio \
318  test_client.nc \
319  $(TEST_CLIENT_UNIX_NC) \
320  test_common_allocation \
321  test_common_endian \
322  test_common_logging \
323  test_configuration \
324  test_container_bloomfilter \
325  test_container_dll \
326  test_container_meta_data \
327  test_container_multihashmap \
328  test_container_multihashmap32 \
329  test_container_multipeermap \
330  test_container_heap \
331  test_crypto_symmetric \
332  test_crypto_crc \
333  test_crypto_ecdsa \
334  test_crypto_eddsa \
335  test_crypto_ecdhe \
336  test_crypto_ecdh_eddsa \
337  test_crypto_ecc_dlog \
338  test_crypto_hash \
339  test_crypto_hash_context \
340  test_crypto_hkdf \
341  test_crypto_kdf \
342  test_crypto_paillier \
343  test_crypto_random \
344  test_crypto_rsa \
345  test_disk \
346  test_getopt \
347  test_hexcoder \
348  test_mq \
349  test_os_network \
350  test_peer \
351  test_plugin \
352  test_program \
353  test_regex \
354  test_resolver_api.nc \
355  test_scheduler \
356  test_scheduler_delay \
357  test_service \
358  test_strings \
359  test_strings_to_data \
360  test_speedup \
361  test_time \
362  test_tun \
363  $(BENCHMARKS) \
364  test_os_start_process \
365  test_common_logging_runtime_loglevels
366
367
368 # Declare .nc (NO-CONCURRENCY) as a test extension so that we can impart
369 # sequential execution order for them
370 TEST_EXTENSIONS = .nc
371 test_test_client_unix.log: test_client.log
372
373 test_bio_SOURCES = \
374  test_bio.c
375 test_bio_LDADD = \
376  libgnunetutil.la
377
378 test_hexcoder_SOURCES = \
379  test_hexcoder.c
380 test_hexcoder_LDADD = \
381  libgnunetutil.la
382
383 test_tun_SOURCES = \
384  test_tun.c
385 test_tun_LDADD = \
386  libgnunetutil.la
387
388 test_regex_SOURCES = \
389  test_regex.c
390 test_regex_LDADD = \
391  libgnunetutil.la
392
393 test_os_start_process_SOURCES = \
394  test_os_start_process.c
395 test_os_start_process_LDADD = \
396  libgnunetutil.la
397 test_os_start_process_DEPENDENCIES = \
398  libgnunetutil.la \
399  $(WINCAT)
400
401 test_client_nc_SOURCES = \
402  test_client.c
403 test_client_nc_LDADD = \
404  libgnunetutil.la
405
406 test_client_unix_nc_SOURCES = \
407  test_client.c
408 test_client_unix_nc_LDADD = \
409  libgnunetutil.la
410
411 #test_socks_nc_SOURCES = \
412 # test_socks.c
413 #test_socks_nc_LDADD = \
414 # libgnunetutil.la
415
416 test_common_allocation_SOURCES = \
417  test_common_allocation.c
418 test_common_allocation_LDADD = \
419  libgnunetutil.la
420
421 test_common_endian_SOURCES = \
422  test_common_endian.c
423 test_common_endian_LDADD = \
424  libgnunetutil.la
425
426 test_common_logging_SOURCES = \
427  test_common_logging.c
428 test_common_logging_LDADD = \
429  libgnunetutil.la
430
431 test_common_logging_runtime_loglevels_SOURCES = \
432  test_common_logging_runtime_loglevels.c
433 test_common_logging_runtime_loglevels_LDADD = \
434  libgnunetutil.la
435
436 test_configuration_SOURCES = \
437  test_configuration.c
438 test_configuration_LDADD = \
439  libgnunetutil.la
440
441 test_container_bloomfilter_SOURCES = \
442  test_container_bloomfilter.c
443 test_container_bloomfilter_LDADD = \
444  libgnunetutil.la
445
446 test_container_dll_SOURCES = \
447  test_container_dll.c
448 test_container_dll_LDADD = \
449  libgnunetutil.la
450
451 test_container_meta_data_SOURCES = \
452  test_container_meta_data.c
453 test_container_meta_data_LDADD = \
454  libgnunetutil.la
455
456 test_container_multihashmap_SOURCES = \
457  test_container_multihashmap.c
458 test_container_multihashmap_LDADD = \
459  libgnunetutil.la
460
461 test_container_multihashmap32_SOURCES = \
462  test_container_multihashmap32.c
463 test_container_multihashmap32_LDADD = \
464  libgnunetutil.la
465
466 test_container_multipeermap_SOURCES = \
467  test_container_multipeermap.c
468 test_container_multipeermap_LDADD = \
469  libgnunetutil.la
470
471 test_container_heap_SOURCES = \
472  test_container_heap.c
473 test_container_heap_LDADD = \
474  libgnunetutil.la
475
476 test_crypto_symmetric_SOURCES = \
477  test_crypto_symmetric.c
478 test_crypto_symmetric_LDADD = \
479  libgnunetutil.la
480
481 test_crypto_crc_SOURCES = \
482  test_crypto_crc.c
483 test_crypto_crc_LDADD = \
484  libgnunetutil.la
485
486 test_crypto_ecdsa_SOURCES = \
487  test_crypto_ecdsa.c
488 test_crypto_ecdsa_LDADD = \
489  libgnunetutil.la \
490  $(LIBGCRYPT_LIBS)
491
492 test_crypto_eddsa_SOURCES = \
493  test_crypto_eddsa.c
494 test_crypto_eddsa_LDADD = \
495  libgnunetutil.la \
496  $(LIBGCRYPT_LIBS)
497
498 test_crypto_ecc_dlog_SOURCES = \
499  test_crypto_ecc_dlog.c
500 test_crypto_ecc_dlog_LDADD = \
501  libgnunetutil.la \
502  $(LIBGCRYPT_LIBS)
503
504 test_crypto_ecdhe_SOURCES = \
505  test_crypto_ecdhe.c
506 test_crypto_ecdhe_LDADD = \
507  libgnunetutil.la \
508  $(LIBGCRYPT_LIBS)
509
510 test_crypto_ecdh_eddsa_SOURCES = \
511  test_crypto_ecdh_eddsa.c
512 test_crypto_ecdh_eddsa_LDADD = \
513  libgnunetutil.la \
514  $(LIBGCRYPT_LIBS)
515
516 test_crypto_hash_SOURCES = \
517  test_crypto_hash.c
518 test_crypto_hash_LDADD = \
519  libgnunetutil.la
520
521 test_crypto_hash_context_SOURCES = \
522  test_crypto_hash_context.c
523 test_crypto_hash_context_LDADD = \
524  libgnunetutil.la
525
526 test_crypto_hkdf_SOURCES = \
527  test_crypto_hkdf.c
528 test_crypto_hkdf_LDADD = \
529  libgnunetutil.la
530
531 test_crypto_kdf_SOURCES = \
532  test_crypto_kdf.c
533 test_crypto_kdf_LDADD = \
534  libgnunetutil.la -lgcrypt
535
536 test_crypto_paillier_SOURCES = \
537  test_crypto_paillier.c
538 test_crypto_paillier_LDADD = \
539  $(LIBGCRYPT_LIBS) \
540  libgnunetutil.la
541
542 test_crypto_random_SOURCES = \
543  test_crypto_random.c
544 test_crypto_random_LDADD = \
545  libgnunetutil.la
546
547 test_crypto_rsa_SOURCES = \
548  test_crypto_rsa.c
549 test_crypto_rsa_LDADD = \
550  libgnunetutil.la -lgcrypt
551
552 test_disk_SOURCES = \
553  test_disk.c
554 test_disk_LDADD = \
555  libgnunetutil.la
556
557 test_getopt_SOURCES = \
558  test_getopt.c
559 test_getopt_LDADD = \
560  libgnunetutil.la
561
562 test_mq_SOURCES = \
563  test_mq.c
564 test_mq_LDADD = \
565  libgnunetutil.la
566
567 test_os_network_SOURCES = \
568  test_os_network.c
569 test_os_network_LDADD = \
570  libgnunetutil.la
571
572 test_peer_SOURCES = \
573  test_peer.c
574 test_peer_LDADD = \
575  libgnunetutil.la -lgcrypt
576
577 test_plugin_SOURCES = \
578  test_plugin.c
579 test_plugin_LDADD = \
580  libgnunetutil.la
581
582 test_program_SOURCES = \
583  test_program.c
584 test_program_LDADD = \
585  libgnunetutil.la
586
587 test_resolver_api_nc_SOURCES = \
588  test_resolver_api.c
589 test_resolver_api_nc_LDADD = \
590  libgnunetutil.la
591
592 test_scheduler_SOURCES = \
593  test_scheduler.c
594 test_scheduler_LDADD = \
595  libgnunetutil.la
596
597 test_scheduler_delay_SOURCES = \
598  test_scheduler_delay.c
599 test_scheduler_delay_LDADD = \
600  libgnunetutil.la
601
602 test_service_SOURCES = \
603  test_service.c
604 test_service_LDADD = \
605  libgnunetutil.la
606
607 test_strings_SOURCES = \
608  test_strings.c
609 test_strings_LDADD = \
610  libgnunetutil.la
611
612 test_strings_to_data_SOURCES = \
613  test_strings_to_data.c
614 test_strings_to_data_LDADD = \
615  libgnunetutil.la
616
617
618 test_time_SOURCES = \
619  test_time.c
620 test_time_LDADD = \
621  libgnunetutil.la
622
623 test_speedup_SOURCES = \
624  test_speedup.c
625 test_speedup_LDADD = \
626  libgnunetutil.la
627
628 perf_crypto_hash_SOURCES = \
629  perf_crypto_hash.c
630 perf_crypto_hash_LDADD = \
631  libgnunetutil.la
632
633 perf_crypto_ecc_dlog_SOURCES = \
634  perf_crypto_ecc_dlog.c
635 perf_crypto_ecc_dlog_LDADD = \
636  libgnunetutil.la \
637  -lgcrypt
638
639 perf_crypto_rsa_SOURCES = \
640  perf_crypto_rsa.c
641 perf_crypto_rsa_LDADD = \
642  libgnunetutil.la
643
644 perf_crypto_symmetric_SOURCES = \
645  perf_crypto_symmetric.c
646 perf_crypto_symmetric_LDADD = \
647  libgnunetutil.la
648
649 perf_crypto_asymmetric_SOURCES = \
650  perf_crypto_asymmetric.c
651 perf_crypto_asymmetric_LDADD = \
652  libgnunetutil.la
653
654 perf_crypto_paillier_SOURCES = \
655  perf_crypto_paillier.c
656 perf_crypto_paillier_LDADD = \
657  libgnunetutil.la \
658  -lgcrypt
659
660 perf_malloc_SOURCES = \
661  perf_malloc.c
662 perf_malloc_LDADD = \
663  libgnunetutil.la
664
665
666 EXTRA_DIST = \
667   test_client_data.conf \
668   test_client_unix.conf \
669   test_configuration_data.conf \
670   test_program_data.conf \
671   test_resolver_api_data.conf \
672   test_service_data.conf \
673   test_speedup_data.conf \
674   gnunet-qr.in \
675   gnunet-qr.py