2008-03-20 21:19:56 +08:00
|
|
|
# Customize maint.mk -*- makefile -*-
|
2012-01-01 16:47:10 +08:00
|
|
|
# Copyright (C) 2003-2012 Free Software Foundation, Inc.
|
2003-08-26 17:29:26 +08:00
|
|
|
|
2007-07-23 20:35:58 +08:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
2003-08-26 17:29:26 +08:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
2007-07-23 20:35:58 +08:00
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
2003-08-26 17:29:26 +08:00
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-07-23 20:35:58 +08:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2001-06-17 12:11:03 +08:00
|
|
|
|
2009-03-03 15:24:29 +08:00
|
|
|
# Used in maint.mk's web-manual rule
|
|
|
|
manual_title = Core GNU utilities
|
|
|
|
|
2011-11-10 16:27:17 +08:00
|
|
|
# Use the direct link. This is guaranteed to work immediately, while
|
|
|
|
# it can take a while for the faster mirror links to become usable.
|
|
|
|
url_dir_list = http://ftp.gnu.org/gnu/$(PACKAGE)
|
|
|
|
|
2006-06-19 06:06:42 +08:00
|
|
|
# Tests not to run as part of "make distcheck".
|
2012-09-02 19:46:17 +08:00
|
|
|
local-checks-to-skip = \
|
|
|
|
sc_proper_name_utf8_requires_ICONV
|
2008-09-24 21:02:19 +08:00
|
|
|
|
2009-04-25 10:16:27 +08:00
|
|
|
# Tools used to bootstrap this package, used for "announcement".
|
|
|
|
bootstrap-tools = autoconf,automake,gnulib,bison
|
|
|
|
|
2009-04-16 13:03:59 +08:00
|
|
|
# Now that we have better tests, make this the default.
|
2008-04-12 15:52:42 +08:00
|
|
|
export VERBOSE = yes
|
2008-04-23 03:28:33 +08:00
|
|
|
|
2012-03-03 16:41:31 +08:00
|
|
|
# Comparing tarball sizes compressed using different xz presets, we see that
|
|
|
|
# an -8e-compressed tarball is only 9KiB larger than the -9e-compressed one.
|
|
|
|
# Using -8e is preferred, since that lets the decompression process use half
|
|
|
|
# the memory (32MiB rather than 64MiB).
|
|
|
|
# $ for i in {7,8,9}{e,}; do \
|
|
|
|
# (n=$(xz -$i < coreutils-8.15*.tar|wc -c);echo $n $i) & done |sort -nr
|
|
|
|
# 5129388 7
|
|
|
|
# 5036524 7e
|
|
|
|
# 5017476 8
|
|
|
|
# 5010604 9
|
|
|
|
# 4923016 8e
|
|
|
|
# 4914152 9e
|
|
|
|
export XZ_OPT = -8e
|
|
|
|
|
2012-10-24 00:27:19 +08:00
|
|
|
old_NEWS_hash = b93e7e43dd35f32961c354e41211b86e
|
2008-12-26 19:00:18 +08:00
|
|
|
|
2010-01-08 13:15:14 +08:00
|
|
|
# Add an exemption for sc_makefile_at_at_check.
|
|
|
|
_makefile_at_at_check_exceptions = ' && !/^cu_install_program =/'
|
|
|
|
|
2010-04-11 04:43:01 +08:00
|
|
|
# Our help-version script is in a slightly different location.
|
|
|
|
_hv_file ?= $(srcdir)/tests/misc/help-version
|
|
|
|
|
2008-12-26 19:00:18 +08:00
|
|
|
# Ensure that the list of O_ symbols used to compute O_FULLBLOCK is complete.
|
|
|
|
dd = $(srcdir)/src/dd.c
|
|
|
|
sc_dd_O_FLAGS:
|
|
|
|
@rm -f $@.1 $@.2
|
2011-02-23 05:14:00 +08:00
|
|
|
@{ echo O_FULLBLOCK; echo O_NOCACHE; \
|
|
|
|
perl -nle '/^ +\| (O_\w*)$$/ and print $$1' $(dd); } | sort > $@.1
|
2008-12-26 19:00:18 +08:00
|
|
|
@{ echo O_NOFOLLOW; perl -nle '/{"[a-z]+",\s*(O_\w+)},/ and print $$1' \
|
|
|
|
$(dd); } | sort > $@.2
|
|
|
|
@diff -u $@.1 $@.2 || diff=1 || diff=; \
|
|
|
|
rm -f $@.1 $@.2; \
|
|
|
|
test "$$diff" \
|
|
|
|
&& { echo '$(ME): $(dd) has inconsistent O_ flag lists'>&2; \
|
|
|
|
exit 1; } || :
|
2008-12-26 22:39:41 +08:00
|
|
|
|
|
|
|
# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
|
|
|
|
# with the strings from the two affected variables.
|
|
|
|
dd_c = $(srcdir)/src/dd.c
|
|
|
|
sc_dd_max_sym_length:
|
|
|
|
ifneq ($(wildcard $(dd_c)),)
|
|
|
|
@len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
|
|
|
|
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|
|
|
|
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
|
|
|
|
| wc --max-line-length); \
|
|
|
|
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|
|
|
|
|tr -d '"' | wc --max-line-length); \
|
|
|
|
if test "$$len" = "$$max"; then :; else \
|
|
|
|
echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
endif
|
|
|
|
|
maint: quote 'like this' or "like this", not `like this'
* doc/coreutils.texi (Formatting the file names):
coreutils now quotes 'like this'.
* man/help2man:
* src/timeout.c (usage): Quote 'like this' in diagnostics.
* HACKING, Makefile.am, NEWS, README, README-hacking, TODO, cfg.mk:
* doc/Makefile.am, doc/coreutils.texi, m4/jm-macros.m4:
* man/Makefile.am, man/help2man, src/Makefile.am, src/copy.h:
* src/extract-magic, src/ls.c, src/pinky.c, src/pr.c, src/sort.c:
* src/split.c, src/timeout.c, src/who.c, tests/dd/skip-seek-past-file:
* tests/pr/pr-tests: Quote 'like this' in commentary.
* cfg.mk (old_NEWS_hash): Update due to changed old NEWS.
2012-01-23 07:26:00 +08:00
|
|
|
# Many m4 macros names once began with 'jm_'.
|
2008-12-26 22:39:41 +08:00
|
|
|
# On 2004-04-13, they were all changed to start with gl_ instead.
|
|
|
|
# Make sure that none are inadvertently reintroduced.
|
|
|
|
sc_prohibit_jm_in_m4:
|
|
|
|
@grep -nE 'jm_[A-Z]' \
|
|
|
|
$$($(VC_LIST) m4 |grep '\.m4$$'; echo /dev/null) && \
|
|
|
|
{ echo '$(ME): do not use jm_ in m4 macro names' \
|
|
|
|
1>&2; exit 1; } || :
|
|
|
|
|
|
|
|
# Ensure that each root-requiring test is run via the "check-root" rule.
|
|
|
|
sc_root_tests:
|
2012-09-03 03:55:17 +08:00
|
|
|
@t1=sc-root.expected; t2=sc-root.actual; \
|
|
|
|
grep -nl '^ *require_root_$$' `$(VC_LIST) tests` | sort > $$t1; \
|
|
|
|
for t in $(all_root_tests); do echo $$t; done | sort > $$t2; \
|
|
|
|
st=0; diff -u $$t1 $$t2 || st=1; \
|
2008-12-26 22:39:41 +08:00
|
|
|
rm -f $$t1 $$t2; \
|
2012-09-03 03:55:17 +08:00
|
|
|
exit $$st
|
2008-12-26 22:39:41 +08:00
|
|
|
|
2012-09-03 03:55:15 +08:00
|
|
|
# Ensure that all version-controlled test cases are listed in $(all_tests).
|
|
|
|
sc_tests_list_consistency:
|
|
|
|
@bs="\\"; \
|
|
|
|
test_extensions_rx=`echo $(TEST_EXTENSIONS) \
|
|
|
|
| sed -e "s/ /|/g" -e "s/$$bs./$$bs$$bs./g"`; \
|
|
|
|
{ \
|
|
|
|
for t in $(all_tests); do echo $$t; done; \
|
|
|
|
cd $(top_srcdir); \
|
|
|
|
$(SHELL) build-aux/vc-list-files tests \
|
2012-10-27 19:24:18 +08:00
|
|
|
| grep -Ev '^tests/(factor/(run|create-test)|init)\.sh$$' \
|
2012-09-03 03:55:15 +08:00
|
|
|
| $(EGREP) "$$test_extensions_rx\$$"; \
|
|
|
|
} | sort | uniq -u | grep . && exit 1; :
|
|
|
|
|
2008-12-26 22:39:41 +08:00
|
|
|
# Create a list of regular expressions matching the names
|
|
|
|
# of files included from system.h. Exclude a couple.
|
|
|
|
.re-list:
|
|
|
|
@sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
|
|
|
|
| grep -Ev 'sys/(param|file)\.h' \
|
|
|
|
| sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
|
|
|
|
> $@-t
|
|
|
|
@mv $@-t $@
|
|
|
|
|
2010-05-10 17:06:37 +08:00
|
|
|
define gl_trap_
|
|
|
|
Exit () { set +e; (exit $$1); exit $$1; }; \
|
|
|
|
for sig in 1 2 3 13 15; do \
|
|
|
|
eval "trap 'Exit $$(expr $$sig + 128)' $$sig"; \
|
|
|
|
done
|
|
|
|
endef
|
|
|
|
|
2008-12-26 22:39:41 +08:00
|
|
|
# Files in src/ should not include directly any of
|
|
|
|
# the headers already included via system.h.
|
|
|
|
sc_system_h_headers: .re-list
|
|
|
|
@if test -f $(srcdir)/src/system.h; then \
|
2010-01-31 00:02:36 +08:00
|
|
|
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0; \
|
2010-05-03 21:35:56 +08:00
|
|
|
$(gl_trap_); \
|
2008-12-26 22:39:41 +08:00
|
|
|
grep -nE -f .re-list \
|
2010-08-11 01:03:09 +08:00
|
|
|
$$($(VC_LIST_EXCEPT) | grep '^\($(srcdir)/\)\?src/') \
|
2008-12-26 22:39:41 +08:00
|
|
|
&& { echo '$(ME): the above are already included via system.h'\
|
|
|
|
1>&2; exit 1; } || :; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
sc_sun_os_names:
|
|
|
|
@grep -nEi \
|
|
|
|
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
|
|
|
|
$$($(VC_LIST_EXCEPT)) && \
|
|
|
|
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
|
|
|
|
exit 1; } || :
|
|
|
|
|
2012-09-01 07:46:44 +08:00
|
|
|
# Ensure that the list of programs and author names is accurate.
|
|
|
|
# We need a UTF8 locale. If a lack of locale support or a missing
|
|
|
|
# translation inhibits printing of UTF-8 names, just skip this test.
|
|
|
|
au_dotdot = authors-dotdot
|
|
|
|
au_actual = authors-actual
|
|
|
|
sc_check-AUTHORS: $(all_programs)
|
|
|
|
@locale=en_US.UTF-8; \
|
|
|
|
LC_ALL=$$locale ./src/cat --version \
|
|
|
|
| grep ' Torbjorn ' > /dev/null \
|
|
|
|
&& { echo "$@: skipping this check"; exit 0; }; \
|
|
|
|
rm -f $(au_actual) $(au_dotdot); \
|
|
|
|
for i in `ls $(all_programs) \
|
|
|
|
| sed -e 's,^src/,,' -e 's,$(EXEEXT)$$,,' \
|
|
|
|
| sed /libstdbuf/d \
|
|
|
|
| $(ASSORT) -u`; do \
|
|
|
|
test "$$i" = '[' && continue; \
|
|
|
|
exe=$$i; \
|
|
|
|
if test "$$i" = install; then \
|
|
|
|
exe=ginstall; \
|
|
|
|
elif test "$$i" = test; then \
|
|
|
|
exe='['; \
|
|
|
|
fi; \
|
|
|
|
LC_ALL=$$locale ./src/$$exe --version \
|
|
|
|
| perl -0 -pi -e 's/,\n/, /gm' \
|
|
|
|
| sed -n -e '/Written by /{ s//'"$$i"': /;' \
|
|
|
|
-e 's/,* and /, /; s/\.$$//; p; }'; \
|
|
|
|
done > $(au_actual) && \
|
|
|
|
sed -n '/^[^ ][^ ]*:/p' $(srcdir)/AUTHORS > $(au_dotdot) \
|
|
|
|
&& diff $(au_actual) $(au_dotdot) \
|
|
|
|
&& rm -f $(au_actual) $(au_dotdot)
|
2009-08-18 18:12:21 +08:00
|
|
|
|
2012-10-26 00:35:34 +08:00
|
|
|
# Each program with a non-ASCII author name must link with LIBICONV.
|
2012-10-25 17:59:23 +08:00
|
|
|
sc_check-I18N-AUTHORS:
|
2012-10-26 00:35:34 +08:00
|
|
|
@cd $(srcdir)/src && \
|
2012-10-25 17:59:23 +08:00
|
|
|
for i in $$(git grep -l -w proper_name_utf8 *.c|sed 's/\.c//'); do \
|
2012-10-26 00:35:34 +08:00
|
|
|
grep -E "^src_$${i}_LDADD"' .?= .*\$$\(LIBICONV\)' local.mk \
|
|
|
|
> /dev/null \
|
2012-11-04 08:55:57 +08:00
|
|
|
|| { echo "$(ME): link rules for $$i do not include" \
|
2012-10-26 00:35:34 +08:00
|
|
|
'$$(LIBICONV)' 1>&2; exit 1; }; \
|
|
|
|
done
|
2012-10-25 17:59:23 +08:00
|
|
|
|
2012-10-30 10:12:23 +08:00
|
|
|
# Ensure %j is not used for intmax_t as it's not universally supported.
|
|
|
|
# There are issues on HPUX for example. But note that %ju was used between
|
|
|
|
# coreutils 8.13 (2011-10) and 8.20 (2012-10) without any reported issue,
|
|
|
|
# and the particular issue this check is associated with was for %*jx.
|
|
|
|
# So we may be able to relax this restriction soon.
|
|
|
|
sc_prohibit-j-printf-format:
|
|
|
|
@cd $(srcdir)/src && GIT_PAGER= git grep -n '%[0*]*j[udx]' *.c \
|
|
|
|
&& { echo '$(ME): Use PRI*MAX instead of %j' 1>&2; exit 1; } \
|
|
|
|
|| :
|
|
|
|
|
coreutils: keep lines within 80-column limits
* cfg.mk (LINE_LEN_MAX, FILTER_LONG_LINES): New macros.
(sc_long_lines): New rule.
* HACKING: Use shorter URLs to the same material.
* doc/Makefile.am, doc/coreutils.texi, m4/boottime.m4:
* man/help2man, man/stdbuf.x, src/Makefile.am, src/cat.c, src/copy.c:
* src/cp.c, src/dd.c, src/df.c, src/du.c, src/groups.c, src/install.c:
* src/ls.c, src/md5sum.c, src/mv.c, src/od.c, src/pinky.c, src/ptx.c:
* src/readlink.c, src/remove.c, src/rmdir.c, src/setuidgid.c:
* src/sort.c, src/tail.c, src/touch.c, tests/Coreutils.pm:
* tests/cp/existing-perm-race, tests/cp/perm, tests/cp/preserve-gid:
* tests/du/2g, tests/du/long-from-unreadable, tests/init.sh:
* tests/install/basic-1, tests/ls/nameless-uid:
* tests/ls/readdir-mountpoint-inode, tests/misc/chroot-credentials:
* tests/misc/cut, tests/misc/date, tests/misc/join, tests/misc/md5sum:
* tests/misc/sha1sum, tests/misc/sha224sum, tests/misc/sort:
* tests/misc/sort-continue, tests/misc/sort-files0-from:
* tests/misc/sort-rand, tests/misc/stdbuf, tests/misc/tr:
* tests/misc/uniq, tests/mv/atomic, tests/mv/part-fail:
* tests/mv/part-symlink, tests/mv/sticky-to-xpart, tests/pr/pr-tests:
* tests/rm/fail-2eperm, tests/rm/interactive-always:
Reformat to fit within 80 columns.
* doc/Makefile.am (BAD_POSIX_PERL): New macro.
* doc/coreutils.texi: Reword slightly, to make menus and
index lines shorter.
* src/md5sum.c: Redo --help output so that it fits within 79
columns, since that's a bit more portable and all the other --help
strings fit in 79 columns.
2010-12-29 04:28:48 +08:00
|
|
|
# Look for lines longer than 80 characters, except omit:
|
|
|
|
# - program-generated long lines in diff headers,
|
|
|
|
# - tests involving long checksum lines, and
|
|
|
|
# - the 'pr' test cases.
|
|
|
|
LINE_LEN_MAX = 80
|
|
|
|
FILTER_LONG_LINES = \
|
|
|
|
/^[^:]*\.diff:[^:]*:@@ / d; \
|
2012-08-31 16:07:54 +08:00
|
|
|
\|^[^:]*tests/misc/sha[0-9]*sum.*\.pl[-:]| d; \
|
coreutils: keep lines within 80-column limits
* cfg.mk (LINE_LEN_MAX, FILTER_LONG_LINES): New macros.
(sc_long_lines): New rule.
* HACKING: Use shorter URLs to the same material.
* doc/Makefile.am, doc/coreutils.texi, m4/boottime.m4:
* man/help2man, man/stdbuf.x, src/Makefile.am, src/cat.c, src/copy.c:
* src/cp.c, src/dd.c, src/df.c, src/du.c, src/groups.c, src/install.c:
* src/ls.c, src/md5sum.c, src/mv.c, src/od.c, src/pinky.c, src/ptx.c:
* src/readlink.c, src/remove.c, src/rmdir.c, src/setuidgid.c:
* src/sort.c, src/tail.c, src/touch.c, tests/Coreutils.pm:
* tests/cp/existing-perm-race, tests/cp/perm, tests/cp/preserve-gid:
* tests/du/2g, tests/du/long-from-unreadable, tests/init.sh:
* tests/install/basic-1, tests/ls/nameless-uid:
* tests/ls/readdir-mountpoint-inode, tests/misc/chroot-credentials:
* tests/misc/cut, tests/misc/date, tests/misc/join, tests/misc/md5sum:
* tests/misc/sha1sum, tests/misc/sha224sum, tests/misc/sort:
* tests/misc/sort-continue, tests/misc/sort-files0-from:
* tests/misc/sort-rand, tests/misc/stdbuf, tests/misc/tr:
* tests/misc/uniq, tests/mv/atomic, tests/mv/part-fail:
* tests/mv/part-symlink, tests/mv/sticky-to-xpart, tests/pr/pr-tests:
* tests/rm/fail-2eperm, tests/rm/interactive-always:
Reformat to fit within 80 columns.
* doc/Makefile.am (BAD_POSIX_PERL): New macro.
* doc/coreutils.texi: Reword slightly, to make menus and
index lines shorter.
* src/md5sum.c: Redo --help output so that it fits within 79
columns, since that's a bit more portable and all the other --help
strings fit in 79 columns.
2010-12-29 04:28:48 +08:00
|
|
|
\|^[^:]*tests/pr/|{ \|^[^:]*tests/pr/pr-tests:| !d; };
|
|
|
|
sc_long_lines:
|
|
|
|
@files=$$($(VC_LIST_EXCEPT)) \
|
|
|
|
halt='line(s) with more than $(LINE_LEN_MAX) characters; reindent'; \
|
|
|
|
for file in $$files; do \
|
|
|
|
expand $$file | grep -nE '^.{$(LINE_LEN_MAX)}.' | \
|
|
|
|
sed -e "s|^|$$file:|" -e '$(FILTER_LONG_LINES)'; \
|
|
|
|
done | grep . && { msg="$$halt" $(_sc_say_and_exit) } || :
|
|
|
|
|
2012-08-29 23:37:35 +08:00
|
|
|
# Option descriptions should not start with a capital letter.
|
2010-02-12 23:19:15 +08:00
|
|
|
# One could grep source directly as follows:
|
|
|
|
# grep -E " {2,6}-.*[^.] [A-Z][a-z]" $$($(VC_LIST_EXCEPT) | grep '\.c$$')
|
|
|
|
# but that would miss descriptions not on the same line as the -option.
|
build: simplify and make more portable to non-GNU make
The AC_SUBST'd variable '$(NO_INSTALL_PROGS_DEFAULT)' is only used in
makefile expressions expanding the list of manual pages that are not
built by default (but might need to be when a distribution tarball
is created). Such expressions exploited a feature of make variable
expansion -- namely, $(VAR:%=dir/%.x) -- that, while seemingly quite
portable in practice, is not POSIX-conforming, and could break on
lesser vendor make implementations. So kill two birds with one stone,
by getting rid of the $(NO_INSTALL_PROGS_DEFAULT) intermediate variable
and improving makefile portability in the process.
While at it, we also clean up some other minor naming inconsistency
and useless indirection.
* configure.ac (NO_INSTALL_PROGS_DEFAULT): Don't define or AC_SUBST
anymore; instead ...
(EXTRA_MANS): ... define and AC_SUBST these.
* man/local.mk (extra_man_1): Rename ...
(EXTRA_MANS): ... like this, explicitly making clear it's AC_SUBST'd.
(extra_man_x): It's used only once, no need to define it; just inline
its only expansion where needed.
(EXTRA_DIST): Adjust.
(ALL_MANS): New, union of $(EXTRA_MANS) and $(dist_man1_MANS).
* cfg.mk (check-x-vs-1, sc_option_desc_uppercase): Rely on $(ALL_MANS)
rather than on $(NO_INSTALL_PROGS_DEFAULT) and $(dist_man1_MANS).
2012-09-01 07:46:48 +08:00
|
|
|
sc_option_desc_uppercase: $(ALL_MANS)
|
2012-08-31 18:08:49 +08:00
|
|
|
@grep '^\\fB\\-' -A1 man/*.1 | LC_ALL=C grep '\.1.[A-Z][a-z]' \
|
|
|
|
&& { echo 1>&2 '$@: found initial capitals in --help'; exit 1; } || :
|
2012-08-29 23:37:35 +08:00
|
|
|
|
|
|
|
# Ensure all man/*.[1x] files are present.
|
|
|
|
sc_man_file_correlation: check-x-vs-1 check-programs-vs-x
|
|
|
|
|
|
|
|
# Ensure that for each .x file in the 'man/' subdirectory, there is a
|
2012-09-01 07:46:50 +08:00
|
|
|
# corresponding .1 file in the definition of $(EXTRA_MANS).
|
2012-08-29 23:37:35 +08:00
|
|
|
# But since that expansion usually lacks programs like arch and hostname,
|
|
|
|
# add them here manually.
|
|
|
|
.PHONY: check-x-vs-1
|
|
|
|
check-x-vs-1:
|
|
|
|
@PATH=./src$(PATH_SEPARATOR)$$PATH; export PATH; \
|
|
|
|
t=$@-t; \
|
|
|
|
(cd $(srcdir)/man && ls -1 *.x) \
|
|
|
|
| sed 's/\.x$$//' | $(ASSORT) > $$t; \
|
build: simplify and make more portable to non-GNU make
The AC_SUBST'd variable '$(NO_INSTALL_PROGS_DEFAULT)' is only used in
makefile expressions expanding the list of manual pages that are not
built by default (but might need to be when a distribution tarball
is created). Such expressions exploited a feature of make variable
expansion -- namely, $(VAR:%=dir/%.x) -- that, while seemingly quite
portable in practice, is not POSIX-conforming, and could break on
lesser vendor make implementations. So kill two birds with one stone,
by getting rid of the $(NO_INSTALL_PROGS_DEFAULT) intermediate variable
and improving makefile portability in the process.
While at it, we also clean up some other minor naming inconsistency
and useless indirection.
* configure.ac (NO_INSTALL_PROGS_DEFAULT): Don't define or AC_SUBST
anymore; instead ...
(EXTRA_MANS): ... define and AC_SUBST these.
* man/local.mk (extra_man_1): Rename ...
(EXTRA_MANS): ... like this, explicitly making clear it's AC_SUBST'd.
(extra_man_x): It's used only once, no need to define it; just inline
its only expansion where needed.
(EXTRA_DIST): Adjust.
(ALL_MANS): New, union of $(EXTRA_MANS) and $(dist_man1_MANS).
* cfg.mk (check-x-vs-1, sc_option_desc_uppercase): Rely on $(ALL_MANS)
rather than on $(NO_INSTALL_PROGS_DEFAULT) and $(dist_man1_MANS).
2012-09-01 07:46:48 +08:00
|
|
|
(echo $(patsubst man/%,%,$(ALL_MANS)) \
|
2012-08-29 23:37:35 +08:00
|
|
|
| tr -s ' ' '\n' | sed 's/\.1$$//') \
|
|
|
|
| $(ASSORT) -u | diff - $$t || { rm $$t; exit 1; }; \
|
|
|
|
rm $$t
|
|
|
|
|
2012-08-31 00:19:53 +08:00
|
|
|
# Writing a portable rule to generate a manpage like '[.1' would be
|
2012-09-01 07:46:44 +08:00
|
|
|
# a nightmare, so filter that out.
|
|
|
|
all-progs-but-lbracket = $(filter-out [,$(patsubst src/%,%,$(all_programs)))
|
2012-08-29 23:37:35 +08:00
|
|
|
|
2012-09-01 07:46:44 +08:00
|
|
|
# Ensure that for each coreutils program there is a corresponding
|
|
|
|
# '.x' file in the 'man/' subdirectory.
|
2012-08-29 23:37:35 +08:00
|
|
|
.PHONY: check-programs-vs-x
|
2012-09-01 07:46:44 +08:00
|
|
|
check-programs-vs-x:
|
2012-08-29 23:37:35 +08:00
|
|
|
@status=0; \
|
2012-08-31 00:19:53 +08:00
|
|
|
for p in dummy $(all-progs-but-lbracket); do \
|
2012-09-01 02:05:29 +08:00
|
|
|
case $$p in *.so) continue;; esac; \
|
2012-08-29 23:37:35 +08:00
|
|
|
test $$p = dummy && continue; \
|
|
|
|
test $$p = ginstall && p=install || : ; \
|
|
|
|
test -f $(srcdir)/man/$$p.x \
|
|
|
|
|| { echo missing $$p.x 1>&2; status=1; }; \
|
|
|
|
done; \
|
|
|
|
exit $$status
|
2010-02-13 02:34:33 +08:00
|
|
|
|
2010-11-14 17:16:27 +08:00
|
|
|
# Ensure that the end of each release's section is marked by two empty lines.
|
|
|
|
sc_NEWS_two_empty_lines:
|
|
|
|
@sed -n 4,/Noteworthy/p $(srcdir)/NEWS \
|
|
|
|
| perl -n0e '/(^|\n)\n\n\* Noteworthy/ or exit 1' \
|
|
|
|
|| { echo '$(ME): use two empty lines to separate NEWS sections' \
|
2011-04-11 15:55:48 +08:00
|
|
|
1>&2; exit 1; } || :
|
2010-11-14 17:16:27 +08:00
|
|
|
|
2012-04-30 16:37:14 +08:00
|
|
|
# With split lines, don't leave an operator at end of line.
|
|
|
|
# Instead, put it on the following line, where it is more apparent.
|
|
|
|
# Don't bother checking for "*" at end of line, since it provokes
|
|
|
|
# far too many false positives, matching constructs like "TYPE *".
|
|
|
|
# Similarly, omit "=" (initializers).
|
|
|
|
binop_re_ ?= [-/+^!<>]|[-/+*^!<>=]=|&&?|\|\|?|<<=?|>>=?
|
|
|
|
sc_prohibit_operator_at_end_of_line:
|
|
|
|
@prohibit='. ($(binop_re_))$$' \
|
|
|
|
in_vc_files='\.[chly]$$' \
|
|
|
|
halt='found operator at end of line' \
|
|
|
|
$(_sc_search_regexp)
|
|
|
|
|
2009-10-22 18:12:24 +08:00
|
|
|
# Don't use "readlink" or "readlinkat" directly
|
|
|
|
sc_prohibit_readlink:
|
2010-04-03 02:30:48 +08:00
|
|
|
@prohibit='\<readlink(at)? \(' \
|
|
|
|
halt='do not use readlink(at); use via xreadlink or areadlink*' \
|
|
|
|
$(_sc_search_regexp)
|
2009-10-22 18:12:24 +08:00
|
|
|
|
2009-10-23 20:06:46 +08:00
|
|
|
# Don't use address of "stat" or "lstat" functions
|
|
|
|
sc_prohibit_stat_macro_address:
|
2010-04-03 02:30:48 +08:00
|
|
|
@prohibit='\<l?stat '':|&l?stat\>' \
|
|
|
|
halt='stat() and lstat() may be function-like macros' \
|
|
|
|
$(_sc_search_regexp)
|
2009-10-23 20:06:46 +08:00
|
|
|
|
2008-12-26 22:39:41 +08:00
|
|
|
# Ensure that date's --help output stays in sync with the info
|
|
|
|
# documentation for GNU strftime. The only exception is %N,
|
|
|
|
# which date accepts but GNU strftime does not.
|
|
|
|
extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
|
|
|
|
sc_strftime_check:
|
2009-01-29 17:44:25 +08:00
|
|
|
@if test -f $(srcdir)/src/date.c; then \
|
2008-12-26 22:39:41 +08:00
|
|
|
grep '^ %. ' $(srcdir)/src/date.c | sort \
|
|
|
|
| $(extract_char) > $@-src; \
|
|
|
|
{ echo N; \
|
2010-02-18 16:38:30 +08:00
|
|
|
info libc date calendar format 2>/dev/null|grep '^ `%.'\'\
|
2008-12-26 22:39:41 +08:00
|
|
|
| $(extract_char); } | sort > $@-info; \
|
2011-06-19 01:58:44 +08:00
|
|
|
if test $$(stat --format %s $@-info) != 2; then \
|
|
|
|
diff -u $@-src $@-info || exit 1; \
|
|
|
|
else \
|
|
|
|
echo '$(ME): skipping $@: libc info not installed' 1>&2; \
|
|
|
|
fi; \
|
2008-12-26 22:39:41 +08:00
|
|
|
rm -f $@-src $@-info; \
|
|
|
|
fi
|
2009-04-25 03:36:22 +08:00
|
|
|
|
2009-02-28 00:32:19 +08:00
|
|
|
# Indent only with spaces.
|
|
|
|
sc_prohibit_tab_based_indentation:
|
2010-04-03 02:30:48 +08:00
|
|
|
@prohibit='^ * ' \
|
|
|
|
halt='TAB in indentation; use only spaces' \
|
|
|
|
$(_sc_search_regexp)
|
2009-02-28 00:32:19 +08:00
|
|
|
|
2011-07-08 23:10:17 +08:00
|
|
|
# The SEE ALSO section of a man page should not be terminated with
|
|
|
|
# a period. Check the first line after each "SEE ALSO" line in man/*.x:
|
|
|
|
sc_prohibit_man_see_also_period:
|
|
|
|
@grep -nB1 '\.$$' $$($(VC_LIST_EXCEPT) | grep 'man/.*\.x$$') \
|
|
|
|
| grep -A1 -e '-\[SEE ALSO\]' | grep '\.$$' && \
|
|
|
|
{ echo '$(ME): do not end "SEE ALSO" section with a period' \
|
|
|
|
1>&2; exit 1; } || :
|
|
|
|
|
2009-06-14 20:21:02 +08:00
|
|
|
# Don't use "indent-tabs-mode: nil" anymore. No longer needed.
|
|
|
|
sc_prohibit_emacs__indent_tabs_mode__setting:
|
2010-04-03 02:30:48 +08:00
|
|
|
@prohibit='^( *[*#] *)?indent-tabs-mode:' \
|
|
|
|
halt='use of emacs indent-tabs-mode: setting' \
|
|
|
|
$(_sc_search_regexp)
|
2009-06-14 20:21:02 +08:00
|
|
|
|
2012-07-03 02:40:01 +08:00
|
|
|
# Ensure that tests don't include a redundant fail=0.
|
2009-10-30 18:09:50 +08:00
|
|
|
sc_prohibit_fail_0:
|
2010-04-03 02:30:48 +08:00
|
|
|
@prohibit='\<fail=0\>' \
|
|
|
|
halt='fail=0 initialization' \
|
|
|
|
$(_sc_search_regexp)
|
2009-10-29 21:40:40 +08:00
|
|
|
|
2012-01-05 18:31:29 +08:00
|
|
|
# The mode part of a setfacl -m option argument must be three bytes long.
|
|
|
|
# I.e., an argument of user:bin:rw or user:bin:r will make Solaris 10's
|
|
|
|
# setfacl reject it with: "Unrecognized character found in mode field".
|
|
|
|
# Use hyphens to give it a length of 3: "...:rw-" or "...:r--".
|
|
|
|
sc_prohibit_short_facl_mode_spec:
|
|
|
|
@prohibit='\<setfacl .*-m.*:.*:[rwx-]{1,2} ' \
|
|
|
|
halt='setfacl mode string length < 3; extend with hyphen(s)' \
|
|
|
|
$(_sc_search_regexp)
|
|
|
|
|
build: consistently use freopen-safer
cat, head, ptx, shuf, tac, tail, tee, tr, and uniq used freopen
on stdout, and were potentially vulnerable. dircolors, du, and
tsort only used it on stdin, which is unaffected by freopen_safer,
but this covers all uses for consistency.
* cfg.mk (sc_require_stdio_safer): New rule.
* gl/modules/xfreopen (Depends-on): Add freopen-safer.
* gl/lib/xfreopen.c (includes): Use stdio--.h.
* src/ptx.c (includes): Likewise.
* src/shuf.c (includes): Likewise.
* src/uniq.c (includes): Likewise.
* src/dircolors.c (includes): Likewise.
* src/du.c (includes): Likewise.
* src/tsort.c (includes): Likewise.
2009-11-06 07:48:09 +08:00
|
|
|
# Ensure that "stdio--.h" is used where appropriate.
|
|
|
|
sc_require_stdio_safer:
|
|
|
|
@if $(VC_LIST_EXCEPT) | grep -l '\.[ch]$$' > /dev/null; then \
|
|
|
|
files=$$(grep -l '\bfreopen \?(' $$($(VC_LIST_EXCEPT) \
|
|
|
|
| grep '\.[ch]$$')); \
|
|
|
|
test -n "$$files" && grep -LE 'include "stdio--.h"' $$files \
|
|
|
|
| grep . && \
|
|
|
|
{ echo '$(ME): the above files should use "stdio--.h"' \
|
|
|
|
1>&2; exit 1; } || :; \
|
|
|
|
else :; \
|
|
|
|
fi
|
|
|
|
|
2010-05-15 23:58:52 +08:00
|
|
|
sc_prohibit_perl_hash_quotes:
|
|
|
|
@prohibit="\{'[A-Z_]+' *[=}]" \
|
|
|
|
halt="in Perl code, write \$$hash{KEY}, not \$$hash{'K''EY'}" \
|
|
|
|
$(_sc_search_regexp)
|
|
|
|
|
2009-11-24 05:59:18 +08:00
|
|
|
# Prefer xnanosleep over other less-precise sleep methods
|
|
|
|
sc_prohibit_sleep:
|
2010-04-03 02:30:48 +08:00
|
|
|
@prohibit='\<(nano|u)?sleep \(' \
|
|
|
|
halt='prefer xnanosleep over other sleep interfaces' \
|
|
|
|
$(_sc_search_regexp)
|
2009-11-24 05:59:18 +08:00
|
|
|
|
2010-11-18 13:29:54 +08:00
|
|
|
# Use print_ver_ (from init.cfg), not open-coded $VERBOSE check.
|
|
|
|
sc_prohibit_verbose_version:
|
|
|
|
@prohibit='test "\$$VERBOSE" = yes && .* --version' \
|
|
|
|
halt='use the print_ver_ function instead...' \
|
|
|
|
$(_sc_search_regexp)
|
|
|
|
|
2011-08-08 14:54:52 +08:00
|
|
|
# Use framework_failure_, not the old name without the trailing underscore.
|
|
|
|
sc_prohibit_framework_failure:
|
|
|
|
@prohibit='\<framework_''failure\>' \
|
|
|
|
halt='use framework_failure_ instead' \
|
|
|
|
$(_sc_search_regexp)
|
|
|
|
|
2012-04-04 18:34:22 +08:00
|
|
|
# Prohibit the use of `...` in tests/. Use $(...) instead.
|
|
|
|
sc_prohibit_test_backticks:
|
|
|
|
@prohibit='`' in_vc_files='^tests/' \
|
|
|
|
halt='use $$(...), not `...` in tests/' \
|
|
|
|
$(_sc_search_regexp)
|
|
|
|
|
2012-07-04 02:14:56 +08:00
|
|
|
# Programs like sort, ls, expr use PROG_FAILURE in place of EXIT_FAILURE.
|
|
|
|
# Others, use the EXIT_CANCELED, EXIT_ENOENT, etc. macros defined in system.h.
|
|
|
|
# In those programs, ensure that EXIT_FAILURE is not used by mistake.
|
|
|
|
sc_some_programs_must_avoid_exit_failure:
|
|
|
|
@grep -nw EXIT_FAILURE \
|
|
|
|
$$(git grep -El '[^T]_FAILURE|EXIT_CANCELED' src) \
|
|
|
|
| grep -vE '= EXIT_FAILURE|exit \(.* \?' | grep . \
|
|
|
|
&& { echo '$(ME): do not use EXIT_FAILURE in the above' \
|
|
|
|
1>&2; exit 1; } || :
|
|
|
|
|
2012-08-22 21:04:04 +08:00
|
|
|
# Ensure that tests call the print_ver_ function for programs which are
|
|
|
|
# actually used in that test.
|
|
|
|
sc_prohibit_test_calls_print_ver_with_irrelevant_argument:
|
|
|
|
@git grep -w print_ver_ tests \
|
|
|
|
| sed 's#:print_ver_##' \
|
|
|
|
| { fail=0; \
|
|
|
|
while read file name; do \
|
|
|
|
for i in $$name; do \
|
|
|
|
case "$$i" in install) i=ginstall;; esac; \
|
|
|
|
grep -w "$$i" $$file|grep -vw print_ver_|grep -q . \
|
|
|
|
|| { fail=1; \
|
|
|
|
echo "*** Test: $$file, offending: $$i." 1>&2; };\
|
|
|
|
done; \
|
|
|
|
done; \
|
|
|
|
test $$fail = 0 || exit 1; \
|
|
|
|
} || { echo "$(ME): the above test(s) call print_ver_ for" \
|
|
|
|
"program(s) they don't use" 1>&2; exit 1; }
|
|
|
|
|
2012-01-10 05:56:54 +08:00
|
|
|
# Exempt the contents of any usage function from the following.
|
|
|
|
_continued_string_col_1 = \
|
|
|
|
s/^usage .*?\n}//ms;/\\\n\w/ and print ("$$ARGV\n"),$$e=1;END{$$e||=0;exit $$e}
|
|
|
|
# Ding any source file that has a continued string with an alphabetic in the
|
|
|
|
# first column of the following line. We prohibit them because they usually
|
|
|
|
# trigger false positives in tools that try to map an arbitrary line number
|
|
|
|
# to the enclosing function name. Of course, very many strings do precisely
|
|
|
|
# this, *when they are part of the usage function*. That is why we exempt
|
|
|
|
# the contents of any function named "usage".
|
|
|
|
sc_prohibit_continued_string_alpha_in_column_1:
|
|
|
|
@perl -0777 -ne '$(_continued_string_col_1)' \
|
|
|
|
$$($(VC_LIST_EXCEPT) | grep '\.[ch]$$') \
|
|
|
|
|| { echo '$(ME): continued string with word in first column' \
|
|
|
|
1>&2; exit 1; } || :
|
|
|
|
# Use this to list offending lines:
|
|
|
|
# git ls-files |grep '\.[ch]$' | xargs \
|
|
|
|
# perl -n -0777 -e 's/^usage.*?\n}//ms;/\\\n\w/ and print "$ARGV\n"' \
|
|
|
|
# | xargs grep -A1 '\\$'|grep '\.[ch][:-][_a-zA-Z]'
|
|
|
|
|
|
|
|
|
2010-03-21 04:05:24 +08:00
|
|
|
###########################################################
|
|
|
|
_p0 = \([^"'/]\|"\([^\"]\|[\].\)*"\|'\([^\']\|[\].\)*'
|
|
|
|
_pre = $(_p0)\|[/][^"'/*]\|[/]"\([^\"]\|[\].\)*"\|[/]'\([^\']\|[\].\)*'\)*
|
|
|
|
_pre_anchored = ^\($(_pre)\)
|
|
|
|
_comment_and_close = [^*]\|[*][^/*]\)*[*][*]*/
|
|
|
|
# help font-lock mode: '
|
|
|
|
|
|
|
|
# A sed expression that removes ANSI C and ISO C99 comments.
|
|
|
|
# Derived from the one in GNU gettext's 'moopp' preprocessor.
|
|
|
|
_sed_remove_comments = \
|
|
|
|
/[/][/*]/{ \
|
|
|
|
ta; \
|
|
|
|
:a; \
|
|
|
|
s,$(_pre_anchored)//.*,\1,; \
|
|
|
|
te; \
|
|
|
|
s,$(_pre_anchored)/[*]\($(_comment_and_close),\1 ,; \
|
|
|
|
ta; \
|
|
|
|
/^$(_pre)[/][*]/{ \
|
|
|
|
s,$(_pre_anchored)/[*].*,\1 ,; \
|
|
|
|
tu; \
|
|
|
|
:u; \
|
|
|
|
n; \
|
|
|
|
s,^\($(_comment_and_close),,; \
|
|
|
|
tv; \
|
|
|
|
s,^.*$$,,; \
|
|
|
|
bu; \
|
|
|
|
:v; \
|
|
|
|
}; \
|
|
|
|
:e; \
|
|
|
|
}
|
|
|
|
# Quote all single quotes.
|
|
|
|
_sed_rm_comments_q = $(subst ','\'',$(_sed_remove_comments))
|
|
|
|
# help font-lock mode: '
|
|
|
|
|
2010-03-20 19:14:46 +08:00
|
|
|
_space_before_paren_exempt =? \\n\\$$
|
|
|
|
_space_before_paren_exempt = \
|
2010-03-21 04:05:24 +08:00
|
|
|
(^ *\#|\\n\\$$|%s\(to %s|(date|group|character)\(s\))
|
2010-03-20 19:14:46 +08:00
|
|
|
# Ensure that there is a space before each open parenthesis in C code.
|
|
|
|
sc_space_before_open_paren:
|
|
|
|
@if $(VC_LIST_EXCEPT) | grep -l '\.[ch]$$' > /dev/null; then \
|
2010-03-21 04:05:24 +08:00
|
|
|
fail=0; \
|
|
|
|
for c in $$($(VC_LIST_EXCEPT) | grep '\.[ch]$$'); do \
|
|
|
|
sed '$(_sed_rm_comments_q)' $$c 2>/dev/null \
|
|
|
|
| grep -i '[[:alnum:]](' \
|
|
|
|
| grep -vE '$(_space_before_paren_exempt)' \
|
|
|
|
| grep . && { fail=1; echo "*** $$c"; }; \
|
|
|
|
done; \
|
|
|
|
test $$fail = 1 && \
|
|
|
|
{ echo '$(ME): the above files lack a space-before-open-paren' \
|
|
|
|
1>&2; exit 1; } || :; \
|
2010-03-20 19:14:46 +08:00
|
|
|
else :; \
|
|
|
|
fi
|
|
|
|
|
2011-03-31 23:59:16 +08:00
|
|
|
# Similar to the gnulib maint.mk rule for sc_prohibit_strcmp
|
|
|
|
# Use STREQ_LEN or STRPREFIX rather than comparing strncmp == 0, or != 0.
|
|
|
|
sc_prohibit_strncmp:
|
|
|
|
@grep -nE '! *str''ncmp *\(|\<str''ncmp *\(.+\) *[!=]=' \
|
|
|
|
$$($(VC_LIST_EXCEPT)) \
|
|
|
|
| grep -vE ':# *define STR(N?EQ_LEN|PREFIX)\(' && \
|
|
|
|
{ echo '$(ME): use STREQ_LEN or STRPREFIX instead of str''ncmp' \
|
|
|
|
1>&2; exit 1; } || :
|
|
|
|
|
2011-05-25 18:31:15 +08:00
|
|
|
# Enforce recommended preprocessor indentation style.
|
|
|
|
sc_preprocessor_indentation:
|
|
|
|
@if cppi --version >/dev/null 2>&1; then \
|
|
|
|
$(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c \
|
|
|
|
|| { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
|
|
|
|
exit 1; }; \
|
|
|
|
else \
|
|
|
|
echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
|
|
|
|
fi
|
|
|
|
|
2012-06-06 18:46:27 +08:00
|
|
|
# THANKS.in is a list of name/email pairs for people who are mentioned in
|
|
|
|
# commit logs (and generated ChangeLog), but who are not also listed as an
|
|
|
|
# author of a commit. Name/email pairs of commit authors are automatically
|
|
|
|
# extracted from the repository. As a very minor factorization, when
|
|
|
|
# someone who was initially listed only in THANKS.in later authors a commit,
|
|
|
|
# this rule detects that their pair may now be removed from THANKS.in.
|
|
|
|
sc_THANKS_in_duplicates:
|
2012-06-22 17:56:25 +08:00
|
|
|
@{ git log --pretty=format:%aN | sort -u; \
|
2012-06-06 18:46:27 +08:00
|
|
|
cut -b-36 THANKS.in | sed '/^$$/d;s/ *$$//'; } \
|
|
|
|
| sort | uniq -d | grep . \
|
|
|
|
&& { echo '$(ME): remove the above names from THANKS.in' \
|
|
|
|
1>&2; exit 1; } || :
|
|
|
|
|
2010-05-04 04:00:30 +08:00
|
|
|
# Override the default Cc: used in generating an announcement.
|
|
|
|
announcement_Cc_ = $(translation_project_), \
|
|
|
|
coreutils@gnu.org, coreutils-announce@gnu.org
|
|
|
|
|
2011-05-25 02:40:16 +08:00
|
|
|
-include $(srcdir)/dist-check.mk
|
2010-01-04 01:56:22 +08:00
|
|
|
|
|
|
|
update-copyright-env = \
|
2012-01-27 18:33:11 +08:00
|
|
|
UPDATE_COPYRIGHT_FORCE=1 \
|
|
|
|
UPDATE_COPYRIGHT_USE_INTERVALS=2 \
|
2010-01-04 01:56:22 +08:00
|
|
|
UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79
|
2011-03-14 21:26:38 +08:00
|
|
|
|
|
|
|
# List syntax-check exemptions.
|
|
|
|
exclude_file_name_regexp--sc_space_tab = \
|
2012-08-31 16:07:54 +08:00
|
|
|
^(tests/pr/|tests/misc/nl\.sh$$|gl/.*\.diff$$)
|
factor: merge with preexisting factor; integrate tests; avoid warnings
* src/factor.c: Renamed from factor-ng.c, with the following changes:
Adjust copyright header to be consistent with others.
Use xmalloc and xrealloc, to avoid segv upon OOM.
Switch back to using readtokens to handle input.
Diagnose invalid inputs.
s/fprintf+exit/error/
(print_factors): Add comments.
(strto2uintmax): Return strtol_error, not int.
(read_item): Remove, no longer used.
(main): Use atexit(close_stdout) so that we don't ignore failed write.
* cfg.mk: Exempt src/longlong.h from several tests.
Exempt run.sh from the test-list-consistency test.
Exempt make-prime-list.c from numerous tests, since we won't
be making it conform: it must not link with libcoreutils.a.
Exempt factor-ng.c from the no-upper-case error message test.
* AUTHORS (factor): Add Torbjörn and Niels.
* tests/local.mk (factor_tests): Encode the 37 tests.
($(factor_tests)): Rule to generate a test script for each test.
* tests/factor/run.sh: New script, marked as very expensive.
* .gitignore: Ignore new generated files.
* src/local.mk (src/primes.h): New rule.
(noinst_PROGRAMS): Add make-prime-list.
(noinst_HEADERS): Add longlong.h.
Remove all wheel-related rules and files.
* src/wheel-gen.pl: Remove file.
maint: mark set-but-not-used variables with ATTRIBUTE_UNUSED
* src/factor-ng.c (redcify, prime_p, isqrt2): Mark them, so we
don't have to disable -Wunused-but-set-variable.
maint: use __builtin_expect only if __GNUC__
* src/factor-ng.c (LIKELY, UNLIKELY) [__GNUC__]: Add #ifdef guard.
build: avoid warning about unused macro
* src/factor-ng.c (__GMP_DECLSPEC): Don't define here
* src/longlong.h (__GMP_DECLSPEC): Define if not already defined.
2012-09-17 04:31:04 +08:00
|
|
|
exclude_file_name_regexp--sc_bindtextdomain = \
|
|
|
|
^(gl/.*|lib/euidaccess-stat|src/make-prime-list)\.c$$
|
2011-03-14 21:26:38 +08:00
|
|
|
exclude_file_name_regexp--sc_trailing_blank = ^tests/pr/
|
|
|
|
exclude_file_name_regexp--sc_system_h_headers = \
|
factor: merge with preexisting factor; integrate tests; avoid warnings
* src/factor.c: Renamed from factor-ng.c, with the following changes:
Adjust copyright header to be consistent with others.
Use xmalloc and xrealloc, to avoid segv upon OOM.
Switch back to using readtokens to handle input.
Diagnose invalid inputs.
s/fprintf+exit/error/
(print_factors): Add comments.
(strto2uintmax): Return strtol_error, not int.
(read_item): Remove, no longer used.
(main): Use atexit(close_stdout) so that we don't ignore failed write.
* cfg.mk: Exempt src/longlong.h from several tests.
Exempt run.sh from the test-list-consistency test.
Exempt make-prime-list.c from numerous tests, since we won't
be making it conform: it must not link with libcoreutils.a.
Exempt factor-ng.c from the no-upper-case error message test.
* AUTHORS (factor): Add Torbjörn and Niels.
* tests/local.mk (factor_tests): Encode the 37 tests.
($(factor_tests)): Rule to generate a test script for each test.
* tests/factor/run.sh: New script, marked as very expensive.
* .gitignore: Ignore new generated files.
* src/local.mk (src/primes.h): New rule.
(noinst_PROGRAMS): Add make-prime-list.
(noinst_HEADERS): Add longlong.h.
Remove all wheel-related rules and files.
* src/wheel-gen.pl: Remove file.
maint: mark set-but-not-used variables with ATTRIBUTE_UNUSED
* src/factor-ng.c (redcify, prime_p, isqrt2): Mark them, so we
don't have to disable -Wunused-but-set-variable.
maint: use __builtin_expect only if __GNUC__
* src/factor-ng.c (LIKELY, UNLIKELY) [__GNUC__]: Add #ifdef guard.
build: avoid warning about unused macro
* src/factor-ng.c (__GMP_DECLSPEC): Don't define here
* src/longlong.h (__GMP_DECLSPEC): Define if not already defined.
2012-09-17 04:31:04 +08:00
|
|
|
^src/((system|copy)\.h|libstdbuf\.c|make-prime-list\.c)$$
|
2011-03-14 21:26:38 +08:00
|
|
|
|
|
|
|
_src = (false|lbracket|ls-(dir|ls|vdir)|tac-pipe|uname-(arch|uname))
|
|
|
|
exclude_file_name_regexp--sc_require_config_h_first = \
|
|
|
|
(^lib/buffer-lcm\.c|src/$(_src)\.c)$$
|
|
|
|
exclude_file_name_regexp--sc_require_config_h = \
|
|
|
|
$(exclude_file_name_regexp--sc_require_config_h_first)
|
|
|
|
|
|
|
|
exclude_file_name_regexp--sc_po_check = ^gl/
|
2011-09-20 02:13:36 +08:00
|
|
|
exclude_file_name_regexp--sc_prohibit_always-defined_macros = \
|
|
|
|
^src/(seq|remove)\.c$$
|
2011-03-14 21:26:38 +08:00
|
|
|
exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^tests/pr/
|
factor: merge with preexisting factor; integrate tests; avoid warnings
* src/factor.c: Renamed from factor-ng.c, with the following changes:
Adjust copyright header to be consistent with others.
Use xmalloc and xrealloc, to avoid segv upon OOM.
Switch back to using readtokens to handle input.
Diagnose invalid inputs.
s/fprintf+exit/error/
(print_factors): Add comments.
(strto2uintmax): Return strtol_error, not int.
(read_item): Remove, no longer used.
(main): Use atexit(close_stdout) so that we don't ignore failed write.
* cfg.mk: Exempt src/longlong.h from several tests.
Exempt run.sh from the test-list-consistency test.
Exempt make-prime-list.c from numerous tests, since we won't
be making it conform: it must not link with libcoreutils.a.
Exempt factor-ng.c from the no-upper-case error message test.
* AUTHORS (factor): Add Torbjörn and Niels.
* tests/local.mk (factor_tests): Encode the 37 tests.
($(factor_tests)): Rule to generate a test script for each test.
* tests/factor/run.sh: New script, marked as very expensive.
* .gitignore: Ignore new generated files.
* src/local.mk (src/primes.h): New rule.
(noinst_PROGRAMS): Add make-prime-list.
(noinst_HEADERS): Add longlong.h.
Remove all wheel-related rules and files.
* src/wheel-gen.pl: Remove file.
maint: mark set-but-not-used variables with ATTRIBUTE_UNUSED
* src/factor-ng.c (redcify, prime_p, isqrt2): Mark them, so we
don't have to disable -Wunused-but-set-variable.
maint: use __builtin_expect only if __GNUC__
* src/factor-ng.c (LIKELY, UNLIKELY) [__GNUC__]: Add #ifdef guard.
build: avoid warning about unused macro
* src/factor-ng.c (__GMP_DECLSPEC): Don't define here
* src/longlong.h (__GMP_DECLSPEC): Define if not already defined.
2012-09-17 04:31:04 +08:00
|
|
|
exclude_file_name_regexp--sc_program_name = \
|
|
|
|
^(gl/.*|lib/euidaccess-stat|src/make-prime-list)\.c$$
|
2011-03-28 15:39:53 +08:00
|
|
|
exclude_file_name_regexp--sc_file_system = \
|
2012-09-24 04:29:25 +08:00
|
|
|
NEWS|^(init\.cfg|src/df\.c|tests/df/df-P\.sh|tests/df/df-output\.sh)$$
|
2011-03-14 21:26:38 +08:00
|
|
|
exclude_file_name_regexp--sc_prohibit_always_true_header_tests = \
|
|
|
|
^m4/stat-prog\.m4$$
|
|
|
|
exclude_file_name_regexp--sc_prohibit_fail_0 = \
|
2012-07-01 00:29:38 +08:00
|
|
|
(^.*/git-hooks/commit-msg|^tests/init\.sh|Makefile\.am|\.mk|.*\.texi)$$
|
2011-03-14 21:26:38 +08:00
|
|
|
exclude_file_name_regexp--sc_prohibit_atoi_atof = ^lib/euidaccess-stat\.c$$
|
2011-10-20 23:26:01 +08:00
|
|
|
|
factor: merge with preexisting factor; integrate tests; avoid warnings
* src/factor.c: Renamed from factor-ng.c, with the following changes:
Adjust copyright header to be consistent with others.
Use xmalloc and xrealloc, to avoid segv upon OOM.
Switch back to using readtokens to handle input.
Diagnose invalid inputs.
s/fprintf+exit/error/
(print_factors): Add comments.
(strto2uintmax): Return strtol_error, not int.
(read_item): Remove, no longer used.
(main): Use atexit(close_stdout) so that we don't ignore failed write.
* cfg.mk: Exempt src/longlong.h from several tests.
Exempt run.sh from the test-list-consistency test.
Exempt make-prime-list.c from numerous tests, since we won't
be making it conform: it must not link with libcoreutils.a.
Exempt factor-ng.c from the no-upper-case error message test.
* AUTHORS (factor): Add Torbjörn and Niels.
* tests/local.mk (factor_tests): Encode the 37 tests.
($(factor_tests)): Rule to generate a test script for each test.
* tests/factor/run.sh: New script, marked as very expensive.
* .gitignore: Ignore new generated files.
* src/local.mk (src/primes.h): New rule.
(noinst_PROGRAMS): Add make-prime-list.
(noinst_HEADERS): Add longlong.h.
Remove all wheel-related rules and files.
* src/wheel-gen.pl: Remove file.
maint: mark set-but-not-used variables with ATTRIBUTE_UNUSED
* src/factor-ng.c (redcify, prime_p, isqrt2): Mark them, so we
don't have to disable -Wunused-but-set-variable.
maint: use __builtin_expect only if __GNUC__
* src/factor-ng.c (LIKELY, UNLIKELY) [__GNUC__]: Add #ifdef guard.
build: avoid warning about unused macro
* src/factor-ng.c (__GMP_DECLSPEC): Don't define here
* src/longlong.h (__GMP_DECLSPEC): Define if not already defined.
2012-09-17 04:31:04 +08:00
|
|
|
# longlong.h is maintained elsewhere.
|
|
|
|
_ll = ^src/longlong\.h$$
|
|
|
|
exclude_file_name_regexp--sc_useless_cpp_parens = $(_ll)
|
|
|
|
exclude_file_name_regexp--sc_long_lines = $(_ll)
|
|
|
|
exclude_file_name_regexp--sc_space_before_open_paren = $(_ll)
|
|
|
|
|
2012-09-14 15:25:33 +08:00
|
|
|
tbi_1 = ^tests/pr/|(^gl/lib/reg.*\.c\.diff|\.mk|^man/help2man)$$
|
2011-11-13 17:39:32 +08:00
|
|
|
tbi_2 = ^scripts/git-hooks/(pre-commit|pre-applypatch|applypatch-msg)$$
|
factor: merge with preexisting factor; integrate tests; avoid warnings
* src/factor.c: Renamed from factor-ng.c, with the following changes:
Adjust copyright header to be consistent with others.
Use xmalloc and xrealloc, to avoid segv upon OOM.
Switch back to using readtokens to handle input.
Diagnose invalid inputs.
s/fprintf+exit/error/
(print_factors): Add comments.
(strto2uintmax): Return strtol_error, not int.
(read_item): Remove, no longer used.
(main): Use atexit(close_stdout) so that we don't ignore failed write.
* cfg.mk: Exempt src/longlong.h from several tests.
Exempt run.sh from the test-list-consistency test.
Exempt make-prime-list.c from numerous tests, since we won't
be making it conform: it must not link with libcoreutils.a.
Exempt factor-ng.c from the no-upper-case error message test.
* AUTHORS (factor): Add Torbjörn and Niels.
* tests/local.mk (factor_tests): Encode the 37 tests.
($(factor_tests)): Rule to generate a test script for each test.
* tests/factor/run.sh: New script, marked as very expensive.
* .gitignore: Ignore new generated files.
* src/local.mk (src/primes.h): New rule.
(noinst_PROGRAMS): Add make-prime-list.
(noinst_HEADERS): Add longlong.h.
Remove all wheel-related rules and files.
* src/wheel-gen.pl: Remove file.
maint: mark set-but-not-used variables with ATTRIBUTE_UNUSED
* src/factor-ng.c (redcify, prime_p, isqrt2): Mark them, so we
don't have to disable -Wunused-but-set-variable.
maint: use __builtin_expect only if __GNUC__
* src/factor-ng.c (LIKELY, UNLIKELY) [__GNUC__]: Add #ifdef guard.
build: avoid warning about unused macro
* src/factor-ng.c (__GMP_DECLSPEC): Don't define here
* src/longlong.h (__GMP_DECLSPEC): Define if not already defined.
2012-09-17 04:31:04 +08:00
|
|
|
tbi_3 = (GNU)?[Mm]akefile(\.am)?$$|$(_ll)
|
2011-03-14 21:26:38 +08:00
|
|
|
exclude_file_name_regexp--sc_prohibit_tab_based_indentation = \
|
2012-09-14 15:25:33 +08:00
|
|
|
$(tbi_1)|$(tbi_2)|$(tbi_3)
|
2011-10-20 23:26:01 +08:00
|
|
|
|
2011-05-25 18:31:15 +08:00
|
|
|
exclude_file_name_regexp--sc_preprocessor_indentation = \
|
2012-11-19 01:51:48 +08:00
|
|
|
^(gl/lib/rand-isaac\.[ch]|gl/tests/test-rand-isaac\.c)$$|$(_ll)
|
2011-03-14 21:26:38 +08:00
|
|
|
exclude_file_name_regexp--sc_prohibit_stat_st_blocks = \
|
2012-08-31 16:07:54 +08:00
|
|
|
^(src/system\.h|tests/du/2g\.sh)$$
|
2012-01-10 05:56:54 +08:00
|
|
|
|
|
|
|
exclude_file_name_regexp--sc_prohibit_continued_string_alpha_in_column_1 = \
|
|
|
|
^src/(system\.h|od\.c|printf\.c)$$
|
2012-04-04 18:34:22 +08:00
|
|
|
|
|
|
|
exclude_file_name_regexp--sc_prohibit_test_backticks = \
|
2012-10-27 19:24:18 +08:00
|
|
|
^tests/(local\.mk|(init|misc/stdbuf|factor/create-test)\.sh)$$
|
2012-04-30 16:37:14 +08:00
|
|
|
|
|
|
|
# Exempt test.c, since it's nominally shared, and relatively static.
|
|
|
|
exclude_file_name_regexp--sc_prohibit_operator_at_end_of_line = \
|
|
|
|
^src/(ptx|test|head)\.c$$
|
2012-09-09 03:17:32 +08:00
|
|
|
|
factor: merge with preexisting factor; integrate tests; avoid warnings
* src/factor.c: Renamed from factor-ng.c, with the following changes:
Adjust copyright header to be consistent with others.
Use xmalloc and xrealloc, to avoid segv upon OOM.
Switch back to using readtokens to handle input.
Diagnose invalid inputs.
s/fprintf+exit/error/
(print_factors): Add comments.
(strto2uintmax): Return strtol_error, not int.
(read_item): Remove, no longer used.
(main): Use atexit(close_stdout) so that we don't ignore failed write.
* cfg.mk: Exempt src/longlong.h from several tests.
Exempt run.sh from the test-list-consistency test.
Exempt make-prime-list.c from numerous tests, since we won't
be making it conform: it must not link with libcoreutils.a.
Exempt factor-ng.c from the no-upper-case error message test.
* AUTHORS (factor): Add Torbjörn and Niels.
* tests/local.mk (factor_tests): Encode the 37 tests.
($(factor_tests)): Rule to generate a test script for each test.
* tests/factor/run.sh: New script, marked as very expensive.
* .gitignore: Ignore new generated files.
* src/local.mk (src/primes.h): New rule.
(noinst_PROGRAMS): Add make-prime-list.
(noinst_HEADERS): Add longlong.h.
Remove all wheel-related rules and files.
* src/wheel-gen.pl: Remove file.
maint: mark set-but-not-used variables with ATTRIBUTE_UNUSED
* src/factor-ng.c (redcify, prime_p, isqrt2): Mark them, so we
don't have to disable -Wunused-but-set-variable.
maint: use __builtin_expect only if __GNUC__
* src/factor-ng.c (LIKELY, UNLIKELY) [__GNUC__]: Add #ifdef guard.
build: avoid warning about unused macro
* src/factor-ng.c (__GMP_DECLSPEC): Don't define here
* src/longlong.h (__GMP_DECLSPEC): Define if not already defined.
2012-09-17 04:31:04 +08:00
|
|
|
exclude_file_name_regexp--sc_error_message_uppercase = ^src/factor\.c$$
|
|
|
|
exclude_file_name_regexp--sc_prohibit_atoi_atof = ^src/make-prime-list\.c$$
|
|
|
|
|
2012-09-09 03:17:32 +08:00
|
|
|
# Augment AM_CFLAGS to include our per-directory options:
|
|
|
|
AM_CFLAGS += $($(@D)_CFLAGS)
|
|
|
|
|
|
|
|
src_CFLAGS = $(WARN_CFLAGS)
|
|
|
|
lib_CFLAGS = $(GNULIB_WARN_CFLAGS)
|
|
|
|
gnulib-tests_CFLAGS = $(GNULIB_TEST_WARN_CFLAGS)
|
2012-09-18 22:29:49 +08:00
|
|
|
|
|
|
|
# Configuration to make the tight-scope syntax-check rule work with
|
2012-09-19 13:52:25 +08:00
|
|
|
# non-recursive make.
|
2012-09-18 22:29:49 +08:00
|
|
|
export _gl_TS_headers = $(srcdir)/cfg.mk
|
|
|
|
_gl_TS_dir = .
|
|
|
|
_gl_TS_obj_files = src/*.$(OBJEXT)
|
|
|
|
_gl_TS_other_headers = src/*.h
|
2012-11-19 01:16:17 +08:00
|
|
|
|
|
|
|
# Tell the tight_scope rule about an exceptional "extern" variable.
|
|
|
|
# Normally, the rule would detect its declaration, but that uses a
|
|
|
|
# different name, __clz_tab.
|
|
|
|
_gl_TS_unmarked_extern_vars = factor_clz_tab
|