@@@ tvec doc wip
[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
40LIBMANS += crc32.3
41
42bin_PROGRAMS += crc-mktab
43crc_mktab_SOURCES = crc-mktab.c
44crc_mktab_LDADD = $(UTIL_LIBS)
45PROGMANS += crc-mktab.1
46
b012588c 47nodist_libhash_la_SOURCES += ../precomp/crc32-tab.c
173ff44a
MW
48PRECOMPS += $(precomp)/crc32-tab.c
49if !CROSS_COMPILING
50$(precomp)/crc32-tab.c:
51 @$(mkdir_p) $(precomp)
06fc8e0b 52 @$(MAKE) crc-mktab$(EXEEXT)
3ac6fc5f 53 $(AM_V_GEN)./crc-mktab -o $@.new \
f31dd6cd 54 -p0x04c11db7 -b32 -B8 -r -cC \
18c831dc
MW
55 -scrc32_table -icrc32.h -tuint32 && \
56 mv $@.new $@
173ff44a 57endif
18c831dc 58
7cf5c72a
MW
59EXTRA_DIST += t/crc32.tests
60
18c831dc
MW
61## Universal hashing.
62pkginclude_HEADERS += unihash.h
63noinst_LTLIBRARIES += libunihash.la
64libunihash_la_SOURCES = unihash.c
65libhash_la_LIBADD += libunihash.la
66LIBMANS += unihash.3
67
68bin_PROGRAMS += unihash-mkstatic
69unihash_mkstatic_SOURCES = unihash-mkstatic.c
70unihash_mkstatic_LDADD = libunihash.la $(UTIL_LIBS)
71PROGMANS += unihash-mkstatic.1
72
b012588c 73nodist_libhash_la_SOURCES += ../precomp/unihash-global.c
173ff44a
MW
74PRECOMPS += $(precomp)/unihash-global.c
75if !CROSS_COMPILING
76$(precomp)/unihash-global.c:
77 @$(mkdir_p) $(precomp)
06fc8e0b 78 @$(MAKE) unihash-mkstatic$(EXEEXT)
3ac6fc5f
MW
79 $(AM_V_GEN)./unihash-mkstatic -c -sunihash_global -iunihash.h \
80 -o$@.new && mv $@.new $@
173ff44a 81endif
18c831dc 82
c81c35df 83EXTRA_DIST += t/unihash-testgen
18c831dc 84
b64eb60f
MW
85## Test program.
86check_PROGRAMS += t/hash.t
87t_hash_t_SOURCES = t/hash-test.c
88t_hash_t_CPPFLAGS = $(TEST_CPPFLAGS)
89t_hash_t_LDFLAGS = -static
90
18c831dc 91###----- That's all, folks --------------------------------------------------