first try raw, unexpanded name
[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   LIBATOMIC= -latomic
128 else
129   LIBATOMIC=
130 endif
131
132 if HAVE_LIBIDN
133   LIBIDN= -lidn
134 else
135   LIBIDN=
136 endif
137
138 if HAVE_LIBIDN2
139   LIBIDN2= -lidn2
140 else
141   LIBIDN2=
142 endif
143
144 libgnunetutil_la_LIBADD = \
145   $(GCLIBADD) $(WINLIB) \
146   $(LIBATOMIC) \
147   $(LIBGCRYPT_LIBS) \
148   $(LTLIBICONV) \
149   $(LTLIBINTL) \
150   -lltdl \
151   $(LIBIDN) $(LIBIDN2) \
152   $(Z_LIBS) \
153   -lunistring \
154   $(XLIB) \
155   $(PTHREAD)
156
157 libgnunetutil_la_LDFLAGS = \
158   $(GN_LIB_LDFLAGS) \
159   -version-info 13:0:0
160
161 libgnunetutil_taler_wallet_la_SOURCES = \
162   common_allocation.c \
163   common_endian.c \
164   common_logging.c \
165   container_heap.c \
166   container_multihashmap.c \
167   container_multihashmap32.c \
168   crypto_symmetric.c \
169   crypto_crc.c \
170   crypto_ecc.c \
171   crypto_hash.c \
172   crypto_hkdf.c \
173   crypto_kdf.c \
174   crypto_mpi.c \
175   crypto_random.c \
176   crypto_rsa.c \
177   strings.c \
178   time.c
179
180 libgnunetutil_taler_wallet_la_LIBADD = \
181   $(LIBGCRYPT_LIBS) \
182   -lunistring
183
184 libgnunetutil_taler_wallet_la_LDFLAGS = \
185   $(GN_LIB_LDFLAGS) \
186   -version-info 0:0:0
187
188 if HAVE_TESTING
189   GNUNET_ECC = gnunet-ecc
190   GNUNET_SCRYPT = gnunet-scrypt
191 endif
192
193 if TALER_ONLY
194 lib_LTLIBRARIES = libgnunetutil_taler_wallet.la
195 else
196 lib_LTLIBRARIES = libgnunetutil.la
197
198 libexec_PROGRAMS = \
199  gnunet-service-resolver \
200  gnunet-timeout \
201  $(W32CONSOLEHELPER)
202
203 bin_SCRIPTS =\
204  gnunet-qr
205
206 bin_PROGRAMS = \
207  gnunet-resolver \
208  gnunet-config \
209  $(GNUNET_ECC) \
210  $(GNUNET_SCRYPT) \
211  gnunet-uri
212
213 noinst_PROGRAMS = \
214  gnunet-config-diff \
215  $(W32CAT) \
216  test_common_logging_dummy
217
218
219 if ENABLE_TEST_RUN
220 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
221 TESTS = $(check_PROGRAMS)
222 endif
223
224 endif
225
226
227 if !MINGW
228 gnunet_timeout_SOURCES = \
229  gnunet-timeout.c
230 else
231 gnunet_timeout_SOURCES = \
232  gnunet-timeout-w32.c
233 endif
234
235 # This is horrible, but compared to the alternatives and the solution
236 # which preceded this it is a good compromise and good enough for one
237 # file. Everyone else is invited to patch it locally.
238
239 xENV=$(shell which env)
240
241 do_subst = $(SED) -e 's,[@]ENV[@],${xENV},g'
242
243 gnunet-qr: gnunet-qr.py.in Makefile
244         $(do_subst) < $(top_srcdir)/src/util/gnunet-qr.py.in > gnunet-qr
245         chmod +x gnunet-qr
246
247 gnunet_service_resolver_SOURCES = \
248  gnunet-service-resolver.c
249 gnunet_service_resolver_LDADD = \
250   libgnunetutil.la \
251   $(GN_LIBINTL)
252 if HAVE_GETADDRINFO_A
253 gnunet_service_resolver_LDADD += -lanl
254 endif
255
256
257 gnunet_resolver_SOURCES = \
258  gnunet-resolver.c
259 gnunet_resolver_LDADD = \
260   libgnunetutil.la \
261   $(GN_LIBINTL)
262
263
264 gnunet_ecc_SOURCES = \
265  gnunet-ecc.c
266 gnunet_ecc_LDADD = \
267   libgnunetutil.la \
268   $(GN_LIBINTL) -lgcrypt
269
270 gnunet_scrypt_SOURCES = \
271  gnunet-scrypt.c
272 gnunet_scrypt_LDADD = \
273   libgnunetutil.la \
274   $(GN_LIBINTL) -lgcrypt
275
276
277 gnunet_config_SOURCES = \
278  gnunet-config.c
279 gnunet_config_LDADD = \
280   libgnunetutil.la \
281   $(GN_LIBINTL)
282
283
284 gnunet_uri_SOURCES = \
285  gnunet-uri.c
286 gnunet_uri_LDADD = \
287   libgnunetutil.la \
288   $(GN_LIBINTL)
289
290 plugin_LTLIBRARIES = \
291   libgnunet_plugin_test.la
292
293 libgnunet_plugin_test_la_SOURCES = \
294   test_plugin_plug.c
295 libgnunet_plugin_test_la_LDFLAGS = \
296  $(GN_PLUGIN_LDFLAGS)
297
298 if HAVE_BENCHMARKS
299  BENCHMARKS = \
300   perf_crypto_hash \
301   perf_crypto_ecc_dlog \
302   perf_crypto_rsa \
303   perf_crypto_paillier \
304   perf_crypto_symmetric \
305   perf_crypto_asymmetric \
306   perf_malloc
307 endif
308
309 if HAVE_SSH_KEY
310 # SSH_USING_TESTS = test_socks.nc
311 endif
312
313 check_PROGRAMS = \
314  test_bio \
315  test_client.nc \
316  $(TEST_CLIENT_UNIX_NC) \
317  test_common_allocation \
318  test_common_endian \
319  test_common_logging \
320  test_configuration \
321  test_container_bloomfilter \
322  test_container_dll \
323  test_container_meta_data \
324  test_container_multihashmap \
325  test_container_multihashmap32 \
326  test_container_multipeermap \
327  test_container_heap \
328  test_crypto_symmetric \
329  test_crypto_crc \
330  test_crypto_ecdsa \
331  test_crypto_eddsa \
332  test_crypto_ecdhe \
333  test_crypto_ecdh_eddsa \
334  test_crypto_ecc_dlog \
335  test_crypto_hash \
336  test_crypto_hash_context \
337  test_crypto_hkdf \
338  test_crypto_kdf \
339  test_crypto_paillier \
340  test_crypto_random \
341  test_crypto_rsa \
342  test_disk \
343  test_getopt \
344  test_hexcoder \
345  test_mq \
346  test_os_network \
347  test_peer \
348  test_plugin \
349  test_program \
350  test_regex \
351  test_resolver_api.nc \
352  test_scheduler \
353  test_scheduler_delay \
354  test_service \
355  test_strings \
356  test_strings_to_data \
357  test_speedup \
358  test_time \
359  test_tun \
360  $(BENCHMARKS) \
361  test_os_start_process \
362  test_common_logging_runtime_loglevels
363
364
365 # Declare .nc (NO-CONCURRENCY) as a test extension so that we can impart
366 # sequential execution order for them
367 TEST_EXTENSIONS = .nc
368 test_test_client_unix.log: test_client.log
369
370 test_bio_SOURCES = \
371  test_bio.c
372 test_bio_LDADD = \
373  libgnunetutil.la
374
375 test_hexcoder_SOURCES = \
376  test_hexcoder.c
377 test_hexcoder_LDADD = \
378  libgnunetutil.la
379
380 test_tun_SOURCES = \
381  test_tun.c
382 test_tun_LDADD = \
383  libgnunetutil.la
384
385 test_regex_SOURCES = \
386  test_regex.c
387 test_regex_LDADD = \
388  libgnunetutil.la
389
390 test_os_start_process_SOURCES = \
391  test_os_start_process.c
392 test_os_start_process_LDADD = \
393  libgnunetutil.la
394 test_os_start_process_DEPENDENCIES = \
395  libgnunetutil.la \
396  $(WINCAT)
397
398 test_client_nc_SOURCES = \
399  test_client.c
400 test_client_nc_LDADD = \
401  libgnunetutil.la
402
403 test_client_unix_nc_SOURCES = \
404  test_client.c
405 test_client_unix_nc_LDADD = \
406  libgnunetutil.la
407
408 #test_socks_nc_SOURCES = \
409 # test_socks.c
410 #test_socks_nc_LDADD = \
411 # libgnunetutil.la
412
413 test_common_allocation_SOURCES = \
414  test_common_allocation.c
415 test_common_allocation_LDADD = \
416  libgnunetutil.la
417
418 test_common_endian_SOURCES = \
419  test_common_endian.c
420 test_common_endian_LDADD = \
421  libgnunetutil.la
422
423 test_common_logging_SOURCES = \
424  test_common_logging.c
425 test_common_logging_LDADD = \
426  libgnunetutil.la
427
428 test_common_logging_runtime_loglevels_SOURCES = \
429  test_common_logging_runtime_loglevels.c
430 test_common_logging_runtime_loglevels_LDADD = \
431  libgnunetutil.la
432
433 test_configuration_SOURCES = \
434  test_configuration.c
435 test_configuration_LDADD = \
436  libgnunetutil.la
437
438 test_container_bloomfilter_SOURCES = \
439  test_container_bloomfilter.c
440 test_container_bloomfilter_LDADD = \
441  libgnunetutil.la
442
443 test_container_dll_SOURCES = \
444  test_container_dll.c
445 test_container_dll_LDADD = \
446  libgnunetutil.la
447
448 test_container_meta_data_SOURCES = \
449  test_container_meta_data.c
450 test_container_meta_data_LDADD = \
451  libgnunetutil.la
452
453 test_container_multihashmap_SOURCES = \
454  test_container_multihashmap.c
455 test_container_multihashmap_LDADD = \
456  libgnunetutil.la
457
458 test_container_multihashmap32_SOURCES = \
459  test_container_multihashmap32.c
460 test_container_multihashmap32_LDADD = \
461  libgnunetutil.la
462
463 test_container_multipeermap_SOURCES = \
464  test_container_multipeermap.c
465 test_container_multipeermap_LDADD = \
466  libgnunetutil.la
467
468 test_container_heap_SOURCES = \
469  test_container_heap.c
470 test_container_heap_LDADD = \
471  libgnunetutil.la
472
473 test_crypto_symmetric_SOURCES = \
474  test_crypto_symmetric.c
475 test_crypto_symmetric_LDADD = \
476  libgnunetutil.la
477
478 test_crypto_crc_SOURCES = \
479  test_crypto_crc.c
480 test_crypto_crc_LDADD = \
481  libgnunetutil.la
482
483 test_crypto_ecdsa_SOURCES = \
484  test_crypto_ecdsa.c
485 test_crypto_ecdsa_LDADD = \
486  libgnunetutil.la \
487  $(LIBGCRYPT_LIBS)
488
489 test_crypto_eddsa_SOURCES = \
490  test_crypto_eddsa.c
491 test_crypto_eddsa_LDADD = \
492  libgnunetutil.la \
493  $(LIBGCRYPT_LIBS)
494
495 test_crypto_ecc_dlog_SOURCES = \
496  test_crypto_ecc_dlog.c
497 test_crypto_ecc_dlog_LDADD = \
498  libgnunetutil.la \
499  $(LIBGCRYPT_LIBS)
500
501 test_crypto_ecdhe_SOURCES = \
502  test_crypto_ecdhe.c
503 test_crypto_ecdhe_LDADD = \
504  libgnunetutil.la \
505  $(LIBGCRYPT_LIBS)
506
507 test_crypto_ecdh_eddsa_SOURCES = \
508  test_crypto_ecdh_eddsa.c
509 test_crypto_ecdh_eddsa_LDADD = \
510  libgnunetutil.la \
511  $(LIBGCRYPT_LIBS)
512
513 test_crypto_hash_SOURCES = \
514  test_crypto_hash.c
515 test_crypto_hash_LDADD = \
516  libgnunetutil.la
517
518 test_crypto_hash_context_SOURCES = \
519  test_crypto_hash_context.c
520 test_crypto_hash_context_LDADD = \
521  libgnunetutil.la
522
523 test_crypto_hkdf_SOURCES = \
524  test_crypto_hkdf.c
525 test_crypto_hkdf_LDADD = \
526  libgnunetutil.la
527
528 test_crypto_kdf_SOURCES = \
529  test_crypto_kdf.c
530 test_crypto_kdf_LDADD = \
531  libgnunetutil.la -lgcrypt
532
533 test_crypto_paillier_SOURCES = \
534  test_crypto_paillier.c
535 test_crypto_paillier_LDADD = \
536  $(LIBGCRYPT_LIBS) \
537  libgnunetutil.la
538
539 test_crypto_random_SOURCES = \
540  test_crypto_random.c
541 test_crypto_random_LDADD = \
542  libgnunetutil.la
543
544 test_crypto_rsa_SOURCES = \
545  test_crypto_rsa.c
546 test_crypto_rsa_LDADD = \
547  libgnunetutil.la -lgcrypt
548
549 test_disk_SOURCES = \
550  test_disk.c
551 test_disk_LDADD = \
552  libgnunetutil.la
553
554 test_getopt_SOURCES = \
555  test_getopt.c
556 test_getopt_LDADD = \
557  libgnunetutil.la
558
559 test_mq_SOURCES = \
560  test_mq.c
561 test_mq_LDADD = \
562  libgnunetutil.la
563
564 test_os_network_SOURCES = \
565  test_os_network.c
566 test_os_network_LDADD = \
567  libgnunetutil.la
568
569 test_peer_SOURCES = \
570  test_peer.c
571 test_peer_LDADD = \
572  libgnunetutil.la -lgcrypt
573
574 test_plugin_SOURCES = \
575  test_plugin.c
576 test_plugin_LDADD = \
577  libgnunetutil.la
578
579 test_program_SOURCES = \
580  test_program.c
581 test_program_LDADD = \
582  libgnunetutil.la
583
584 test_resolver_api_nc_SOURCES = \
585  test_resolver_api.c
586 test_resolver_api_nc_LDADD = \
587  libgnunetutil.la
588
589 test_scheduler_SOURCES = \
590  test_scheduler.c
591 test_scheduler_LDADD = \
592  libgnunetutil.la
593
594 test_scheduler_delay_SOURCES = \
595  test_scheduler_delay.c
596 test_scheduler_delay_LDADD = \
597  libgnunetutil.la
598
599 test_service_SOURCES = \
600  test_service.c
601 test_service_LDADD = \
602  libgnunetutil.la
603
604 test_strings_SOURCES = \
605  test_strings.c
606 test_strings_LDADD = \
607  libgnunetutil.la
608
609 test_strings_to_data_SOURCES = \
610  test_strings_to_data.c
611 test_strings_to_data_LDADD = \
612  libgnunetutil.la
613
614
615 test_time_SOURCES = \
616  test_time.c
617 test_time_LDADD = \
618  libgnunetutil.la
619
620 test_speedup_SOURCES = \
621  test_speedup.c
622 test_speedup_LDADD = \
623  libgnunetutil.la
624
625 perf_crypto_hash_SOURCES = \
626  perf_crypto_hash.c
627 perf_crypto_hash_LDADD = \
628  libgnunetutil.la
629
630 perf_crypto_ecc_dlog_SOURCES = \
631  perf_crypto_ecc_dlog.c
632 perf_crypto_ecc_dlog_LDADD = \
633  libgnunetutil.la \
634  -lgcrypt
635
636 perf_crypto_rsa_SOURCES = \
637  perf_crypto_rsa.c
638 perf_crypto_rsa_LDADD = \
639  libgnunetutil.la
640
641 perf_crypto_symmetric_SOURCES = \
642  perf_crypto_symmetric.c
643 perf_crypto_symmetric_LDADD = \
644  libgnunetutil.la
645
646 perf_crypto_asymmetric_SOURCES = \
647  perf_crypto_asymmetric.c
648 perf_crypto_asymmetric_LDADD = \
649  libgnunetutil.la
650
651 perf_crypto_paillier_SOURCES = \
652  perf_crypto_paillier.c
653 perf_crypto_paillier_LDADD = \
654  libgnunetutil.la \
655  -lgcrypt
656
657 perf_malloc_SOURCES = \
658  perf_malloc.c
659 perf_malloc_LDADD = \
660  libgnunetutil.la
661
662
663 EXTRA_DIST = \
664   test_client_data.conf \
665   test_client_unix.conf \
666   test_configuration_data.conf \
667   test_program_data.conf \
668   test_resolver_api_data.conf \
669   test_service_data.conf \
670   test_speedup_data.conf \
671   gnunet-qr.py.in