chiark / gitweb /
build: Don't make libraries for precomputation utilities on demand.
[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 =
31libhash_la_LIBADD =
32
33###--------------------------------------------------------------------------
34### Component files.
35
36## CRC32.
37pkginclude_HEADERS += crc32.h
38libhash_la_SOURCES += crc32.c
39LIBMANS += crc32.3
40
41bin_PROGRAMS += crc-mktab
42crc_mktab_SOURCES = crc-mktab.c
43crc_mktab_LDADD = $(UTIL_LIBS)
44PROGMANS += crc-mktab.1
45
173ff44a
MW
46libhash_la_SOURCES += $(precomp)/crc32-tab.c
47PRECOMPS += $(precomp)/crc32-tab.c
48if !CROSS_COMPILING
49$(precomp)/crc32-tab.c:
50 @$(mkdir_p) $(precomp)
18c831dc 51 @$(MAKE) crc-mktab$(EXEEXT)
3ac6fc5f 52 $(AM_V_GEN)./crc-mktab -o $@.new \
18c831dc
MW
53 -p0x04c11db7 -b32 -B8 -r -c \
54 -scrc32_table -icrc32.h -tuint32 && \
55 mv $@.new $@
173ff44a 56endif
18c831dc 57
7cf5c72a
MW
58check_PROGRAMS += t/crc32.t
59t_crc32_t_SOURCES = t/crc32-test.c
60t_crc32_t_CPPFLAGS = $(TEST_CPPFLAGS)
61t_crc32_t_LDFLAGS = -static
62
63EXTRA_DIST += t/crc32.tests
64
18c831dc
MW
65## Universal hashing.
66pkginclude_HEADERS += unihash.h
67noinst_LTLIBRARIES += libunihash.la
68libunihash_la_SOURCES = unihash.c
69libhash_la_LIBADD += libunihash.la
70LIBMANS += unihash.3
71
72bin_PROGRAMS += unihash-mkstatic
73unihash_mkstatic_SOURCES = unihash-mkstatic.c
74unihash_mkstatic_LDADD = libunihash.la $(UTIL_LIBS)
75PROGMANS += unihash-mkstatic.1
76
173ff44a
MW
77libhash_la_SOURCES += $(precomp)/unihash-global.c
78PRECOMPS += $(precomp)/unihash-global.c
79if !CROSS_COMPILING
80$(precomp)/unihash-global.c:
81 @$(mkdir_p) $(precomp)
18c831dc 82 @$(MAKE) unihash-mkstatic$(EXEEXT)
3ac6fc5f
MW
83 $(AM_V_GEN)./unihash-mkstatic -c -sunihash_global -iunihash.h \
84 -o$@.new && mv $@.new $@
173ff44a 85endif
18c831dc 86
7cf5c72a
MW
87check_PROGRAMS += t/unihash.t
88t_unihash_t_SOURCES = t/unihash-test.c
89t_unihash_t_CPPFLAGS = $(TEST_CPPFLAGS)
90t_unihash_t_LDFLAGS = -static
18c831dc 91
7cf5c72a 92EXTRA_DIST += t/unihash-testgen.py
18c831dc
MW
93
94###----- That's all, folks --------------------------------------------------