GNU Make 4.4 was released just about a month ago[1], this series picks up & amends a change from Paul Smith (the GNU make maintainer), and then fixes another bug in our Makefiles as a result of a backwards-incompatible change in how $(MAKEFLAGS) works in 4.4. Junio: I think this is worth considering for merging down in the rc peried. We can limp along without these fixes, but not being able to build the docs to completion (as far as make is concerned) and the new warnings fixed by 2/4 will probably break things for or annoy some packagers. The 3/4 then fixes the output being always-verbose for our sub-Makefiles for the affected targets. 4/4 is pure-refactoring, but I think should help build confidence in the preceding changes. 1. https://lwn.net/Articles/913253/ Paul Smith (1): Documentation/Makefile: avoid multiple patterns when generating one file Ævar Arnfjörð Bjarmason (3): Documentation/Makefile: de-duplicate *.[157] dependency list Makefiles: change search through $(MAKEFLAGS) for GNU make 4.4 Documentation/Makefile: narrow wildcard rules to our known files Documentation/Makefile | 15 ++++++++++++--- git-gui/Makefile | 2 +- shared.mak | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) Range-diff against v1: 1: 115d79fe1fc ! 1: 42b4f241c97 Avoid multiple patterns when recipes generate one file @@ ## Metadata ## -Author: Paul Smith <psmith@xxxxxxx> +Author: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> ## Commit message ## - Avoid multiple patterns when recipes generate one file + Documentation/Makefile: de-duplicate *.[157] dependency list - A GNU make pattern rule with multiple targets has always meant that - a single invocation of the recipe will build all the targets. - However in older versions of GNU make a recipe that did not really - build all the targets would be tolerated. + Use the "DOC_MAN[157]" variables combined into a new "DOC_MANN" to + declare that e.g. "git-am.1" depends on "manpage-base-url.xsl" + etc. This change helps to make a subsequent change smaller. - Starting with GNU make 4.4 this behavior is deprecated and pattern - rules are expected to generate files to match all the patterns. - If not all targets are created then GNU make will not consider any - target up to date and will re-run the recipe when it is run again. - - Modify Documentation/Makefile to split the man page-creating pattern - rule into a separate pattern rule for each pattern. - - Reported-by: Alexander Kanavin <alex.kanavin@xxxxxxxxx> - Signed-off-by: Paul Smith <psmith@xxxxxxx> + Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> ## Documentation/Makefile ## +@@ Documentation/Makefile: ARTICLES_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES)) + HTML_FILTER ?= $(ARTICLES_HTML) $(OBSOLETE_HTML) + DOC_HTML = $(MAN_HTML) $(filter $(HTML_FILTER),$(ARTICLES_HTML) $(OBSOLETE_HTML)) + ++DOC_MANN = + DOC_MAN1 = $(patsubst %.txt,%.1,$(filter $(MAN_FILTER),$(MAN1_TXT))) ++DOC_MANN += $(DOC_MAN1) + DOC_MAN5 = $(patsubst %.txt,%.5,$(filter $(MAN_FILTER),$(MAN5_TXT))) ++DOC_MANN += $(DOC_MAN5) + DOC_MAN7 = $(patsubst %.txt,%.7,$(filter $(MAN_FILTER),$(MAN7_TXT))) ++DOC_MANN += $(DOC_MAN7) + + prefix ?= $(HOME) + bindir ?= $(prefix)/bin @@ Documentation/Makefile: $(OBSOLETE_HTML): %.html : %.txto $(ASCIIDOC_DEPS) manpage-base-url.xsl: manpage-base-url.xsl.in $(QUIET_GEN)sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@ -%.1 %.5 %.7 : %.xml manpage-base-url.xsl $(wildcard manpage*.xsl) -- $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< -+ -+manpage-prereqs := manpage-base-url.xsl $(wildcard manpage*.xsl) -+manpage-cmd = $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< -+ -+%.1 : %.xml $(manpage-prereqs) -+ $(manpage-cmd) -+%.5 : %.xml $(manpage-prereqs) -+ $(manpage-cmd) -+%.7 : %.xml $(manpage-prereqs) -+ $(manpage-cmd) ++$(DOC_MANN): manpage-base-url.xsl $(wildcard manpage*.xsl) ++%.1 %.5 %.7 : %.xml + $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< %.xml : %.txt $(ASCIIDOC_DEPS) - $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $< -: ----------- > 2: e232f308e40 Documentation/Makefile: avoid multiple patterns when generating one file -: ----------- > 3: 6db7dd74e52 Makefiles: change search through $(MAKEFLAGS) for GNU make 4.4 -: ----------- > 4: f1bc3c16904 Documentation/Makefile: narrow wildcard rules to our known files -- 2.39.0.rc0.993.g0c499e58e3b