@@@ fltfmt mess
[mLib] / hash / Makefile.am
CommitLineData
18c831dc
MW
1### -*-makefile-*-
2###
3### Build script for hashing
4###
5### (c) 2009 Straylight/Edgeware
6###
7
8###----- Licensing notice ---------------------------------------------------
9###
10### This file is part of the mLib utilities library.
11###
12### mLib is free software; you can redistribute it and/or modify
13### it under the terms of the GNU Library General Public License as
14### published by the Free Software Foundation; either version 2 of the
15### License, or (at your option) any later version.
16###
17### mLib is distributed in the hope that it will be useful,
18### but WITHOUT ANY WARRANTY; without even the implied warranty of
19### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20### GNU Library General Public License for more details.
21###
22### You should have received a copy of the GNU Library General Public
23### License along with mLib; if not, write to the Free
24### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25### MA 02111-1307, USA.
26
27include $(top_srcdir)/vars.am
28
29noinst_LTLIBRARIES = libhash.la
30libhash_la_SOURCES =
b012588c 31nodist_libhash_la_SOURCES =
18c831dc
MW
32libhash_la_LIBADD =
33
34###--------------------------------------------------------------------------
35### Component files.
36
37## CRC32.
38pkginclude_HEADERS += crc32.h
39libhash_la_SOURCES += crc32.c
c4ccbbf9 40EXTRA_DIST += crc32.3.in
18c831dc
MW
41LIBMANS += crc32.3
42
43bin_PROGRAMS += crc-mktab
44crc_mktab_SOURCES = crc-mktab.c
45crc_mktab_LDADD = $(UTIL_LIBS)
c4ccbbf9 46EXTRA_DIST += crc-mktab.1.in
18c831dc
MW
47PROGMANS += crc-mktab.1
48
b012588c 49nodist_libhash_la_SOURCES += ../precomp/crc32-tab.c
173ff44a
MW
50PRECOMPS += $(precomp)/crc32-tab.c
51if !CROSS_COMPILING
52$(precomp)/crc32-tab.c:
53 @$(mkdir_p) $(precomp)
06fc8e0b 54 @$(MAKE) crc-mktab$(EXEEXT)
3ac6fc5f 55 $(AM_V_GEN)./crc-mktab -o $@.new \
f31dd6cd 56 -p0x04c11db7 -b32 -B8 -r -cC \
18c831dc
MW
57 -scrc32_table -icrc32.h -tuint32 && \
58 mv $@.new $@
173ff44a 59endif
18c831dc 60
7cf5c72a
MW
61EXTRA_DIST += t/crc32.tests
62
b1a20bee
MW
63## SipHash.
64pkginclude_HEADERS += siphash.h
65libhash_la_SOURCES += siphash.c
66EXTRA_DIST += siphash.3.in
67LIBMANS += siphash.3
68
18c831dc
MW
69## Universal hashing.
70pkginclude_HEADERS += unihash.h
71noinst_LTLIBRARIES += libunihash.la
72libunihash_la_SOURCES = unihash.c
73libhash_la_LIBADD += libunihash.la
c4ccbbf9 74EXTRA_DIST += unihash.3.in
18c831dc
MW
75LIBMANS += unihash.3
76
77bin_PROGRAMS += unihash-mkstatic
78unihash_mkstatic_SOURCES = unihash-mkstatic.c
79unihash_mkstatic_LDADD = libunihash.la $(UTIL_LIBS)
c4ccbbf9 80EXTRA_DIST += unihash-mkstatic.1.in
18c831dc
MW
81PROGMANS += unihash-mkstatic.1
82
b012588c 83nodist_libhash_la_SOURCES += ../precomp/unihash-global.c
173ff44a
MW
84PRECOMPS += $(precomp)/unihash-global.c
85if !CROSS_COMPILING
86$(precomp)/unihash-global.c:
87 @$(mkdir_p) $(precomp)
06fc8e0b 88 @$(MAKE) unihash-mkstatic$(EXEEXT)
3ac6fc5f
MW
89 $(AM_V_GEN)./unihash-mkstatic -c -sunihash_global -iunihash.h \
90 -o$@.new && mv $@.new $@
173ff44a 91endif
18c831dc 92
c81c35df 93EXTRA_DIST += t/unihash-testgen
18c831dc 94
b64eb60f
MW
95## Test program.
96check_PROGRAMS += t/hash.t
97t_hash_t_SOURCES = t/hash-test.c
98t_hash_t_CPPFLAGS = $(TEST_CPPFLAGS)
99t_hash_t_LDFLAGS = -static
100
18c831dc 101###----- That's all, folks --------------------------------------------------