Git fork

contrib/subtree: fix building docs

In a38edab7c8 (Makefile: generate doc versions via GIT-VERSION-GEN,
2024-12-06), we have refactored how we build our documentation by
injecting the Git version into the Asciidoc and AsciiDoctor config
files instead of doing so via arguments. As such, the original config
files were removed, where the expectation is that they get generated via
`GIT-VERSION-GEN` now.

Whie the git-subtree(1) command part of "contrib/" also builds docs
using these same config files, its Makefile wasn't adjusted accordingly
and thus building the docs is broken.

Fix this by using `GIT-VERSION-GEN` to generate those files.

Reported-by: Renato Botelho <garga@FreeBSD.org>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
d4cd75f6 fbe8d307

+17 -8
+2
contrib/subtree/.gitignore
··· 1 1 *~ 2 + asciidoc.conf 3 + asciidoctor-extensions.rb 2 4 git-subtree 3 5 git-subtree.1 4 6 git-subtree.html
+15 -8
contrib/subtree/Makefile
··· 1 1 # The default target of this Makefile is... 2 2 all:: 3 3 4 + -include ../../shared.mak 4 5 -include ../../config.mak.autogen 5 6 -include ../../config.mak 6 7 ··· 13 14 ../../GIT-VERSION-FILE: FORCE 14 15 $(MAKE) -C ../../ GIT-VERSION-FILE 15 16 16 - -include ../../GIT-VERSION-FILE 17 - 18 17 # this should be set to a 'standard' bsd-type install program 19 18 INSTALL ?= install 20 19 RM ?= rm -f 21 20 22 21 ASCIIDOC = asciidoc 23 - ASCIIDOC_CONF = -f ../../Documentation/asciidoc.conf 22 + ASCIIDOC_CONF = -f asciidoc.conf 24 23 ASCIIDOC_HTML = xhtml11 25 24 ASCIIDOC_DOCBOOK = docbook 26 25 ASCIIDOC_EXTRA = 26 + ASCIIDOC_DEPS = asciidoc.conf 27 27 XMLTO = xmlto 28 28 XMLTO_EXTRA = 29 29 ··· 32 32 ASCIIDOC_CONF = 33 33 ASCIIDOC_HTML = xhtml5 34 34 ASCIIDOC_DOCBOOK = docbook 35 - ASCIIDOC_EXTRA += -I../../Documentation -rasciidoctor-extensions 35 + ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions 36 36 ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;' 37 + ASCIIDOC_DEPS = asciidoctor-extensions.rb 37 38 XMLTO_EXTRA += --skip-validation 38 39 endif 39 40 ··· 82 83 $(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML) 83 84 $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $^ 84 85 85 - $(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT) 86 + $(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT) $(ASCIIDOC_DEPS) 86 87 $(ASCIIDOC) -b $(ASCIIDOC_DOCBOOK) -d manpage $(ASCIIDOC_CONF) \ 87 - -agit_version=$(GIT_VERSION) $(ASCIIDOC_EXTRA) $^ 88 + $(ASCIIDOC_EXTRA) $< 88 89 89 - $(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT) 90 + $(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT) $(ASCIIDOC_DEPS) 90 91 $(ASCIIDOC) -b $(ASCIIDOC_HTML) -d manpage $(ASCIIDOC_CONF) \ 91 - -agit_version=$(GIT_VERSION) $(ASCIIDOC_EXTRA) $^ 92 + $(ASCIIDOC_EXTRA) $< 92 93 93 94 $(GIT_SUBTREE_TEST): $(GIT_SUBTREE) 94 95 cp $< $@ ··· 98 99 99 100 clean: 100 101 $(RM) $(GIT_SUBTREE) 102 + $(RM) asciidoc.conf asciidoctor-extensions.rb 101 103 $(RM) *.xml *.html *.1 104 + 105 + asciidoc.conf: ../../Documentation/asciidoc.conf.in ../../GIT-VERSION-FILE 106 + $(QUIET_GEN)$(call version_gen,"$(shell pwd)/../..",$<,$@) 107 + asciidoctor-extensions.rb: ../../Documentation/asciidoctor-extensions.rb.in ../../GIT-VERSION-FILE 108 + $(QUIET_GEN)$(call version_gen,"$(shell pwd)/../..",$<,$@) 102 109 103 110 .PHONY: FORCE