summaryrefslogtreecommitdiff
path: root/src/local.mk
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-11-12 08:32:04 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2012-11-12 08:32:31 -0800
commitf16e251dae43117c2cd19359c26ce7b5e05165b6 (patch)
tree7232d39cb3dba3f89480d3aac383b73779826aba /src/local.mk
parent0d664d227cadb8cf4892e70954cd6c616192c0f8 (diff)
downloadcoreutils-f16e251dae43117c2cd19359c26ce7b5e05165b6.tar.xz
factor: maintainer builds primes.h, not builder
With this change, the maintainer builds primes.h and it is part of the tarball. primes.h's contents are not architecture-specific. * .gitignore: Remove /src/primes.h. * src/factor.c: Include verify.h. (W): New constant. Verify that uintmax_t lacks holes and that W is no wider than the integers used to generate primes.h. * src/local.mk (EXTRA_DIST): Add src/primes.h. (BUILT_SOURCES, CLEANFILES): Remove src/primes.h. ($(top_srcdir)/src/primes.h): Rename from src/primes.h. Do not depend on src/make-prime-list. Instead, use sub-make to build, so that we build primes.h only if it does not exist. * src/make-prime-list.c: Include <limits.h>, for ULONG_MAX. (wide_uint): Define to uintmax_t or unsigned __int128 if not #defined. (struct prime, binvert, process_prime): Use it instead of uintmax_t. (print_wide_uint): New function. This generates the proper pinv value regardless of the width of uintmax_t on the target, so long as the width doesn't exceed that of the width of wide_uint on the maintainer host that generated src/primes.h. (output_primes): Use it. Output WIDE_UINT_BITS, too. Let the target compute its own lim, since its uintmax_t may be narrower than ours. (SZ): Remove. * src/primes.h: New file, generated with 128-bit integers and usable on any host where uintmax_t's width is no greater than 128 bits.
Diffstat (limited to 'src/local.mk')
-rw-r--r--src/local.mk12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/local.mk b/src/local.mk
index f40f68175..02a9bf55d 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -62,6 +62,7 @@ noinst_HEADERS = \
EXTRA_DIST += \
src/dcgen \
src/dircolors.hin \
+ src/primes.h \
src/tac-pipe.c \
src/extract-magic \
src/c99-to-c89.diff
@@ -379,9 +380,14 @@ src/dircolors.h: src/dcgen src/dircolors.hin
$(AM_V_at)chmod a-w $@-t
$(AM_V_at)mv $@-t $@
-BUILT_SOURCES += src/primes.h
-CLEANFILES += src/primes.h
-src/primes.h: src/make-prime-list
+# This file is built by maintainers. It's architecture-independent,
+# and it needs to be built on a widest-known-int architecture, so it's
+# built only if absent. It is not cleaned because we don't want to
+# insist that maintainers must build on hosts that support the widest
+# known ints (currently 128-bit).
+MAINTAINERCLEANFILES += $(top_srcdir)/src/primes.h
+$(top_srcdir)/src/primes.h:
+ $(MAKE) src/make-prime-list
$(AM_V_GEN)rm -f $@ $@-t
$(AM_V_at)src/make-prime-list 5000 > $@-t
$(AM_V_at)chmod a-w $@-t