Documentation/Makefile: make $(wildcard howto/*.txt) a var
Refactor occurrences of $(wildcard howto/*.txt) into a single HOWTO_TXT variable for readability and consistency. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Apr 9, 2021 at 17:02 UTC
824c621b76e5d629f2a13f519c610796199ddc4e
1 file changed
+6
-3
Documentation/Makefile
+6
-3
@@ -2,6 +2,7 @@
2
MAN1_TXT =
3
MAN5_TXT =
4
MAN7_TXT =
5
+HOWTO_TXT =
6
TECH_DOCS =
7
ARTICLES =
8
SP_ARTICLES =
@@ -42,6 +43,8 @@ MAN7_TXT += gittutorial-2.txt
43
MAN7_TXT += gittutorial.txt
44
MAN7_TXT += gitworkflows.txt
45
46
+HOWTO_TXT += $(wildcard howto/*.txt)
47
+
48
ifdef MAN_FILTER
49
MAN_TXT = $(filter $(MAN_FILTER),$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))
50
else
@@ -428,9 +431,9 @@ $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
431
$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \
432
mv $@+ $@
433
431
-howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
434
+howto-index.txt: howto-index.sh $(HOWTO_TXT)
435
$(QUIET_GEN)$(RM) $@+ $@ && \
433
- '$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@+ && \
436
+ '$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(HOWTO_TXT)) >$@+ && \
437
mv $@+ $@
438
439
$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
@@ -439,7 +442,7 @@ $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
442
WEBDOC_DEST = /pub/software/scm/git/docs
443
444
howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
442
-$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt GIT-ASCIIDOCFLAGS
445
+$(patsubst %.txt,%.html,$(HOWTO_TXT)): %.html : %.txt GIT-ASCIIDOCFLAGS
446
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
447
sed -e '1,/^$$/d' $< | \
448
$(TXT_TO_HTML) - >$@+ && \