noinst_LTLIBRARIES = libhash.la
libhash_la_SOURCES =
+nodist_libhash_la_SOURCES =
libhash_la_LIBADD =
###--------------------------------------------------------------------------
crc_mktab_LDADD = $(UTIL_LIBS)
PROGMANS += crc-mktab.1
-libhash_la_SOURCES += crc32-tab.c
-CLEANFILES += crc32-tab.c
-crc32-tab.c:
- @$(build_util_libs)
+nodist_libhash_la_SOURCES += ../precomp/crc32-tab.c
+PRECOMPS += $(precomp)/crc32-tab.c
+if !CROSS_COMPILING
+$(precomp)/crc32-tab.c:
+ @$(mkdir_p) $(precomp)
@$(MAKE) crc-mktab$(EXEEXT)
- ./crc-mktab -o $@.new \
- -p0x04c11db7 -b32 -B8 -r -c \
+ $(AM_V_GEN)./crc-mktab -o $@.new \
+ -p0x04c11db7 -b32 -B8 -r -cC \
-scrc32_table -icrc32.h -tuint32 && \
mv $@.new $@
+endif
+
+EXTRA_DIST += t/crc32.tests
## Universal hashing.
pkginclude_HEADERS += unihash.h
unihash_mkstatic_LDADD = libunihash.la $(UTIL_LIBS)
PROGMANS += unihash-mkstatic.1
-libhash_la_SOURCES += unihash-global.c
-CLEANFILES += unihash-global.c
-unihash-global.c:
- @$(build_util_libs)
+nodist_libhash_la_SOURCES += ../precomp/unihash-global.c
+PRECOMPS += $(precomp)/unihash-global.c
+if !CROSS_COMPILING
+$(precomp)/unihash-global.c:
+ @$(mkdir_p) $(precomp)
@$(MAKE) unihash-mkstatic$(EXEEXT)
- ./unihash-mkstatic -c -sunihash_global -iunihash.h -o$@.new && \
- mv $@.new $@
-
-check_PROGRAMS += unihash.t
-unihash_t_SOURCES = unihash.c
-unihash_t_CPPFLAGS = $(TEST_CPPFLAGS)
-unihash_t_LDFLAGS = -static
-
-tests:: unihash.t unihash.in
- ./unihash.t -f unihash.in
+ $(AM_V_GEN)./unihash-mkstatic -c -sunihash_global -iunihash.h \
+ -o$@.new && mv $@.new $@
+endif
-EXTRA_DIST += unihash-check.pl
-CLEANFILES += unihash.in
-unihash.in: unihash-check.pl
- perl $(srcdir)/unihash-check.pl >$@.new && mv $@.new $@
+EXTRA_DIST += t/unihash-testgen.py
+## Test program.
+check_PROGRAMS += t/hash.t
+t_hash_t_SOURCES = t/hash-test.c
+t_hash_t_CPPFLAGS = $(TEST_CPPFLAGS)
+t_hash_t_LDFLAGS = -static
###----- That's all, folks --------------------------------------------------