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