From f56980b99cadfe93fc208da781985786fdab87ce Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Wed, 29 Aug 2012 14:22:47 +0200 Subject: build: don't use recursive make to build the 'doc' subdirectory * doc/Makefile.am: Rename ... * doc/local.mk: ... like this. With further adjustments ... (info_TEXINFOS): Prepend 'doc/' to all '*.texi' files listed in here. (coreutils_TEXINFOS): Likewise, and rename ... (doc_coreutils_TEXINFOS): ... like this. (constants.texi): Rename ... (doc/constants.texi): ... like this. Adjust the recipe to avoid spurious errors. (MAINTAINERCLEANFILES): Adjust, and extend with '+=' rather than setting it with '='. (ME): Delete. (find_upper_case_var): Use '$@', not '$(ME)', in error messages. * Makefile.am: Include 'doc/local.mk'. (SUBDIRS): Remove 'doc'. * configure.ac (AC_CONFIG_FILES): Remove 'doc/Makefile'. --- Makefile.am | 4 +- configure.ac | 1 - doc/Makefile.am | 129 ------------------------------------------------------- doc/local.mk | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 134 insertions(+), 131 deletions(-) delete mode 100644 doc/Makefile.am create mode 100644 doc/local.mk diff --git a/Makefile.am b/Makefile.am index 72d93d544..0446e4344 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,7 @@ ALL_RECURSIVE_TARGETS = -SUBDIRS = lib src doc man po tests gnulib-tests +SUBDIRS = lib src man po tests gnulib-tests changelog_etc = \ ChangeLog-2005 \ @@ -169,3 +169,5 @@ check-git-hook-script-sync: done; \ rm -rf $$t; \ test $$fail = 0 + +include $(top_srcdir)/doc/local.mk diff --git a/configure.ac b/configure.ac index 5651fd127..52918ca6d 100644 --- a/configure.ac +++ b/configure.ac @@ -492,7 +492,6 @@ gt_LOCALE_FR AC_CONFIG_FILES( Makefile - doc/Makefile lib/Makefile man/Makefile po/Makefile.in diff --git a/doc/Makefile.am b/doc/Makefile.am deleted file mode 100644 index 121c7cc6d..000000000 --- a/doc/Makefile.am +++ /dev/null @@ -1,129 +0,0 @@ -# Make coreutils documentation. -*-Makefile-*- - -# Copyright (C) 1995-2012 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (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 -# along with this program. If not, see . - -info_TEXINFOS = coreutils.texi - -coreutils_TEXINFOS = perm.texi parse-datetime.texi constants.texi fdl.texi - -doc_srcdir = $(top_srcdir)/doc - -# 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: .info. -# Otherwise, it would also generate files with names like .info-[123], -# and those names all map to one 14-byte name (.info-) on some crufty -# old systems. -AM_MAKEINFOFLAGS = --no-split - -constants.texi: $(top_srcdir)/src/tail.c $(top_srcdir)/src/shred.c - $(AM_V_GEN)LC_ALL=C; export LC_ALL; \ - { sed -n -e 's/^#define \(DEFAULT_MAX[_A-Z]*\) \(.*\)/@set \1 \2/p' \ - $(top_srcdir)/src/tail.c && \ - sed -n -e \ - 's/.*\(DEFAULT_PASSES\)[ =]* \([0-9]*\).*/@set SHRED_\1 \2/p'\ - $(top_srcdir)/src/shred.c; } > t-$@ \ - && mv t-$@ $@ - -MAINTAINERCLEANFILES = constants.texi - -# Extended regular expressions to match word starts and ends. -_W = (^|[^A-Za-z0-9_]) -W_ = ([^A-Za-z0-9_]|$$) - -syntax_checks = \ - sc-avoid-builtin \ - sc-avoid-io \ - sc-avoid-non-zero \ - sc-avoid-path \ - sc-avoid-timezone \ - sc-avoid-zeroes \ - sc-exponent-grouping \ - sc-lower-case-var \ - sc-use-small-caps-NUL - -.PHONY: $(syntax_checks) check-texinfo - -# List words/regexps here that should not appear in the texinfo documentation. -check-texinfo: $(syntax_checks) - $(AM_V_GEN)fail=0; \ - grep '@url{' $(doc_srcdir)/*.texi && fail=1; \ - grep '\$$@"' $(doc_srcdir)/*.texi && fail=1; \ - grep -n '[^[:punct:]]@footnote' $(doc_srcdir)/*.texi && fail=1; \ - grep -n filename $(doc_srcdir)/*.texi \ - | $(EGREP) -v 'setfilename|[{]filename[}]' \ - && fail=1; \ - exit $$fail - -sc-avoid-builtin: - $(AM_V_GEN)$(EGREP) -i '$(_W)builtins?$(W_)' $(doc_srcdir)/*.texi \ - && exit 1 || : - -sc-avoid-path: - $(AM_V_GEN)fail=0; \ - $(EGREP) -i '$(_W)path(name)?s?$(W_)' $(doc_srcdir)/*.texi \ - | $(EGREP) -v \ - 'PATH=|path search|search path|@vindex PATH$$|@env[{]PATH[}]' \ - && fail=1; \ - exit $$fail - -# Use "time zone", not "timezone". -sc-avoid-timezone: - $(AM_V_GEN)$(EGREP) timezone $(doc_srcdir)/*.texi && exit 1 || : - -# Check for insufficient exponent grouping, e.g., -# @math{2^64} should be @math{2^{64}}. -sc-exponent-grouping: - $(AM_V_GEN)$(EGREP) '\{.*\^[0-9][0-9]' $(doc_srcdir)/*.texi && exit 1 || : - -# E.g., use @sc{nul}, not NUL. -sc-use-small-caps-NUL: - $(AM_V_GEN)$(EGREP) '$(_W)NUL$(W_)' $(doc_srcdir)/*.texi && exit 1 || : - -# Say I/O, not IO. -sc-avoid-io: - $(AM_V_GEN)$(EGREP) '$(_W)IO$(W_)' $(doc_srcdir)/*.texi && exit 1 || : - -# I prefer nonzero over non-zero. -sc-avoid-non-zero: - $(AM_V_GEN)$(EGREP) non-zero $(doc_srcdir)/*.texi && exit 1 || : - -# Use "zeros", not "zeroes" (nothing wrong with "zeroes"; just be consistent). -sc-avoid-zeroes: - $(AM_V_GEN)$(EGREP) -i '$(_W)zeroes$(W_)' $(doc_srcdir)/*.texi \ - && exit 1 || : - -# ME = $(subdir)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -ME = doc/Makefile - -# 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 = \ - '/\@var{/ or next; \ - while (/\@var{(.+?)}/g) \ - { \ - $$v = $$1; \ - $$v =~ /[A-Z]/ && $$v !~ /^\\/ and (print "$$ARGV:$$.:$$_"), $$m = 1 \ - } \ - END {$$m and (warn "$(ME): do not use upper case in \@var{...}\n"), exit 1}' -sc-lower-case-var: - $(AM_V_GEN)$(PERL) -e 1 || { echo $@: skipping test; exit 0; }; \ - $(PERL) -lne $(find_upper_case_var) $(doc_srcdir)/*.texi - -check-local: check-texinfo diff --git a/doc/local.mk b/doc/local.mk new file mode 100644 index 000000000..665dd211d --- /dev/null +++ b/doc/local.mk @@ -0,0 +1,131 @@ +# Make coreutils documentation. -*-Makefile-*- +# This is included by the top-level Makefile.am. + +# Copyright (C) 1995-2012 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (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 +# along with this program. If not, see . + +info_TEXINFOS = doc/coreutils.texi + +doc_coreutils_TEXINFOS = \ + doc/perm.texi \ + doc/parse-datetime.texi \ + doc/constants.texi \ + doc/fdl.texi + +doc_srcdir = $(top_srcdir)/doc + +# 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: .info. +# Otherwise, it would also generate files with names like .info-[123], +# and those names all map to one 14-byte name (.info-) on some crufty +# old systems. +AM_MAKEINFOFLAGS = --no-split + +doc/constants.texi: $(top_srcdir)/src/tail.c $(top_srcdir)/src/shred.c + $(AM_V_GEN)LC_ALL=C; export LC_ALL; \ + { sed -n -e 's/^#define \(DEFAULT_MAX[_A-Z]*\) \(.*\)/@set \1 \2/p' \ + $(top_srcdir)/src/tail.c && \ + sed -n -e \ + 's/.*\(DEFAULT_PASSES\)[ =]* \([0-9]*\).*/@set SHRED_\1 \2/p'\ + $(top_srcdir)/src/shred.c; } > $@-t \ + && mv $@-t $@ + +MAINTAINERCLEANFILES += doc/constants.texi + +# Extended regular expressions to match word starts and ends. +_W = (^|[^A-Za-z0-9_]) +W_ = ([^A-Za-z0-9_]|$$) + +syntax_checks = \ + sc-avoid-builtin \ + sc-avoid-io \ + sc-avoid-non-zero \ + sc-avoid-path \ + sc-avoid-timezone \ + sc-avoid-zeroes \ + sc-exponent-grouping \ + sc-lower-case-var \ + sc-use-small-caps-NUL + +.PHONY: $(syntax_checks) check-texinfo + +# List words/regexps here that should not appear in the texinfo documentation. +check-texinfo: $(syntax_checks) + $(AM_V_GEN)fail=0; \ + grep '@url{' $(doc_srcdir)/*.texi && fail=1; \ + grep '\$$@"' $(doc_srcdir)/*.texi && fail=1; \ + grep -n '[^[:punct:]]@footnote' $(doc_srcdir)/*.texi && fail=1; \ + grep -n filename $(doc_srcdir)/*.texi \ + | $(EGREP) -v 'setfilename|[{]filename[}]' \ + && fail=1; \ + exit $$fail + +sc-avoid-builtin: + $(AM_V_GEN)$(EGREP) -i '$(_W)builtins?$(W_)' $(doc_srcdir)/*.texi \ + && exit 1 || : + +sc-avoid-path: + $(AM_V_GEN)fail=0; \ + $(EGREP) -i '$(_W)path(name)?s?$(W_)' $(doc_srcdir)/*.texi \ + | $(EGREP) -v \ + 'PATH=|path search|search path|@vindex PATH$$|@env[{]PATH[}]' \ + && fail=1; \ + exit $$fail + +# Use "time zone", not "timezone". +sc-avoid-timezone: + $(AM_V_GEN)$(EGREP) timezone $(doc_srcdir)/*.texi && exit 1 || : + +# Check for insufficient exponent grouping, e.g., +# @math{2^64} should be @math{2^{64}}. +sc-exponent-grouping: + $(AM_V_GEN)$(EGREP) '\{.*\^[0-9][0-9]' $(doc_srcdir)/*.texi && exit 1 || : + +# E.g., use @sc{nul}, not NUL. +sc-use-small-caps-NUL: + $(AM_V_GEN)$(EGREP) '$(_W)NUL$(W_)' $(doc_srcdir)/*.texi && exit 1 || : + +# Say I/O, not IO. +sc-avoid-io: + $(AM_V_GEN)$(EGREP) '$(_W)IO$(W_)' $(doc_srcdir)/*.texi && exit 1 || : + +# I prefer nonzero over non-zero. +sc-avoid-non-zero: + $(AM_V_GEN)$(EGREP) non-zero $(doc_srcdir)/*.texi && exit 1 || : + +# Use "zeros", not "zeroes" (nothing wrong with "zeroes"; just be consistent). +sc-avoid-zeroes: + $(AM_V_GEN)$(EGREP) -i '$(_W)zeroes$(W_)' $(doc_srcdir)/*.texi \ + && exit 1 || : + +# 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 = \ + '/\@var{/ or next; \ + while (/\@var{(.+?)}/g) \ + { \ + $$v = $$1; \ + $$v =~ /[A-Z]/ && $$v !~ /^\\/ and (print "$$ARGV:$$.:$$_"), $$m = 1 \ + } \ + END {$$m and (warn "$@: do not use upper case in \@var{...}\n"), exit 1}' +sc-lower-case-var: + $(AM_V_GEN)$(PERL) -e 1 || { echo $@: skipping test; exit 0; }; \ + $(PERL) -lne $(find_upper_case_var) $(doc_srcdir)/*.texi + +check-local: check-texinfo -- cgit v1.2.3-70-g09d2