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