* Ralf Wildenhues wrote on Sat, Mar 14, 2009 at 01:22:56PM CET: > GNUmakefile: disable parallelism only for multiple, recursive targets > > * top/GNUmakefile (ALL_RECURSIVE_TARGETS): New macro; allow user > additions in the Makefile. > (AM_RECURSIVE_TARGETS): New macro, override only if not provided > by Automake. > (.NOTPARALLEL): Only disable parallel builds if multiple targets > are listed on the command line and at least one of them is > listed in $(ALL_RECURSIVE_TARGETS).
Since this patch has been applied to gnulib, it remains, to add a suitable definition of AM_RECURSIVE_TARGETS to Automake. I'm adding the following to the master branch. I still owe suitable documentation for this in both Automake and gnulib. Cheers, Ralf 2009-03-22 Ralf Wildenhues <ralf.wildenh...@gmx.de> Define AM_RECURSIVE_TARGETS, for gnulib's GNUmakefile. This new macro lists all public targets which invoke `make' recursively, or depend on targets which do so. It allows to prevent parallelism selectively, when multiple targets are passed on the `make' command line. * lib/am/distdir.am [%?SUBDIRS%] (AM_RECURSIVE_TARGETS): New macro. * lib/am/subdirs.am (AM_RECURSIVE_TARGETS): Likewise. * lib/am/tags.am [%?SUBDIRS%] (AM_RECURSIVE_TARGETS): Likewise. diff --git a/lib/am/distdir.am b/lib/am/distdir.am index 3bf76af..f7113e2 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -64,6 +64,10 @@ am__relativize = \ endif %?SUBDIRS% .PHONY: distdir +if %?SUBDIRS% +AM_RECURSIVE_TARGETS += distdir +endif %?SUBDIRS% + distdir: $(DISTFILES) ## ## For Gnits users, this is pretty handy. Look at 15 lines @@ -381,6 +385,10 @@ endif %?TOPDIR_P% if %?TOPDIR_P% .PHONY: dist dist-all +if %?SUBDIRS% +AM_RECURSIVE_TARGETS += dist dist-all +endif %?SUBDIRS% + dist dist-all: distdir ?GZIP? tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz ?BZIP2? tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 @@ -401,6 +409,10 @@ endif %?TOPDIR_P% if %?TOPDIR_P% +if %?SUBDIRS% +AM_RECURSIVE_TARGETS += distcheck +endif %?SUBDIRS% + # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. diff --git a/lib/am/subdirs.am b/lib/am/subdirs.am index 1888042..7fbb09e 100644 --- a/lib/am/subdirs.am +++ b/lib/am/subdirs.am @@ -1,6 +1,6 @@ ## automake - create Makefile.in from Makefile.am ## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, -## 2004, 2008 Free Software Foundation, Inc. +## 2004, 2008, 2009 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 @@ -18,6 +18,10 @@ RECURSIVE_TARGETS += all-recursive check-recursive installcheck-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive +## All documented targets which invoke `make' recursively, or depend +## on targets that do so. +AM_RECURSIVE_TARGETS += $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) .PHONY: $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS) .MAKE: $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS) diff --git a/lib/am/tags.am b/lib/am/tags.am index a654ec8..1eabe58 100644 --- a/lib/am/tags.am +++ b/lib/am/tags.am @@ -37,6 +37,9 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) ETAGS = etags .PHONY: tags +if %?SUBDIRS% +AM_RECURSIVE_TARGETS += tags TAGS +endif %?SUBDIRS% tags: TAGS TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \ @@ -96,6 +99,9 @@ TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \ CTAGS = ctags .PHONY: CTAGS ctags +if %?SUBDIRS% +AM_RECURSIVE_TARGETS += ctags CTAGS +endif %?SUBDIRS% ctags: CTAGS ## We have a dummy name here because `tags' has already been in use