chiark / gitweb /
@@@ tvec doc wip
[mLib] / hash / Makefile.am
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
27 include $(top_srcdir)/vars.am
28
29 noinst_LTLIBRARIES       = libhash.la
30 libhash_la_SOURCES       =
31 nodist_libhash_la_SOURCES =
32 libhash_la_LIBADD        =
33
34 ###--------------------------------------------------------------------------
35 ### Component files.
36
37 ## CRC32.
38 pkginclude_HEADERS      += crc32.h
39 libhash_la_SOURCES      += crc32.c
40 LIBMANS                 += crc32.3
41
42 bin_PROGRAMS            += crc-mktab
43 crc_mktab_SOURCES        = crc-mktab.c
44 crc_mktab_LDADD          = $(UTIL_LIBS)
45 PROGMANS                += crc-mktab.1
46
47 nodist_libhash_la_SOURCES += ../precomp/crc32-tab.c
48 PRECOMPS                += $(precomp)/crc32-tab.c
49 if !CROSS_COMPILING
50 $(precomp)/crc32-tab.c:
51         @$(mkdir_p) $(precomp)
52         @$(MAKE) crc-mktab$(EXEEXT)
53         $(AM_V_GEN)./crc-mktab -o $@.new \
54                 -p0x04c11db7 -b32 -B8 -r -cC \
55                 -scrc32_table -icrc32.h -tuint32 && \
56         mv $@.new $@
57 endif
58
59 EXTRA_DIST              += t/crc32.tests
60
61 ## Universal hashing.
62 pkginclude_HEADERS      += unihash.h
63 noinst_LTLIBRARIES      += libunihash.la
64 libunihash_la_SOURCES    = unihash.c
65 libhash_la_LIBADD       += libunihash.la
66 LIBMANS                 += unihash.3
67
68 bin_PROGRAMS            += unihash-mkstatic
69 unihash_mkstatic_SOURCES = unihash-mkstatic.c
70 unihash_mkstatic_LDADD   = libunihash.la $(UTIL_LIBS)
71 PROGMANS                += unihash-mkstatic.1
72
73 nodist_libhash_la_SOURCES += ../precomp/unihash-global.c
74 PRECOMPS                += $(precomp)/unihash-global.c
75 if !CROSS_COMPILING
76 $(precomp)/unihash-global.c:
77         @$(mkdir_p) $(precomp)
78         @$(MAKE) unihash-mkstatic$(EXEEXT)
79         $(AM_V_GEN)./unihash-mkstatic -c -sunihash_global -iunihash.h \
80                 -o$@.new && mv $@.new $@
81 endif
82
83 EXTRA_DIST              += t/unihash-testgen
84
85 ## Test program.
86 check_PROGRAMS          += t/hash.t
87 t_hash_t_SOURCES         = t/hash-test.c
88 t_hash_t_CPPFLAGS        = $(TEST_CPPFLAGS)
89 t_hash_t_LDFLAGS         = -static
90
91 ###----- That's all, folks --------------------------------------------------