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