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