Commit | Line | Data |
---|---|---|
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 | ||
27 | include $(top_srcdir)/vars.am | |
28 | ||
29 | noinst_LTLIBRARIES = libhash.la | |
30 | libhash_la_SOURCES = | |
31 | libhash_la_LIBADD = | |
32 | ||
33 | ###-------------------------------------------------------------------------- | |
34 | ### Component files. | |
35 | ||
36 | ## CRC32. | |
37 | pkginclude_HEADERS += crc32.h | |
38 | libhash_la_SOURCES += crc32.c | |
39 | LIBMANS += crc32.3 | |
40 | ||
41 | bin_PROGRAMS += crc-mktab | |
42 | crc_mktab_SOURCES = crc-mktab.c | |
43 | crc_mktab_LDADD = $(UTIL_LIBS) | |
44 | PROGMANS += crc-mktab.1 | |
45 | ||
46 | libhash_la_SOURCES += crc32-tab.c | |
47 | CLEANFILES += crc32-tab.c | |
48 | crc32-tab.c: | |
49 | @$(build_util_libs) | |
50 | @$(MAKE) crc-mktab$(EXEEXT) | |
51 | ./crc-mktab -o $@.new \ | |
52 | -p0x04c11db7 -b32 -B8 -r -c \ | |
53 | -scrc32_table -icrc32.h -tuint32 && \ | |
54 | mv $@.new $@ | |
55 | ||
56 | ## Universal hashing. | |
57 | pkginclude_HEADERS += unihash.h | |
58 | noinst_LTLIBRARIES += libunihash.la | |
59 | libunihash_la_SOURCES = unihash.c | |
60 | libhash_la_LIBADD += libunihash.la | |
61 | LIBMANS += unihash.3 | |
62 | ||
63 | bin_PROGRAMS += unihash-mkstatic | |
64 | unihash_mkstatic_SOURCES = unihash-mkstatic.c | |
65 | unihash_mkstatic_LDADD = libunihash.la $(UTIL_LIBS) | |
66 | PROGMANS += unihash-mkstatic.1 | |
67 | ||
68 | libhash_la_SOURCES += unihash-global.c | |
69 | CLEANFILES += unihash-global.c | |
70 | unihash-global.c: | |
71 | @$(build_util_libs) | |
72 | @$(MAKE) unihash-mkstatic$(EXEEXT) | |
73 | ./unihash-mkstatic -c -sunihash_global -iunihash.h -o$@.new && \ | |
74 | mv $@.new $@ | |
75 | ||
76 | check_PROGRAMS += unihash.t | |
77 | unihash_t_SOURCES = unihash.c | |
78 | unihash_t_CPPFLAGS = $(TEST_CPPFLAGS) | |
79 | unihash_t_LDFLAGS = -static | |
80 | ||
81 | tests:: unihash.t unihash.in | |
82 | ./unihash.t -f unihash.in | |
83 | ||
84 | EXTRA_DIST += unihash-check.pl | |
85 | CLEANFILES += unihash.in | |
86 | unihash.in: unihash-check.pl | |
87 | perl $(srcdir)/unihash-check.pl >$@.new && mv $@.new $@ | |
88 | ||
89 | ||
90 | ###----- That's all, folks -------------------------------------------------- |