3c49c0b65777aab5ea7219d9b4486b966a195d27
[oweals/gnunet.git] / src / util / Makefile.am
1 AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_builddir)/src/include
2
3 plugindir = $(libdir)/gnunet
4
5 libexecdir= $(pkglibdir)/libexec/
6
7 pkgcfgdir= $(pkgdatadir)/config.d/
8
9 dist_pkgcfg_DATA = \
10   util.conf
11
12 pkgcfg_DATA = \
13   resolver.conf
14
15 if MINGW
16 noinst_LTLIBRARIES = \
17   libgnunetutilwin.la
18 libgnunetutilwin_la_SOURCES = \
19   win.c \
20   winproc.c
21 libgnunetutilwin_la_LDFLAGS = \
22   -no-undefined -Wl,--export-all-symbols
23 libgnunetutilwin_la_LIBADD = \
24   -lshell32 -liconv -lstdc++ \
25   -lcomdlg32 -lgdi32 -liphlpapi
26 WINLIB = libgnunetutilwin.la
27 W32CAT = w32cat
28 W32CONSOLEHELPER = gnunet-helper-w32-console
29 endif
30
31 if !MINGW
32  SERVER_CLIENT_UNIX = test_server_with_client_unix
33 endif
34
35 if USE_COVERAGE
36   AM_CFLAGS = --coverage -O0
37   XLIB = -lgcov
38 endif
39
40 w32cat_SOURCES = w32cat.c
41
42 gnunet_helper_w32_console_SOURCES = \
43   gnunet-helper-w32-console.c \
44   gnunet-helper-w32-console.h
45 gnunet_helper_w32_console_LDADD = \
46  $(top_builddir)/src/util/libgnunetutil.la
47 gnunet_helper_w32_console_DEPENDENCIES = \
48  libgnunetutil.la
49
50 noinst_PROGRAMS = \
51  gnunet-config-diff \
52  $(W32CAT) \
53  test_common_logging_dummy
54
55
56 gnunet_config_diff_SOURCES = \
57  gnunet-config-diff.c
58 gnunet_config_diff_LDADD = \
59  $(top_builddir)/src/util/libgnunetutil.la
60 gnunet_config_diff_DEPENDENCIES = \
61  libgnunetutil.la
62
63 test_common_logging_dummy_SOURCES = \
64  test_common_logging_dummy.c
65 test_common_logging_dummy_LDADD = \
66  $(top_builddir)/src/util/libgnunetutil.la
67 test_common_logging_dummy_DEPENDENCIES = \
68  libgnunetutil.la
69
70 lib_LTLIBRARIES = libgnunetutil.la
71
72 libgnunetutil_la_SOURCES = \
73   bandwidth.c \
74   bio.c \
75   client.c \
76   common_allocation.c \
77   common_endian.c \
78   common_logging.c \
79   configuration.c \
80   connection.c \
81   container_bloomfilter.c \
82   container_heap.c \
83   container_meta_data.c \
84   container_multihashmap.c \
85   container_multipeermap.c \
86   container_multihashmap32.c \
87   container_slist.c \
88   crypto_symmetric.c \
89   crypto_crc.c \
90   crypto_ecc.c \
91   crypto_hash.c \
92   crypto_hkdf.c \
93   crypto_kdf.c \
94   crypto_mpi.c \
95   crypto_paillier.c \
96   crypto_random.c \
97   disk.c \
98   disk.h \
99   getopt.c \
100   getopt_helpers.c \
101   helper.c \
102   load.c \
103   mq.c \
104   network.c \
105   os_installation.c \
106   os_network.c \
107   os_priority.c \
108   peer.c \
109   plugin.c \
110   program.c \
111   resolver_api.c resolver.h \
112   scheduler.c \
113   server.c \
114   server_mst.c \
115   server_nc.c \
116   server_tc.c \
117   service.c \
118   signal.c \
119   strings.c \
120   time.c \
121   speedup.c
122
123 libgnunetutil_la_LIBADD = \
124   $(GCLIBADD) $(WINLIB) \
125   $(LIBGCRYPT_LIBS) \
126   $(LTLIBICONV) \
127   $(LTLIBINTL) \
128   -lltdl $(Z_LIBS) -lunistring $(XLIB)
129
130 libgnunetutil_la_LDFLAGS = \
131   $(GN_LIB_LDFLAGS) \
132   -version-info 11:0:2
133
134 if HAVE_TESTING
135   GNUNET_ECC = gnunet-ecc
136   GNUNET_SCRYPT = gnunet-scrypt
137 endif
138
139
140 libexec_PROGRAMS = \
141  gnunet-service-resolver \
142  $(W32CONSOLEHELPER)
143
144 bin_SCRIPTS =\
145  gnunet-qr
146
147 bin_PROGRAMS = \
148  gnunet-resolver \
149  gnunet-config \
150  $(GNUNET_ECC) \
151  $(GNUNET_SCRYPT) \
152  gnunet-uri
153
154 do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g'
155
156 gnunet-qr: gnunet-qr.py.in Makefile
157         $(do_subst) < gnunet-qr.py.in > gnunet-qr
158         chmod +x gnunet-qr
159
160 gnunet_service_resolver_SOURCES = \
161  gnunet-service-resolver.c
162 gnunet_service_resolver_LDADD = \
163   $(top_builddir)/src/util/libgnunetutil.la \
164   $(GN_LIBINTL)
165 gnunet_service_resolver_DEPENDENCIES = \
166   libgnunetutil.la
167
168
169 gnunet_resolver_SOURCES = \
170  gnunet-resolver.c
171 gnunet_resolver_LDADD = \
172   $(top_builddir)/src/util/libgnunetutil.la \
173   $(GN_LIBINTL)
174 gnunet_resolver_DEPENDENCIES = \
175   libgnunetutil.la
176
177
178 gnunet_ecc_SOURCES = \
179  gnunet-ecc.c
180 gnunet_ecc_LDADD = \
181   $(top_builddir)/src/util/libgnunetutil.la \
182   $(GN_LIBINTL) -lgcrypt
183 gnunet_ecc_DEPENDENCIES = \
184   libgnunetutil.la
185
186 gnunet_scrypt_SOURCES = \
187  gnunet-scrypt.c
188 gnunet_scrypt_LDADD = \
189   $(top_builddir)/src/util/libgnunetutil.la \
190   $(GN_LIBINTL) -lgcrypt
191 gnunet_scrypt_DEPENDENCIES = \
192   libgnunetutil.la
193
194
195 gnunet_config_SOURCES = \
196  gnunet-config.c
197 gnunet_config_LDADD = \
198   $(top_builddir)/src/util/libgnunetutil.la \
199   $(GN_LIBINTL)
200 gnunet_config_DEPENDENCIES = \
201   libgnunetutil.la
202
203
204 gnunet_uri_SOURCES = \
205  gnunet-uri.c
206 gnunet_uri_LDADD = \
207   $(top_builddir)/src/util/libgnunetutil.la \
208   $(GN_LIBINTL)
209 gnunet_uri_DEPENDENCIES = \
210   libgnunetutil.la
211
212 plugin_LTLIBRARIES = \
213   libgnunet_plugin_test.la
214
215 libgnunet_plugin_test_la_SOURCES = \
216   test_plugin_plug.c
217 libgnunet_plugin_test_la_LDFLAGS = \
218  $(GN_PLUGIN_LDFLAGS)
219
220 if HAVE_BENCHMARKS
221  BENCHMARKS = \
222   perf_crypto_hash \
223   perf_crypto_symmetric \
224   perf_malloc
225 endif
226
227 check_PROGRAMS = \
228  test_bio \
229  test_client \
230  test_common_allocation \
231  test_common_endian \
232  test_common_logging \
233  test_configuration \
234  test_container_bloomfilter \
235  test_container_meta_data \
236  test_container_multihashmap \
237  test_container_multihashmap32 \
238  test_container_multipeermap \
239  test_container_heap \
240  test_container_slist \
241  test_crypto_symmetric \
242  test_crypto_crc \
243  test_crypto_ecdsa \
244  test_crypto_eddsa \
245  test_crypto_ecdhe \
246  test_crypto_hash \
247  test_crypto_hkdf \
248  test_crypto_random \
249  test_disk \
250  test_getopt \
251  test_connection \
252  test_connection_addressing \
253  test_connection_receive_cancel \
254  test_connection_timeout \
255  test_connection_timeout_no_connect \
256  test_connection_transmit_cancel \
257  test_mq \
258  test_mq_client \
259  test_os_network \
260  test_peer \
261  test_plugin \
262  test_program \
263  test_resolver_api \
264  test_scheduler \
265  test_scheduler_delay \
266  test_server_mst_interrupt \
267  test_server \
268  test_server_disconnect \
269  test_server_with_client \
270  $(SERVER_CLIENT_UNIX) \
271  test_service \
272  test_strings \
273  test_strings_to_data \
274  test_time \
275  test_speedup \
276  $(BENCHMARKS) \
277  test_os_start_process \
278  test_common_logging_runtime_loglevels
279
280 if ENABLE_TEST_RUN
281 TESTS_ENVIRONMENT=export GNUNET_PREFIX=@prefix@;export PATH=@prefix@/bin:$$PATH;
282 TESTS = $(check_PROGRAMS)
283 endif
284
285 test_bio_SOURCES = \
286  test_bio.c
287 test_bio_LDADD = \
288  $(top_builddir)/src/util/libgnunetutil.la
289
290
291 test_os_start_process_SOURCES = \
292  test_os_start_process.c
293 test_os_start_process_LDADD = \
294  $(top_builddir)/src/util/libgnunetutil.la
295 test_os_start_process_DEPENDENCIES = \
296  $(WINCAT)
297
298 test_client_SOURCES = \
299  test_client.c
300 test_client_LDADD = \
301  $(top_builddir)/src/util/libgnunetutil.la
302
303 test_common_allocation_SOURCES = \
304  test_common_allocation.c
305 test_common_allocation_LDADD = \
306  $(top_builddir)/src/util/libgnunetutil.la
307
308 test_common_endian_SOURCES = \
309  test_common_endian.c
310 test_common_endian_LDADD = \
311  $(top_builddir)/src/util/libgnunetutil.la
312
313 test_common_logging_SOURCES = \
314  test_common_logging.c
315 test_common_logging_LDADD = \
316  $(top_builddir)/src/util/libgnunetutil.la
317
318 test_common_logging_runtime_loglevels_SOURCES = \
319  test_common_logging_runtime_loglevels.c
320 test_common_logging_runtime_loglevels_LDADD = \
321  $(top_builddir)/src/util/libgnunetutil.la
322
323 test_configuration_SOURCES = \
324  test_configuration.c
325 test_configuration_LDADD = \
326  $(top_builddir)/src/util/libgnunetutil.la
327
328 test_container_bloomfilter_SOURCES = \
329  test_container_bloomfilter.c
330 test_container_bloomfilter_LDADD = \
331  $(top_builddir)/src/util/libgnunetutil.la
332
333 test_container_meta_data_SOURCES = \
334  test_container_meta_data.c
335 test_container_meta_data_LDADD = \
336  $(top_builddir)/src/util/libgnunetutil.la -lextractor
337
338 test_container_multihashmap_SOURCES = \
339  test_container_multihashmap.c
340 test_container_multihashmap_LDADD = \
341  $(top_builddir)/src/util/libgnunetutil.la
342
343 test_container_multihashmap32_SOURCES = \
344  test_container_multihashmap32.c
345 test_container_multihashmap32_LDADD = \
346  $(top_builddir)/src/util/libgnunetutil.la
347
348 test_container_multipeermap_SOURCES = \
349  test_container_multipeermap.c
350 test_container_multipeermap_LDADD = \
351  $(top_builddir)/src/util/libgnunetutil.la
352
353 test_container_heap_SOURCES = \
354  test_container_heap.c
355 test_container_heap_LDADD = \
356  $(top_builddir)/src/util/libgnunetutil.la
357
358 test_container_slist_SOURCES = \
359  test_container_slist.c
360 test_container_slist_LDADD = \
361  $(top_builddir)/src/util/libgnunetutil.la
362
363 test_crypto_symmetric_SOURCES = \
364  test_crypto_symmetric.c
365 test_crypto_symmetric_LDADD = \
366  $(top_builddir)/src/util/libgnunetutil.la
367
368 test_crypto_crc_SOURCES = \
369  test_crypto_crc.c
370 test_crypto_crc_LDADD = \
371  $(top_builddir)/src/util/libgnunetutil.la
372
373 test_crypto_ecdsa_SOURCES = \
374  test_crypto_ecdsa.c
375 test_crypto_ecdsa_LDADD = \
376  $(top_builddir)/src/util/libgnunetutil.la \
377  $(LIBGCRYPT_LIBS)
378
379 test_crypto_eddsa_SOURCES = \
380  test_crypto_eddsa.c
381 test_crypto_eddsa_LDADD = \
382  $(top_builddir)/src/util/libgnunetutil.la \
383  $(LIBGCRYPT_LIBS)
384
385 test_crypto_ecdhe_SOURCES = \
386  test_crypto_ecdhe.c
387 test_crypto_ecdhe_LDADD = \
388  $(top_builddir)/src/util/libgnunetutil.la \
389  $(LIBGCRYPT_LIBS)
390
391 test_crypto_hash_SOURCES = \
392  test_crypto_hash.c
393 test_crypto_hash_LDADD = \
394  $(top_builddir)/src/util/libgnunetutil.la
395
396 test_crypto_hkdf_SOURCES = \
397  test_crypto_hkdf.c
398 test_crypto_hkdf_LDADD = \
399  $(top_builddir)/src/util/libgnunetutil.la
400
401 test_crypto_paillier_SOURCES = \
402  test_crypto_paillier.c
403 test_crypto_paillier_LDADD = \
404  $(top_builddir)/src/util/libgnunetutil.la
405
406 test_crypto_random_SOURCES = \
407  test_crypto_random.c
408 test_crypto_random_LDADD = \
409  $(top_builddir)/src/util/libgnunetutil.la
410
411 test_disk_SOURCES = \
412  test_disk.c
413 test_disk_LDADD = \
414  $(top_builddir)/src/util/libgnunetutil.la
415
416 test_getopt_SOURCES = \
417  test_getopt.c
418 test_getopt_LDADD = \
419  $(top_builddir)/src/util/libgnunetutil.la
420
421 test_connection_SOURCES = \
422  test_connection.c
423 test_connection_LDADD = \
424  $(top_builddir)/src/util/libgnunetutil.la
425
426 test_connection_addressing_SOURCES = \
427  test_connection_addressing.c
428 test_connection_addressing_LDADD = \
429  $(top_builddir)/src/util/libgnunetutil.la
430
431 test_connection_receive_cancel_SOURCES = \
432  test_connection_receive_cancel.c
433 test_connection_receive_cancel_LDADD = \
434  $(top_builddir)/src/util/libgnunetutil.la
435
436 test_connection_timeout_SOURCES = \
437  test_connection_timeout.c
438 test_connection_timeout_LDADD = \
439  $(top_builddir)/src/util/libgnunetutil.la
440
441 test_connection_timeout_no_connect_SOURCES = \
442  test_connection_timeout_no_connect.c
443 test_connection_timeout_no_connect_LDADD = \
444  $(top_builddir)/src/util/libgnunetutil.la
445
446 test_connection_transmit_cancel_SOURCES = \
447  test_connection_transmit_cancel.c
448 test_connection_transmit_cancel_LDADD = \
449  $(top_builddir)/src/util/libgnunetutil.la
450
451 test_mq_SOURCES = \
452  test_mq.c
453 test_mq_LDADD = \
454  $(top_builddir)/src/util/libgnunetutil.la
455
456 test_mq_client_SOURCES = \
457  test_mq_client.c
458 test_mq_client_LDADD = \
459  $(top_builddir)/src/util/libgnunetutil.la
460
461 test_os_network_SOURCES = \
462  test_os_network.c
463 test_os_network_LDADD = \
464  $(top_builddir)/src/util/libgnunetutil.la
465
466 test_peer_SOURCES = \
467  test_peer.c
468 test_peer_LDADD = \
469 $(top_builddir)/src/util/libgnunetutil.la -lgcrypt
470
471 test_plugin_SOURCES = \
472  test_plugin.c
473 test_plugin_LDADD = \
474  $(top_builddir)/src/util/libgnunetutil.la
475
476 test_program_SOURCES = \
477  test_program.c
478 test_program_LDADD = \
479  $(top_builddir)/src/util/libgnunetutil.la
480
481 test_resolver_api_SOURCES = \
482  test_resolver_api.c
483 test_resolver_api_LDADD = \
484   $(top_builddir)/src/util/libgnunetutil.la
485
486 test_scheduler_SOURCES = \
487  test_scheduler.c
488 test_scheduler_LDADD = \
489  $(top_builddir)/src/util/libgnunetutil.la
490
491 test_scheduler_delay_SOURCES = \
492  test_scheduler_delay.c
493 test_scheduler_delay_LDADD = \
494  $(top_builddir)/src/util/libgnunetutil.la
495
496 test_server_mst_interrupt_SOURCES = \
497  test_server_mst_interrupt.c
498 test_server_mst_interrupt_LDADD = \
499  $(top_builddir)/src/util/libgnunetutil.la
500
501 test_server_SOURCES = \
502  test_server.c
503 test_server_LDADD = \
504  $(top_builddir)/src/util/libgnunetutil.la
505
506 test_server_disconnect_SOURCES = \
507  test_server_disconnect.c
508 test_server_disconnect_LDADD = \
509  $(top_builddir)/src/util/libgnunetutil.la
510
511 test_server_with_client_SOURCES = \
512  test_server_with_client.c
513 test_server_with_client_LDADD = \
514  $(top_builddir)/src/util/libgnunetutil.la
515
516 test_server_with_client_unix_SOURCES = \
517  test_server_with_client_unix.c
518 test_server_with_client_unix_LDADD = \
519  $(top_builddir)/src/util/libgnunetutil.la
520
521
522 test_service_SOURCES = \
523  test_service.c
524 test_service_LDADD = \
525  $(top_builddir)/src/util/libgnunetutil.la
526
527 test_strings_SOURCES = \
528  test_strings.c
529 test_strings_LDADD = \
530  $(top_builddir)/src/util/libgnunetutil.la
531
532
533 test_strings_to_data_SOURCES = \
534  test_strings_to_data.c
535 test_strings_to_data_LDADD = \
536  $(top_builddir)/src/util/libgnunetutil.la
537
538
539 test_time_SOURCES = \
540  test_time.c
541 test_time_LDADD = \
542  $(top_builddir)/src/util/libgnunetutil.la
543
544 test_speedup_SOURCES = \
545  test_speedup.c
546 test_speedup_LDADD = \
547  $(top_builddir)/src/util/libgnunetutil.la
548
549 perf_crypto_hash_SOURCES = \
550  perf_crypto_hash.c
551 perf_crypto_hash_LDADD = \
552  $(top_builddir)/src/util/libgnunetutil.la
553
554 perf_crypto_symmetric_SOURCES = \
555  perf_crypto_symmetric.c
556 perf_crypto_symmetric_LDADD = \
557  $(top_builddir)/src/util/libgnunetutil.la
558
559 perf_malloc_SOURCES = \
560  perf_malloc.c
561 perf_malloc_LDADD = \
562  $(top_builddir)/src/util/libgnunetutil.la
563
564
565 EXTRA_DIST = \
566   test_configuration_data.conf \
567   test_program_data.conf \
568   test_resolver_api_data.conf \
569   test_service_data.conf \
570   test_speedup_data.conf \
571   gnunet-qr.py.in