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