2006-08-17 19:58:17 +00:00
|
|
|
# Make coreutils documentation. -*-Makefile-*-
|
2012-08-29 14:22:47 +02:00
|
|
|
# This is included by the top-level Makefile.am.
|
2006-08-17 19:58:17 +00:00
|
|
|
|
2026-01-01 10:56:16 -08:00
|
|
|
# Copyright (C) 1995-2026 Free Software Foundation, Inc.
|
2006-08-17 19:58:17 +00:00
|
|
|
|
2007-07-23 14:35:58 +02:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
2006-08-17 19:58:17 +00:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
2007-07-23 14:35:58 +02:00
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
2006-08-17 19:58:17 +00:00
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
# 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
|
2017-09-19 01:13:23 -07:00
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2006-08-17 19:58:17 +00:00
|
|
|
|
2012-08-29 14:22:47 +02:00
|
|
|
info_TEXINFOS = doc/coreutils.texi
|
1996-06-16 18:47:30 +00:00
|
|
|
|
2012-08-29 14:22:47 +02:00
|
|
|
doc_coreutils_TEXINFOS = \
|
|
|
|
|
doc/perm.texi \
|
|
|
|
|
doc/parse-datetime.texi \
|
|
|
|
|
doc/constants.texi \
|
2019-07-09 19:36:10 -06:00
|
|
|
doc/fdl.texi \
|
|
|
|
|
doc/sort-version.texi
|
1996-11-02 14:47:46 +00:00
|
|
|
|
2026-02-04 21:12:28 +00:00
|
|
|
MAKEINFO = SHELL='$(SHELL)' $(abs_top_builddir)/build-aux/makeinfo-wrapper.sh
|
2026-01-17 21:23:15 -08:00
|
|
|
|
2023-06-22 23:59:11 +02:00
|
|
|
# The customization variable CHECK_NORMAL_MENU_STRUCTURE is necessary with
|
|
|
|
|
# makeinfo versions ≥ 6.8.
|
2026-01-17 21:23:15 -08:00
|
|
|
AM_MAKEINFOFLAGS = -c CHECK_NORMAL_MENU_STRUCTURE=1
|
2023-06-22 23:59:11 +02:00
|
|
|
|
1998-11-21 17:43:41 +00:00
|
|
|
# The following is necessary if the package name is 8 characters or longer.
|
|
|
|
|
# If the info documentation would be split into 10 or more separate files,
|
|
|
|
|
# then this is necessary even if the package name is 7 characters long.
|
|
|
|
|
#
|
|
|
|
|
# Tell makeinfo to put everything in a single info file: <package>.info.
|
|
|
|
|
# Otherwise, it would also generate files with names like <package>.info-[123],
|
|
|
|
|
# and those names all map to one 14-byte name (<package>.info-) on some crufty
|
1996-11-02 14:47:46 +00:00
|
|
|
# old systems.
|
2026-01-17 21:23:15 -08:00
|
|
|
AM_MAKEINFOFLAGS += --no-split
|
2001-05-20 08:21:05 +00:00
|
|
|
|
2012-08-29 14:22:47 +02:00
|
|
|
doc/constants.texi: $(top_srcdir)/src/tail.c $(top_srcdir)/src/shred.c
|
2009-12-29 14:31:56 +01:00
|
|
|
$(AM_V_GEN)LC_ALL=C; export LC_ALL; \
|
2012-12-18 09:50:50 +00:00
|
|
|
$(MKDIR_P) doc && \
|
tail: prefer intmax_t to uintmax_t
Signed types let us debug better, by using -fsanitize=undefined.
* doc/local.mk (doc/constants.texi):
Adjust change from macro to enum.
* src/tail.c (COPY_TO_EOF, COPY_A_BUFFER)
(DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS):
Now enum constants, not macros.
(COPY_TO_EOF, COPY_A_BUFFER): Now negative, not positive.
(count_t): New typedef. Use it instead of uintmax_t.
(COUNT_MAX): New macro; use it instead of UINTMAX_MAX.
(struct File_spec, max_n_unchanged_stats_between_opens)
(dump_remainder, file_lines, pipe_lines, pipe_bytes)
(start_bytes, start_lines, tail_forever, check_fspec)
(tail_forever_inotify, tail_bytes, tail_lines, tail, tail_file)
(parse_obsolete_option, parse_options, main):
Prefer count_t to uintmax_t.
2025-07-30 08:46:04 -07:00
|
|
|
{ sed -n -e \
|
|
|
|
|
's/.*\(DEFAULT_MAX[_A-Z]*\)[ =]* \([0-9]*\).*/@set \1 \2/p' \
|
2009-12-29 14:31:56 +01:00
|
|
|
$(top_srcdir)/src/tail.c && \
|
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-28 12:28:48 -08:00
|
|
|
sed -n -e \
|
|
|
|
|
's/.*\(DEFAULT_PASSES\)[ =]* \([0-9]*\).*/@set SHRED_\1 \2/p'\
|
2012-08-29 14:22:47 +02:00
|
|
|
$(top_srcdir)/src/shred.c; } > $@-t \
|
2016-01-13 12:11:39 +00:00
|
|
|
&& { cmp $@-t $@ >/dev/null 2>&1 || mv $@-t $@; rm -f $@-t; }
|
2001-05-21 12:34:57 +00:00
|
|
|
|
2012-08-29 14:22:47 +02:00
|
|
|
MAINTAINERCLEANFILES += doc/constants.texi
|
2001-05-21 12:34:57 +00:00
|
|
|
|
2004-11-03 17:39:00 +00:00
|
|
|
# Extended regular expressions to match word starts and ends.
|
|
|
|
|
_W = (^|[^A-Za-z0-9_])
|
|
|
|
|
W_ = ([^A-Za-z0-9_]|$$)
|
|
|
|
|
|
2007-12-31 11:28:02 +01:00
|
|
|
syntax_checks = \
|
2009-10-28 08:27:48 +01:00
|
|
|
sc-avoid-builtin \
|
2007-12-31 11:28:02 +01:00
|
|
|
sc-avoid-io \
|
|
|
|
|
sc-avoid-non-zero \
|
2009-10-28 08:27:48 +01:00
|
|
|
sc-avoid-path \
|
2007-12-31 11:28:02 +01:00
|
|
|
sc-avoid-timezone \
|
|
|
|
|
sc-avoid-zeroes \
|
|
|
|
|
sc-exponent-grouping \
|
2013-01-06 12:32:22 +00:00
|
|
|
sc-lower-case-var
|
2007-12-31 11:28:02 +01:00
|
|
|
|
2012-08-29 17:59:48 +02:00
|
|
|
texi_files = $(srcdir)/doc/*.texi
|
|
|
|
|
|
2007-12-31 11:28:02 +01:00
|
|
|
.PHONY: $(syntax_checks) check-texinfo
|
|
|
|
|
|
2001-05-20 08:21:05 +00:00
|
|
|
# List words/regexps here that should not appear in the texinfo documentation.
|
2007-12-31 11:28:02 +01:00
|
|
|
check-texinfo: $(syntax_checks)
|
2009-04-30 13:44:48 +02:00
|
|
|
$(AM_V_GEN)fail=0; \
|
2012-08-29 17:59:48 +02:00
|
|
|
grep '@url{' $(texi_files) && fail=1; \
|
|
|
|
|
grep '\$$@"' $(texi_files) && fail=1; \
|
|
|
|
|
grep -n '[^[:punct:]]@footnote' $(texi_files) && fail=1; \
|
|
|
|
|
grep -n filename $(texi_files) \
|
2009-04-30 13:44:48 +02:00
|
|
|
| $(EGREP) -v 'setfilename|[{]filename[}]' \
|
|
|
|
|
&& fail=1; \
|
2009-10-28 08:27:48 +01:00
|
|
|
exit $$fail
|
|
|
|
|
|
|
|
|
|
sc-avoid-builtin:
|
2012-08-29 17:59:48 +02:00
|
|
|
$(AM_V_GEN)$(EGREP) -i '$(_W)builtins?$(W_)' $(texi_files) \
|
2009-10-28 08:27:48 +01:00
|
|
|
&& exit 1 || :
|
|
|
|
|
|
|
|
|
|
sc-avoid-path:
|
|
|
|
|
$(AM_V_GEN)fail=0; \
|
2012-08-29 17:59:48 +02:00
|
|
|
$(EGREP) -i '$(_W)path(name)?s?$(W_)' $(texi_files) \
|
2009-10-28 08:27:48 +01:00
|
|
|
| $(EGREP) -v \
|
|
|
|
|
'PATH=|path search|search path|@vindex PATH$$|@env[{]PATH[}]' \
|
|
|
|
|
&& fail=1; \
|
2003-04-01 22:16:10 +00:00
|
|
|
exit $$fail
|
2001-05-20 08:21:05 +00:00
|
|
|
|
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-22 15:26:00 -08:00
|
|
|
# Use "time zone", not "timezone".
|
2007-12-31 11:28:02 +01:00
|
|
|
sc-avoid-timezone:
|
2012-08-29 17:59:48 +02:00
|
|
|
$(AM_V_GEN)$(EGREP) timezone $(texi_files) && exit 1 || :
|
2007-12-31 11:28:02 +01:00
|
|
|
|
|
|
|
|
# Check for insufficient exponent grouping, e.g.,
|
|
|
|
|
# @math{2^64} should be @math{2^{64}}.
|
|
|
|
|
sc-exponent-grouping:
|
2012-08-29 17:59:48 +02:00
|
|
|
$(AM_V_GEN)$(EGREP) '\{.*\^[0-9][0-9]' $(texi_files) && exit 1 || :
|
2007-12-31 11:28:02 +01:00
|
|
|
|
|
|
|
|
# Say I/O, not IO.
|
|
|
|
|
sc-avoid-io:
|
2012-08-29 17:59:48 +02:00
|
|
|
$(AM_V_GEN)$(EGREP) '$(_W)IO$(W_)' $(texi_files) && exit 1 || :
|
2007-12-31 11:28:02 +01:00
|
|
|
|
|
|
|
|
# I prefer nonzero over non-zero.
|
|
|
|
|
sc-avoid-non-zero:
|
2012-08-29 17:59:48 +02:00
|
|
|
$(AM_V_GEN)$(EGREP) non-zero $(texi_files) && exit 1 || :
|
2007-12-31 11:28:02 +01:00
|
|
|
|
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-22 15:26:00 -08:00
|
|
|
# Use "zeros", not "zeroes" (nothing wrong with "zeroes"; just be consistent).
|
2007-12-31 11:28:02 +01:00
|
|
|
sc-avoid-zeroes:
|
2012-08-29 17:59:48 +02:00
|
|
|
$(AM_V_GEN)$(EGREP) -i '$(_W)zeroes$(W_)' $(texi_files) \
|
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-28 12:28:48 -08:00
|
|
|
&& exit 1 || :
|
2008-12-01 09:17:51 +01:00
|
|
|
|
|
|
|
|
# The quantity inside @var{...} should not contain upper case letters.
|
|
|
|
|
# The leading backslash exemption is to permit in-macro uses like
|
|
|
|
|
# @var{\varName\} where the upper case letter is part of a parameter name.
|
|
|
|
|
find_upper_case_var = \
|
2015-07-15 11:37:20 +01:00
|
|
|
'/\@var\{/ or next; \
|
|
|
|
|
while (/\@var\{(.+?)}/g) \
|
2008-12-01 09:17:51 +01:00
|
|
|
{ \
|
|
|
|
|
$$v = $$1; \
|
|
|
|
|
$$v =~ /[A-Z]/ && $$v !~ /^\\/ and (print "$$ARGV:$$.:$$_"), $$m = 1 \
|
|
|
|
|
} \
|
2012-08-29 14:22:47 +02:00
|
|
|
END {$$m and (warn "$@: do not use upper case in \@var{...}\n"), exit 1}'
|
2008-12-01 09:17:51 +01:00
|
|
|
sc-lower-case-var:
|
2011-09-07 11:18:20 +02:00
|
|
|
$(AM_V_GEN)$(PERL) -e 1 || { echo $@: skipping test; exit 0; }; \
|
2012-08-29 17:59:48 +02:00
|
|
|
$(PERL) -lne $(find_upper_case_var) $(texi_files)
|
2007-12-31 11:28:02 +01:00
|
|
|
|
2012-08-29 14:15:42 +02:00
|
|
|
check-local: check-texinfo
|
2025-11-27 20:45:44 +00:00
|
|
|
|
|
|
|
|
.PHONY: html-local
|