-Merge branch 'master' of ssh://gnunet.org/gnunet into gsoc2018/rest_api
[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
203
204 gnunet_resolver_SOURCES = \
205  gnunet-resolver.c
206 gnunet_resolver_LDADD = \
207   libgnunetutil.la \
208   $(GN_LIBINTL)
209
210
211 gnunet_ecc_SOURCES = \
212  gnunet-ecc.c
213 gnunet_ecc_LDADD = \
214   libgnunetutil.la \
215   $(GN_LIBINTL) -lgcrypt
216
217 gnunet_scrypt_SOURCES = \
218  gnunet-scrypt.c
219 gnunet_scrypt_LDADD = \
220   libgnunetutil.la \
221   $(GN_LIBINTL) -lgcrypt
222
223
224 gnunet_config_SOURCES = \
225  gnunet-config.c
226 gnunet_config_LDADD = \
227   libgnunetutil.la \
228   $(GN_LIBINTL)
229
230
231 gnunet_uri_SOURCES = \
232  gnunet-uri.c
233 gnunet_uri_LDADD = \
234   libgnunetutil.la \
235   $(GN_LIBINTL)
236
237 plugin_LTLIBRARIES = \
238   libgnunet_plugin_test.la
239
240 libgnunet_plugin_test_la_SOURCES = \
241   test_plugin_plug.c
242 libgnunet_plugin_test_la_LDFLAGS = \
243  $(GN_PLUGIN_LDFLAGS)
244
245 if HAVE_BENCHMARKS
246  BENCHMARKS = \
247   perf_crypto_hash \
248   perf_crypto_ecc_dlog \
249   perf_crypto_rsa \
250   perf_crypto_paillier \
251   perf_crypto_symmetric \
252   perf_crypto_asymmetric \
253   perf_malloc
254 endif
255
256 if HAVE_SSH_KEY
257 # SSH_USING_TESTS = test_socks.nc
258 endif
259
260 check_PROGRAMS = \
261  test_bio \
262  test_client.nc \
263  $(TEST_CLIENT_UNIX_NC) \
264  test_common_allocation \
265  test_common_endian \
266  test_common_logging \
267  test_configuration \
268  test_container_bloomfilter \
269  test_container_dll \
270  test_container_meta_data \
271  test_container_multihashmap \
272  test_container_multihashmap32 \
273  test_container_multipeermap \
274  test_container_heap \
275  test_crypto_symmetric \
276  test_crypto_crc \
277  test_crypto_ecdsa \
278  test_crypto_eddsa \
279  test_crypto_ecdhe \
280  test_crypto_ecdh_eddsa \
281  test_crypto_ecc_dlog \
282  test_crypto_hash \
283  test_crypto_hash_context \
284  test_crypto_hkdf \
285  test_crypto_kdf \
286  test_crypto_paillier \
287  test_crypto_random \
288  test_crypto_rsa \
289  test_disk \
290  test_getopt \
291  test_mq \
292  test_os_network \
293  test_peer \
294  test_plugin \
295  test_program \
296  test_resolver_api.nc \
297  test_scheduler \
298  test_scheduler_delay \
299  test_service \
300  test_strings \
301  test_strings_to_data \
302  test_time \
303  test_speedup \
304  $(BENCHMARKS) \
305  test_os_start_process \
306  test_common_logging_runtime_loglevels
307
308
309 # Declare .nc (NO-CONCURRENCY) as a test extension so that we can impart
310 # sequential execution order for them
311 TEST_EXTENSIONS = .nc
312 test_test_client_unix.log: test_client.log
313
314 test_bio_SOURCES = \
315  test_bio.c
316 test_bio_LDADD = \
317  libgnunetutil.la
318
319
320 test_os_start_process_SOURCES = \
321  test_os_start_process.c
322 test_os_start_process_LDADD = \
323  libgnunetutil.la
324 test_os_start_process_DEPENDENCIES = \
325  libgnunetutil.la \
326  $(WINCAT)
327
328 test_client_nc_SOURCES = \
329  test_client.c
330 test_client_nc_LDADD = \
331  libgnunetutil.la
332
333 test_client_unix_nc_SOURCES = \
334  test_client.c
335 test_client_unix_nc_LDADD = \
336  libgnunetutil.la
337
338 #test_socks_nc_SOURCES = \
339 # test_socks.c
340 #test_socks_nc_LDADD = \
341 # libgnunetutil.la
342
343 test_common_allocation_SOURCES = \
344  test_common_allocation.c
345 test_common_allocation_LDADD = \
346  libgnunetutil.la
347
348 test_common_endian_SOURCES = \
349  test_common_endian.c
350 test_common_endian_LDADD = \
351  libgnunetutil.la
352
353 test_common_logging_SOURCES = \
354  test_common_logging.c
355 test_common_logging_LDADD = \
356  libgnunetutil.la
357
358 test_common_logging_runtime_loglevels_SOURCES = \
359  test_common_logging_runtime_loglevels.c
360 test_common_logging_runtime_loglevels_LDADD = \
361  libgnunetutil.la
362
363 test_configuration_SOURCES = \
364  test_configuration.c
365 test_configuration_LDADD = \
366  libgnunetutil.la
367
368 test_container_bloomfilter_SOURCES = \
369  test_container_bloomfilter.c
370 test_container_bloomfilter_LDADD = \
371  libgnunetutil.la
372
373 test_container_dll_SOURCES = \
374  test_container_dll.c
375 test_container_dll_LDADD = \
376  libgnunetutil.la
377
378 test_container_meta_data_SOURCES = \
379  test_container_meta_data.c
380 test_container_meta_data_LDADD = \
381  libgnunetutil.la
382
383 test_container_multihashmap_SOURCES = \
384  test_container_multihashmap.c
385 test_container_multihashmap_LDADD = \
386  libgnunetutil.la
387
388 test_container_multihashmap32_SOURCES = \
389  test_container_multihashmap32.c
390 test_container_multihashmap32_LDADD = \
391  libgnunetutil.la
392
393 test_container_multipeermap_SOURCES = \
394  test_container_multipeermap.c
395 test_container_multipeermap_LDADD = \
396  libgnunetutil.la
397
398 test_container_heap_SOURCES = \
399  test_container_heap.c
400 test_container_heap_LDADD = \
401  libgnunetutil.la
402
403 test_crypto_symmetric_SOURCES = \
404  test_crypto_symmetric.c
405 test_crypto_symmetric_LDADD = \
406  libgnunetutil.la
407
408 test_crypto_crc_SOURCES = \
409  test_crypto_crc.c
410 test_crypto_crc_LDADD = \
411  libgnunetutil.la
412
413 test_crypto_ecdsa_SOURCES = \
414  test_crypto_ecdsa.c
415 test_crypto_ecdsa_LDADD = \
416  libgnunetutil.la \
417  $(LIBGCRYPT_LIBS)
418
419 test_crypto_eddsa_SOURCES = \
420  test_crypto_eddsa.c
421 test_crypto_eddsa_LDADD = \
422  libgnunetutil.la \
423  $(LIBGCRYPT_LIBS)
424
425 test_crypto_ecc_dlog_SOURCES = \
426  test_crypto_ecc_dlog.c
427 test_crypto_ecc_dlog_LDADD = \
428  libgnunetutil.la \
429  $(LIBGCRYPT_LIBS)
430
431 test_crypto_ecdhe_SOURCES = \
432  test_crypto_ecdhe.c
433 test_crypto_ecdhe_LDADD = \
434  libgnunetutil.la \
435  $(LIBGCRYPT_LIBS)
436
437 test_crypto_ecdh_eddsa_SOURCES = \
438  test_crypto_ecdh_eddsa.c
439 test_crypto_ecdh_eddsa_LDADD = \
440  libgnunetutil.la \
441  $(LIBGCRYPT_LIBS)
442
443 test_crypto_hash_SOURCES = \
444  test_crypto_hash.c
445 test_crypto_hash_LDADD = \
446  libgnunetutil.la
447
448 test_crypto_hash_context_SOURCES = \
449  test_crypto_hash_context.c
450 test_crypto_hash_context_LDADD = \
451  libgnunetutil.la
452
453 test_crypto_hkdf_SOURCES = \
454  test_crypto_hkdf.c
455 test_crypto_hkdf_LDADD = \
456  libgnunetutil.la
457
458 test_crypto_kdf_SOURCES = \
459  test_crypto_kdf.c
460 test_crypto_kdf_LDADD = \
461  libgnunetutil.la -lgcrypt
462
463 test_crypto_paillier_SOURCES = \
464  test_crypto_paillier.c
465 test_crypto_paillier_LDADD = \
466  $(LIBGCRYPT_LIBS) \
467  libgnunetutil.la
468
469 test_crypto_random_SOURCES = \
470  test_crypto_random.c
471 test_crypto_random_LDADD = \
472  libgnunetutil.la
473
474 test_crypto_rsa_SOURCES = \
475  test_crypto_rsa.c
476 test_crypto_rsa_LDADD = \
477  libgnunetutil.la -lgcrypt
478
479 test_disk_SOURCES = \
480  test_disk.c
481 test_disk_LDADD = \
482  libgnunetutil.la
483
484 test_getopt_SOURCES = \
485  test_getopt.c
486 test_getopt_LDADD = \
487  libgnunetutil.la
488
489 test_mq_SOURCES = \
490  test_mq.c
491 test_mq_LDADD = \
492  libgnunetutil.la
493
494 test_os_network_SOURCES = \
495  test_os_network.c
496 test_os_network_LDADD = \
497  libgnunetutil.la
498
499 test_peer_SOURCES = \
500  test_peer.c
501 test_peer_LDADD = \
502  libgnunetutil.la -lgcrypt
503
504 test_plugin_SOURCES = \
505  test_plugin.c
506 test_plugin_LDADD = \
507  libgnunetutil.la
508
509 test_program_SOURCES = \
510  test_program.c
511 test_program_LDADD = \
512  libgnunetutil.la
513
514 test_resolver_api_nc_SOURCES = \
515  test_resolver_api.c
516 test_resolver_api_nc_LDADD = \
517  libgnunetutil.la
518
519 test_scheduler_SOURCES = \
520  test_scheduler.c
521 test_scheduler_LDADD = \
522  libgnunetutil.la
523
524 test_scheduler_delay_SOURCES = \
525  test_scheduler_delay.c
526 test_scheduler_delay_LDADD = \
527  libgnunetutil.la
528
529 test_service_SOURCES = \
530  test_service.c
531 test_service_LDADD = \
532  libgnunetutil.la
533
534 test_strings_SOURCES = \
535  test_strings.c
536 test_strings_LDADD = \
537  libgnunetutil.la
538
539 test_strings_to_data_SOURCES = \
540  test_strings_to_data.c
541 test_strings_to_data_LDADD = \
542  libgnunetutil.la
543
544
545 test_time_SOURCES = \
546  test_time.c
547 test_time_LDADD = \
548  libgnunetutil.la
549
550 test_speedup_SOURCES = \
551  test_speedup.c
552 test_speedup_LDADD = \
553  libgnunetutil.la
554
555 perf_crypto_hash_SOURCES = \
556  perf_crypto_hash.c
557 perf_crypto_hash_LDADD = \
558  libgnunetutil.la
559
560 perf_crypto_ecc_dlog_SOURCES = \
561  perf_crypto_ecc_dlog.c
562 perf_crypto_ecc_dlog_LDADD = \
563  libgnunetutil.la \
564  -lgcrypt
565
566 perf_crypto_rsa_SOURCES = \
567  perf_crypto_rsa.c
568 perf_crypto_rsa_LDADD = \
569  libgnunetutil.la
570
571 perf_crypto_symmetric_SOURCES = \
572  perf_crypto_symmetric.c
573 perf_crypto_symmetric_LDADD = \
574  libgnunetutil.la
575
576 perf_crypto_asymmetric_SOURCES = \
577  perf_crypto_asymmetric.c
578 perf_crypto_asymmetric_LDADD = \
579  libgnunetutil.la
580
581 perf_crypto_paillier_SOURCES = \
582  perf_crypto_paillier.c
583 perf_crypto_paillier_LDADD = \
584  libgnunetutil.la \
585  -lgcrypt
586
587 perf_malloc_SOURCES = \
588  perf_malloc.c
589 perf_malloc_LDADD = \
590  libgnunetutil.la
591
592
593 EXTRA_DIST = \
594   test_client_data.conf \
595   test_client_unix.conf \
596   test_configuration_data.conf \
597   test_program_data.conf \
598   test_resolver_api_data.conf \
599   test_service_data.conf \
600   test_speedup_data.conf \
601   gnunet-qr.py.in