f49aee17fa8a6cdc2d3d5e30b0c825ac627f8dfb
[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_meta_data \
277  test_container_multihashmap \
278  test_container_multihashmap32 \
279  test_container_multipeermap \
280  test_container_heap \
281  test_crypto_symmetric \
282  test_crypto_crc \
283  test_crypto_ecdsa \
284  test_crypto_eddsa \
285  test_crypto_ecdhe \
286  test_crypto_ecdh_eddsa \
287  test_crypto_ecc_dlog \
288  test_crypto_hash \
289  test_crypto_hash_context \
290  test_crypto_hkdf \
291  test_crypto_kdf \
292  test_crypto_paillier \
293  test_crypto_random \
294  test_crypto_rsa \
295  test_disk \
296  test_getopt \
297  test_connection.nc \
298  test_connection_addressing.nc \
299  test_connection_receive_cancel.nc \
300  test_connection_timeout.nc \
301  test_connection_timeout_no_connect.nc \
302  test_connection_transmit_cancel.nc \
303  test_mq \
304  test_os_network \
305  test_peer \
306  test_plugin \
307  test_program \
308  test_resolver_api.nc \
309  test_scheduler \
310  test_scheduler_delay \
311  test_server.nc \
312  test_server_disconnect.nc \
313  test_server_with_client.nc \
314  test_server_mst_interrupt.nc \
315  $(SERVER_CLIENT_UNIX) \
316  test_service \
317  test_strings \
318  test_strings_to_data \
319  test_time \
320  test_speedup \
321  $(BENCHMARKS) \
322  test_os_start_process \
323  test_common_logging_runtime_loglevels
324
325
326 # Declare .nc (NO-CONCURRENCY) as a test extension so that we can impart
327 # sequential execution order for them
328 TEST_EXTENSIONS = .nc
329 test_connection.log: test_client.log
330 test_connection_addressing.log: test_connection.log
331 test_connection_timeout_no_connect.log: test_connection_addressing.log
332 test_connection_transmit_cancel.log: test_connection_timeout_no_connect.log
333 test_connection_receive_cancel.log: test_connection_transmit_cancel.log
334 test_connection_timeout.log: test_connection_receive_cancel.log
335 test_resolver_api.log: test_connection_timeout.log
336 test_server.log: test_resolver_api.log
337 test_server_disconnect.log: test_server.log
338 test_server_with_client.log: test_server_disconnect.log
339 test_server_mst_interrupt.log: test_server_with_client.log
340 test_client_unix.log: test_server_mst_interrupt.log
341
342 test_bio_SOURCES = \
343  test_bio.c
344 test_bio_LDADD = \
345  libgnunetutil.la
346
347
348 test_os_start_process_SOURCES = \
349  test_os_start_process.c
350 test_os_start_process_LDADD = \
351  libgnunetutil.la
352 test_os_start_process_DEPENDENCIES = \
353  libgnunetutil.la \
354  $(WINCAT)
355
356 test_client_nc_SOURCES = \
357  test_client.c
358 test_client_nc_LDADD = \
359  libgnunetutil.la
360
361 test_client_unix_nc_SOURCES = \
362  test_client.c
363 test_client_unix_nc_LDADD = \
364  libgnunetutil.la
365
366 test_socks_nc_SOURCES = \
367  test_socks.c
368 test_socks_nc_LDADD = \
369  libgnunetutil.la
370
371 test_common_allocation_SOURCES = \
372  test_common_allocation.c
373 test_common_allocation_LDADD = \
374  libgnunetutil.la
375
376 test_common_endian_SOURCES = \
377  test_common_endian.c
378 test_common_endian_LDADD = \
379  libgnunetutil.la
380
381 test_common_logging_SOURCES = \
382  test_common_logging.c
383 test_common_logging_LDADD = \
384  libgnunetutil.la
385
386 test_common_logging_runtime_loglevels_SOURCES = \
387  test_common_logging_runtime_loglevels.c
388 test_common_logging_runtime_loglevels_LDADD = \
389  libgnunetutil.la
390
391 test_configuration_SOURCES = \
392  test_configuration.c
393 test_configuration_LDADD = \
394  libgnunetutil.la
395
396 test_container_bloomfilter_SOURCES = \
397  test_container_bloomfilter.c
398 test_container_bloomfilter_LDADD = \
399  libgnunetutil.la
400
401 test_container_meta_data_SOURCES = \
402  test_container_meta_data.c
403 test_container_meta_data_LDADD = \
404  libgnunetutil.la -lextractor
405
406 test_container_multihashmap_SOURCES = \
407  test_container_multihashmap.c
408 test_container_multihashmap_LDADD = \
409  libgnunetutil.la
410
411 test_container_multihashmap32_SOURCES = \
412  test_container_multihashmap32.c
413 test_container_multihashmap32_LDADD = \
414  libgnunetutil.la
415
416 test_container_multipeermap_SOURCES = \
417  test_container_multipeermap.c
418 test_container_multipeermap_LDADD = \
419  libgnunetutil.la
420
421 test_container_heap_SOURCES = \
422  test_container_heap.c
423 test_container_heap_LDADD = \
424  libgnunetutil.la
425
426 test_crypto_symmetric_SOURCES = \
427  test_crypto_symmetric.c
428 test_crypto_symmetric_LDADD = \
429  libgnunetutil.la
430
431 test_crypto_crc_SOURCES = \
432  test_crypto_crc.c
433 test_crypto_crc_LDADD = \
434  libgnunetutil.la
435
436 test_crypto_ecdsa_SOURCES = \
437  test_crypto_ecdsa.c
438 test_crypto_ecdsa_LDADD = \
439  libgnunetutil.la \
440  $(LIBGCRYPT_LIBS)
441
442 test_crypto_eddsa_SOURCES = \
443  test_crypto_eddsa.c
444 test_crypto_eddsa_LDADD = \
445  libgnunetutil.la \
446  $(LIBGCRYPT_LIBS)
447
448 test_crypto_ecc_dlog_SOURCES = \
449  test_crypto_ecc_dlog.c
450 test_crypto_ecc_dlog_LDADD = \
451  libgnunetutil.la \
452  $(LIBGCRYPT_LIBS)
453
454 test_crypto_ecdhe_SOURCES = \
455  test_crypto_ecdhe.c
456 test_crypto_ecdhe_LDADD = \
457  libgnunetutil.la \
458  $(LIBGCRYPT_LIBS)
459
460 test_crypto_ecdh_eddsa_SOURCES = \
461  test_crypto_ecdh_eddsa.c
462 test_crypto_ecdh_eddsa_LDADD = \
463  libgnunetutil.la \
464  $(LIBGCRYPT_LIBS)
465
466 test_crypto_hash_SOURCES = \
467  test_crypto_hash.c
468 test_crypto_hash_LDADD = \
469  libgnunetutil.la
470
471 test_crypto_hash_context_SOURCES = \
472  test_crypto_hash_context.c
473 test_crypto_hash_context_LDADD = \
474  libgnunetutil.la
475
476 test_crypto_hkdf_SOURCES = \
477  test_crypto_hkdf.c
478 test_crypto_hkdf_LDADD = \
479  libgnunetutil.la
480
481 test_crypto_kdf_SOURCES = \
482  test_crypto_kdf.c
483 test_crypto_kdf_LDADD = \
484  libgnunetutil.la -lgcrypt
485
486 test_crypto_paillier_SOURCES = \
487  test_crypto_paillier.c
488 test_crypto_paillier_LDADD = \
489  $(LIBGCRYPT_LIBS) \
490  libgnunetutil.la
491
492 test_crypto_random_SOURCES = \
493  test_crypto_random.c
494 test_crypto_random_LDADD = \
495  libgnunetutil.la
496
497 test_crypto_rsa_SOURCES = \
498  test_crypto_rsa.c
499 test_crypto_rsa_LDADD = \
500  libgnunetutil.la -lgcrypt
501
502 test_disk_SOURCES = \
503  test_disk.c
504 test_disk_LDADD = \
505  libgnunetutil.la
506
507 test_getopt_SOURCES = \
508  test_getopt.c
509 test_getopt_LDADD = \
510  libgnunetutil.la
511
512 test_connection_nc_SOURCES = \
513  test_connection.c
514 test_connection_nc_LDADD = \
515  libgnunetutil.la
516
517 test_connection_addressing_nc_SOURCES = \
518  test_connection_addressing.c
519 test_connection_addressing_nc_LDADD = \
520  libgnunetutil.la
521
522 test_connection_receive_cancel_nc_SOURCES = \
523  test_connection_receive_cancel.c
524 test_connection_receive_cancel_nc_LDADD = \
525  libgnunetutil.la
526
527 test_connection_timeout_nc_SOURCES = \
528  test_connection_timeout.c
529 test_connection_timeout_nc_LDADD = \
530  libgnunetutil.la
531
532 test_connection_timeout_no_connect_nc_SOURCES = \
533  test_connection_timeout_no_connect.c
534 test_connection_timeout_no_connect_nc_LDADD = \
535  libgnunetutil.la
536
537 test_connection_transmit_cancel_nc_SOURCES = \
538  test_connection_transmit_cancel.c
539 test_connection_transmit_cancel_nc_LDADD = \
540  libgnunetutil.la
541
542 test_mq_SOURCES = \
543  test_mq.c
544 test_mq_LDADD = \
545  libgnunetutil.la
546
547 test_os_network_SOURCES = \
548  test_os_network.c
549 test_os_network_LDADD = \
550  libgnunetutil.la
551
552 test_peer_SOURCES = \
553  test_peer.c
554 test_peer_LDADD = \
555  libgnunetutil.la -lgcrypt
556
557 test_plugin_SOURCES = \
558  test_plugin.c
559 test_plugin_LDADD = \
560  libgnunetutil.la
561
562 test_program_SOURCES = \
563  test_program.c
564 test_program_LDADD = \
565  libgnunetutil.la
566
567 test_resolver_api_nc_SOURCES = \
568  test_resolver_api.c
569 test_resolver_api_nc_LDADD = \
570  libgnunetutil.la
571
572 test_scheduler_SOURCES = \
573  test_scheduler.c
574 test_scheduler_LDADD = \
575  libgnunetutil.la
576
577 test_scheduler_delay_SOURCES = \
578  test_scheduler_delay.c
579 test_scheduler_delay_LDADD = \
580  libgnunetutil.la
581
582 test_server_mst_interrupt_nc_SOURCES = \
583  test_server_mst_interrupt.c
584 test_server_mst_interrupt_nc_LDADD = \
585  libgnunetutil.la
586
587 test_server_nc_SOURCES = \
588  test_server.c
589 test_server_nc_LDADD = \
590  libgnunetutil.la
591
592 test_server_disconnect_nc_SOURCES = \
593  test_server_disconnect.c
594 test_server_disconnect_nc_LDADD = \
595  libgnunetutil.la
596
597 test_server_with_client_nc_SOURCES = \
598  test_server_with_client.c
599 test_server_with_client_nc_LDADD = \
600  libgnunetutil.la
601
602 test_server_with_client_unix_SOURCES = \
603  test_server_with_client_unix.c
604 test_server_with_client_unix_LDADD = \
605  libgnunetutil.la
606
607
608 test_service_SOURCES = \
609  test_service.c
610 test_service_LDADD = \
611  libgnunetutil.la
612
613 test_strings_SOURCES = \
614  test_strings.c
615 test_strings_LDADD = \
616  libgnunetutil.la
617
618
619 test_strings_to_data_SOURCES = \
620  test_strings_to_data.c
621 test_strings_to_data_LDADD = \
622  libgnunetutil.la
623
624
625 test_time_SOURCES = \
626  test_time.c
627 test_time_LDADD = \
628  libgnunetutil.la
629
630 test_speedup_SOURCES = \
631  test_speedup.c
632 test_speedup_LDADD = \
633  libgnunetutil.la
634
635 perf_crypto_hash_SOURCES = \
636  perf_crypto_hash.c
637 perf_crypto_hash_LDADD = \
638  libgnunetutil.la
639
640 perf_crypto_ecc_dlog_SOURCES = \
641  perf_crypto_ecc_dlog.c
642 perf_crypto_ecc_dlog_LDADD = \
643  libgnunetutil.la \
644  -lgcrypt
645
646 perf_crypto_rsa_SOURCES = \
647  perf_crypto_rsa.c
648 perf_crypto_rsa_LDADD = \
649  libgnunetutil.la
650
651 perf_crypto_symmetric_SOURCES = \
652  perf_crypto_symmetric.c
653 perf_crypto_symmetric_LDADD = \
654  libgnunetutil.la
655
656 perf_crypto_asymmetric_SOURCES = \
657  perf_crypto_asymmetric.c
658 perf_crypto_asymmetric_LDADD = \
659  libgnunetutil.la
660
661 perf_crypto_paillier_SOURCES = \
662  perf_crypto_paillier.c
663 perf_crypto_paillier_LDADD = \
664  libgnunetutil.la \
665  -lgcrypt
666
667 perf_malloc_SOURCES = \
668  perf_malloc.c
669 perf_malloc_LDADD = \
670  libgnunetutil.la
671
672
673 EXTRA_DIST = \
674   test_client_data.conf \
675   test_client_unix.conf \
676   test_configuration_data.conf \
677   test_program_data.conf \
678   test_resolver_api_data.conf \
679   test_service_data.conf \
680   test_speedup_data.conf \
681   gnunet-qr.py.in