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