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