aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/Makefile
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2022-11-27 17:42:51 -0500
committerJunio C Hamano <gitster@pobox.com>2022-11-28 10:18:55 +0900
commit9f95c7aefa8419b697972abd9d25ce9062fac2bf (patch)
tree1f96cc089c6c8086a17ff4ab2def760a58603ec7 /Documentation/Makefile
parente7e5c6f715b2de7bea0d39c7d2ba887335b40aa0 (diff)
downloadgit-9f95c7aefa8419b697972abd9d25ce9062fac2bf.tar.gz
Makefile: avoid multiple patterns when recipes generate one file
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. 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@gmail.com> Signed-off-by: Paul Smith <psmith@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/Makefile')
-rw-r--r--Documentation/Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Documentation/Makefile b/Documentation/Makefile
index d47acb2e25..21375cd3f2 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -351,8 +351,16 @@ $(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)
%.xml : %.txt $(ASCIIDOC_DEPS)
$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $<