git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Paul Smith" <psmith@gnu.org>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v2 4/4] Documentation/Makefile: narrow wildcard rules to our known files
Date: Tue, 29 Nov 2022 15:09:17 +0100	[thread overview]
Message-ID: <patch-v2-4.4-f1bc3c16904-20221129T140159Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-v2-0.4-00000000000-20221129T140159Z-avarab@gmail.com>

Instead of declaring that we'll generate e.g. any "%.1" from a
corresponding "%.xml" let's narrow that list down to only our known
manpage files, and likewise for %.xml.

We already generated e.g. "man1" on the basis of "$(DOC_MAN1)", we
just weren't keeping track of what we were generating exactly in the
these middle steps.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Documentation/Makefile | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 89929e3d60b..f84b54ac093 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -356,14 +356,14 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
 	$(QUIET_GEN)sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
 
 $(DOC_MANN): manpage-base-url.xsl $(wildcard manpage*.xsl)
-%.1 : %.xml
-	$(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
-%.5 : %.xml
-	$(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
-%.7 : %.xml
-	$(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
-
-%.xml : %.txt $(ASCIIDOC_DEPS)
+define doc-mann-rule
+$$(DOC_MAN$(1)) : %.$(1) : %.xml
+	$$(QUIET_XMLTO)$$(XMLTO) -m $$(MANPAGE_XSL) $$(XMLTO_EXTRA) man $$<
+
+endef
+$(eval $(foreach n,1 5 7,$(call doc-mann-rule,$(n))))
+
+$(MAN_XML): %.xml : %.txt $(ASCIIDOC_DEPS)
 	$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $<
 
 user-manual.xml: user-manual.txt user-manual.conf asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
-- 
2.39.0.rc0.993.g0c499e58e3b


  parent reply	other threads:[~2022-11-29 14:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-27 22:42 [PATCH 0/1] Avoid multiple patterns when recipes generate one file Paul Smith
2022-11-27 22:42 ` [PATCH 1/1] " Paul Smith
2022-11-28 13:08   ` Ævar Arnfjörð Bjarmason
2022-11-28 18:33     ` Paul Smith
2022-11-28 18:57       ` Ævar Arnfjörð Bjarmason
2022-11-29 14:09 ` [PATCH v2 0/4] Makefiles: GNU make 4.4 fixes Ævar Arnfjörð Bjarmason
2022-11-29 14:09   ` [PATCH v2 1/4] Documentation/Makefile: de-duplicate *.[157] dependency list Ævar Arnfjörð Bjarmason
2022-11-30  4:17     ` Junio C Hamano
2022-11-29 14:09   ` [PATCH v2 2/4] Documentation/Makefile: avoid multiple patterns when generating one file Ævar Arnfjörð Bjarmason
2022-11-30  4:18     ` Junio C Hamano
2022-11-29 14:09   ` [PATCH v2 3/4] Makefiles: change search through $(MAKEFLAGS) for GNU make 4.4 Ævar Arnfjörð Bjarmason
2022-11-30  4:28     ` Junio C Hamano
2022-11-30  5:49       ` Paul Smith
2022-12-01 12:37         ` Ævar Arnfjörð Bjarmason
2022-11-29 14:09   ` Ævar Arnfjörð Bjarmason [this message]
2022-11-30  1:27   ` [PATCH v2 0/4] Makefiles: GNU make 4.4 fixes Junio C Hamano
2022-11-30  8:23   ` [PATCH v3 0/1] " Ævar Arnfjörð Bjarmason
2022-11-30  8:23     ` [PATCH v3 1/1] Makefiles: change search through $(MAKEFLAGS) for GNU make 4.4 Ævar Arnfjörð Bjarmason
2022-11-30 16:29       ` Paul Smith
2022-11-30 22:23         ` Junio C Hamano
2022-12-06  7:48           ` Johannes Schindelin
2022-12-06  8:13             ` Ævar Arnfjörð Bjarmason
2022-12-06  9:13               ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=patch-v2-4.4-f1bc3c16904-20221129T140159Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=psmith@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).