4296199db419ece8e543d5a098055d96633cb1c4
[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   getopt.c \
93   getopt_helpers.c \
94   helper.c \
95   load.c \
96   mst.c \
97   mq.c \
98   nc.c \
99   network.c \
100   op.c \
101   os_installation.c \
102   os_network.c \
103   os_priority.c \
104   peer.c \
105   plugin.c \
106   program.c \
107   resolver_api.c resolver.h \
108   scheduler.c \
109   service.c \
110   signal.c \
111   strings.c \
112   time.c \
113   speedup.c speedup.h
114
115 libgnunetutil_la_LIBADD = \
116   $(GCLIBADD) $(WINLIB) \
117   $(LIBGCRYPT_LIBS) \
118   $(LTLIBICONV) \
119   $(LTLIBINTL) \
120   -lltdl $(Z_LIBS) -lunistring $(XLIB)
121
122 libgnunetutil_la_LDFLAGS = \
123   $(GN_LIB_LDFLAGS) \
124   -version-info 13:0:0
125
126 libgnunetutil_taler_wallet_la_SOURCES = \
127   common_allocation.c \
128   common_endian.c \
129   common_logging.c \
130   container_heap.c \
131   container_multihashmap.c \
132   container_multihashmap32.c \
133   crypto_symmetric.c \
134   crypto_crc.c \
135   crypto_ecc.c \
136   crypto_hash.c \
137   crypto_hkdf.c \
138   crypto_kdf.c \
139   crypto_mpi.c \
140   crypto_random.c \
141   crypto_rsa.c \
142   strings.c \
143   time.c
144
145 libgnunetutil_taler_wallet_la_LIBADD = \
146   $(LIBGCRYPT_LIBS) \
147   -lunistring
148
149 libgnunetutil_taler_wallet_la_LDFLAGS = \
150   $(GN_LIB_LDFLAGS) \
151   -version-info 0:0:0
152
153 if HAVE_TESTING
154   GNUNET_ECC = gnunet-ecc
155   GNUNET_SCRYPT = gnunet-scrypt
156 endif
157
158 if TALER_ONLY
159 lib_LTLIBRARIES = libgnunetutil_taler_wallet.la
160 else
161 lib_LTLIBRARIES = libgnunetutil.la
162
163 libexec_PROGRAMS = \
164  gnunet-service-resolver \
165  $(W32CONSOLEHELPER)
166
167 bin_SCRIPTS =\
168  gnunet-qr
169
170 bin_PROGRAMS = \
171  gnunet-resolver \
172  gnunet-config \
173  $(GNUNET_ECC) \
174  $(GNUNET_SCRYPT) \
175  gnunet-uri
176
177 noinst_PROGRAMS = \
178  gnunet-config-diff \
179  $(W32CAT) \
180  test_common_logging_dummy
181
182
183 if ENABLE_TEST_RUN
184 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
185 TESTS = $(check_PROGRAMS)
186 endif
187
188 endif
189
190
191 do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g'
192
193 gnunet-qr: gnunet-qr.py.in Makefile
194         $(do_subst) < $(top_srcdir)/src/util/gnunet-qr.py.in > gnunet-qr
195         chmod +x gnunet-qr
196
197 gnunet_service_resolver_SOURCES = \
198  gnunet-service-resolver.c
199 gnunet_service_resolver_LDADD = \
200   libgnunetutil.la \
201   $(GN_LIBINTL)
202 if HAVE_GETADDRINFO_A
203 gnunet_service_resolver_LDADD += -lanl
204 endif
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_ecc_dlog \
252   perf_crypto_rsa \
253   perf_crypto_paillier \
254   perf_crypto_symmetric \
255   perf_crypto_asymmetric \
256   perf_malloc
257 endif
258
259 if HAVE_SSH_KEY
260 # SSH_USING_TESTS = test_socks.nc
261 endif
262
263 check_PROGRAMS = \
264  test_bio \
265  test_client.nc \
266  $(TEST_CLIENT_UNIX_NC) \
267  test_common_allocation \
268  test_common_endian \
269  test_common_logging \
270  test_configuration \
271  test_container_bloomfilter \
272  test_container_dll \
273  test_container_meta_data \
274  test_container_multihashmap \
275  test_container_multihashmap32 \
276  test_container_multipeermap \
277  test_container_heap \
278  test_crypto_symmetric \
279  test_crypto_crc \
280  test_crypto_ecdsa \
281  test_crypto_eddsa \
282  test_crypto_ecdhe \
283  test_crypto_ecdh_eddsa \
284  test_crypto_ecc_dlog \
285  test_crypto_hash \
286  test_crypto_hash_context \
287  test_crypto_hkdf \
288  test_crypto_kdf \
289  test_crypto_paillier \
290  test_crypto_random \
291  test_crypto_rsa \
292  test_disk \
293  test_getopt \
294  test_mq \
295  test_os_network \
296  test_peer \
297  test_plugin \
298  test_program \
299  test_resolver_api.nc \
300  test_scheduler \
301  test_scheduler_delay \
302  test_service \
303  test_strings \
304  test_strings_to_data \
305  test_time \
306  test_speedup \
307  $(BENCHMARKS) \
308  test_os_start_process \
309  test_common_logging_runtime_loglevels
310
311
312 # Declare .nc (NO-CONCURRENCY) as a test extension so that we can impart
313 # sequential execution order for them
314 TEST_EXTENSIONS = .nc
315 test_test_client_unix.log: test_client.log
316
317 test_bio_SOURCES = \
318  test_bio.c
319 test_bio_LDADD = \
320  libgnunetutil.la
321
322
323 test_os_start_process_SOURCES = \
324  test_os_start_process.c
325 test_os_start_process_LDADD = \
326  libgnunetutil.la
327 test_os_start_process_DEPENDENCIES = \
328  libgnunetutil.la \
329  $(WINCAT)
330
331 test_client_nc_SOURCES = \
332  test_client.c
333 test_client_nc_LDADD = \
334  libgnunetutil.la
335
336 test_client_unix_nc_SOURCES = \
337  test_client.c
338 test_client_unix_nc_LDADD = \
339  libgnunetutil.la
340
341 #test_socks_nc_SOURCES = \
342 # test_socks.c
343 #test_socks_nc_LDADD = \
344 # libgnunetutil.la
345
346 test_common_allocation_SOURCES = \
347  test_common_allocation.c
348 test_common_allocation_LDADD = \
349  libgnunetutil.la
350
351 test_common_endian_SOURCES = \
352  test_common_endian.c
353 test_common_endian_LDADD = \
354  libgnunetutil.la
355
356 test_common_logging_SOURCES = \
357  test_common_logging.c
358 test_common_logging_LDADD = \
359  libgnunetutil.la
360
361 test_common_logging_runtime_loglevels_SOURCES = \
362  test_common_logging_runtime_loglevels.c
363 test_common_logging_runtime_loglevels_LDADD = \
364  libgnunetutil.la
365
366 test_configuration_SOURCES = \
367  test_configuration.c
368 test_configuration_LDADD = \
369  libgnunetutil.la
370
371 test_container_bloomfilter_SOURCES = \
372  test_container_bloomfilter.c
373 test_container_bloomfilter_LDADD = \
374  libgnunetutil.la
375
376 test_container_dll_SOURCES = \
377  test_container_dll.c
378 test_container_dll_LDADD = \
379  libgnunetutil.la
380
381 test_container_meta_data_SOURCES = \
382  test_container_meta_data.c
383 test_container_meta_data_LDADD = \
384  libgnunetutil.la
385
386 test_container_multihashmap_SOURCES = \
387  test_container_multihashmap.c
388 test_container_multihashmap_LDADD = \
389  libgnunetutil.la
390
391 test_container_multihashmap32_SOURCES = \
392  test_container_multihashmap32.c
393 test_container_multihashmap32_LDADD = \
394  libgnunetutil.la
395
396 test_container_multipeermap_SOURCES = \
397  test_container_multipeermap.c
398 test_container_multipeermap_LDADD = \
399  libgnunetutil.la
400
401 test_container_heap_SOURCES = \
402  test_container_heap.c
403 test_container_heap_LDADD = \
404  libgnunetutil.la
405
406 test_crypto_symmetric_SOURCES = \
407  test_crypto_symmetric.c
408 test_crypto_symmetric_LDADD = \
409  libgnunetutil.la
410
411 test_crypto_crc_SOURCES = \
412  test_crypto_crc.c
413 test_crypto_crc_LDADD = \
414  libgnunetutil.la
415
416 test_crypto_ecdsa_SOURCES = \
417  test_crypto_ecdsa.c
418 test_crypto_ecdsa_LDADD = \
419  libgnunetutil.la \
420  $(LIBGCRYPT_LIBS)
421
422 test_crypto_eddsa_SOURCES = \
423  test_crypto_eddsa.c
424 test_crypto_eddsa_LDADD = \
425  libgnunetutil.la \
426  $(LIBGCRYPT_LIBS)
427
428 test_crypto_ecc_dlog_SOURCES = \
429  test_crypto_ecc_dlog.c
430 test_crypto_ecc_dlog_LDADD = \
431  libgnunetutil.la \
432  $(LIBGCRYPT_LIBS)
433
434 test_crypto_ecdhe_SOURCES = \
435  test_crypto_ecdhe.c
436 test_crypto_ecdhe_LDADD = \
437  libgnunetutil.la \
438  $(LIBGCRYPT_LIBS)
439
440 test_crypto_ecdh_eddsa_SOURCES = \
441  test_crypto_ecdh_eddsa.c
442 test_crypto_ecdh_eddsa_LDADD = \
443  libgnunetutil.la \
444  $(LIBGCRYPT_LIBS)
445
446 test_crypto_hash_SOURCES = \
447  test_crypto_hash.c
448 test_crypto_hash_LDADD = \
449  libgnunetutil.la
450
451 test_crypto_hash_context_SOURCES = \
452  test_crypto_hash_context.c
453 test_crypto_hash_context_LDADD = \
454  libgnunetutil.la
455
456 test_crypto_hkdf_SOURCES = \
457  test_crypto_hkdf.c
458 test_crypto_hkdf_LDADD = \
459  libgnunetutil.la
460
461 test_crypto_kdf_SOURCES = \
462  test_crypto_kdf.c
463 test_crypto_kdf_LDADD = \
464  libgnunetutil.la -lgcrypt
465
466 test_crypto_paillier_SOURCES = \
467  test_crypto_paillier.c
468 test_crypto_paillier_LDADD = \
469  $(LIBGCRYPT_LIBS) \
470  libgnunetutil.la
471
472 test_crypto_random_SOURCES = \
473  test_crypto_random.c
474 test_crypto_random_LDADD = \
475  libgnunetutil.la
476
477 test_crypto_rsa_SOURCES = \
478  test_crypto_rsa.c
479 test_crypto_rsa_LDADD = \
480  libgnunetutil.la -lgcrypt
481
482 test_disk_SOURCES = \
483  test_disk.c
484 test_disk_LDADD = \
485  libgnunetutil.la
486
487 test_getopt_SOURCES = \
488  test_getopt.c
489 test_getopt_LDADD = \
490  libgnunetutil.la
491
492 test_mq_SOURCES = \
493  test_mq.c
494 test_mq_LDADD = \
495  libgnunetutil.la
496
497 test_os_network_SOURCES = \
498  test_os_network.c
499 test_os_network_LDADD = \
500  libgnunetutil.la
501
502 test_peer_SOURCES = \
503  test_peer.c
504 test_peer_LDADD = \
505  libgnunetutil.la -lgcrypt
506
507 test_plugin_SOURCES = \
508  test_plugin.c
509 test_plugin_LDADD = \
510  libgnunetutil.la
511
512 test_program_SOURCES = \
513  test_program.c
514 test_program_LDADD = \
515  libgnunetutil.la
516
517 test_resolver_api_nc_SOURCES = \
518  test_resolver_api.c
519 test_resolver_api_nc_LDADD = \
520  libgnunetutil.la
521
522 test_scheduler_SOURCES = \
523  test_scheduler.c
524 test_scheduler_LDADD = \
525  libgnunetutil.la
526
527 test_scheduler_delay_SOURCES = \
528  test_scheduler_delay.c
529 test_scheduler_delay_LDADD = \
530  libgnunetutil.la
531
532 test_service_SOURCES = \
533  test_service.c
534 test_service_LDADD = \
535  libgnunetutil.la
536
537 test_strings_SOURCES = \
538  test_strings.c
539 test_strings_LDADD = \
540  libgnunetutil.la
541
542 test_strings_to_data_SOURCES = \
543  test_strings_to_data.c
544 test_strings_to_data_LDADD = \
545  libgnunetutil.la
546
547
548 test_time_SOURCES = \
549  test_time.c
550 test_time_LDADD = \
551  libgnunetutil.la
552
553 test_speedup_SOURCES = \
554  test_speedup.c
555 test_speedup_LDADD = \
556  libgnunetutil.la
557
558 perf_crypto_hash_SOURCES = \
559  perf_crypto_hash.c
560 perf_crypto_hash_LDADD = \
561  libgnunetutil.la
562
563 perf_crypto_ecc_dlog_SOURCES = \
564  perf_crypto_ecc_dlog.c
565 perf_crypto_ecc_dlog_LDADD = \
566  libgnunetutil.la \
567  -lgcrypt
568
569 perf_crypto_rsa_SOURCES = \
570  perf_crypto_rsa.c
571 perf_crypto_rsa_LDADD = \
572  libgnunetutil.la
573
574 perf_crypto_symmetric_SOURCES = \
575  perf_crypto_symmetric.c
576 perf_crypto_symmetric_LDADD = \
577  libgnunetutil.la
578
579 perf_crypto_asymmetric_SOURCES = \
580  perf_crypto_asymmetric.c
581 perf_crypto_asymmetric_LDADD = \
582  libgnunetutil.la
583
584 perf_crypto_paillier_SOURCES = \
585  perf_crypto_paillier.c
586 perf_crypto_paillier_LDADD = \
587  libgnunetutil.la \
588  -lgcrypt
589
590 perf_malloc_SOURCES = \
591  perf_malloc.c
592 perf_malloc_LDADD = \
593  libgnunetutil.la
594
595
596 EXTRA_DIST = \
597   test_client_data.conf \
598   test_client_unix.conf \
599   test_configuration_data.conf \
600   test_program_data.conf \
601   test_resolver_api_data.conf \
602   test_service_data.conf \
603   test_speedup_data.conf \
604   gnunet-qr.py.in