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