coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 06/22] build: don't use recursive make to build the 'doc' subdire


From: Stefano Lattarini
Subject: [PATCH 06/22] build: don't use recursive make to build the 'doc' subdirectory
Date: Wed, 29 Aug 2012 23:54:43 +0200

* 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'.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 Makefile.am                   |  4 +++-
 configure.ac                  |  1 -
 doc/{Makefile.am => local.mk} | 22 ++++++++++++----------
 3 files changed, 15 insertions(+), 12 deletions(-)
 rename doc/{Makefile.am => local.mk} (90%)

diff --git a/Makefile.am b/Makefile.am
index 72d93d5..0446e43 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 5651fd1..52918ca 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/local.mk
similarity index 90%
rename from doc/Makefile.am
rename to doc/local.mk
index 121c7cc..665dd21 100644
--- a/doc/Makefile.am
+++ b/doc/local.mk
@@ -1,4 +1,5 @@
 # Make coreutils documentation.                                -*-Makefile-*-
+# This is included by the top-level Makefile.am.
 
 # Copyright (C) 1995-2012 Free Software Foundation, Inc.
 
@@ -15,9 +16,13 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-info_TEXINFOS = coreutils.texi
+info_TEXINFOS = doc/coreutils.texi
 
-coreutils_TEXINFOS = perm.texi parse-datetime.texi constants.texi fdl.texi
+doc_coreutils_TEXINFOS = \
+  doc/perm.texi \
+  doc/parse-datetime.texi \
+  doc/constants.texi \
+  doc/fdl.texi
 
 doc_srcdir = $(top_srcdir)/doc
 
@@ -31,16 +36,16 @@ doc_srcdir = $(top_srcdir)/doc
 # old systems.
 AM_MAKEINFOFLAGS = --no-split
 
-constants.texi: $(top_srcdir)/src/tail.c $(top_srcdir)/src/shred.c
+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-$@ $@
+           $(top_srcdir)/src/shred.c; } > $@-t \
+         && mv $@-t $@
 
-MAINTAINERCLEANFILES = constants.texi
+MAINTAINERCLEANFILES += doc/constants.texi
 
 # Extended regular expressions to match word starts and ends.
 _W = (^|[^A-Za-z0-9_])
@@ -108,9 +113,6 @@ 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.
@@ -121,7 +123,7 @@ find_upper_case_var =               \
        $$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}'
+   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
-- 
1.7.12




reply via email to

[Prev in Thread] Current Thread [Next in Thread]