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