Documentation: Replace @@GIT_VERSION@@ in documentation
Include GIT-VERSION-FILE and replace @@GIT_VERSION@@ in the HTML and XML asciidoc output. The documentation doesn't depend on GIT-VERSION-FILE so it will not be automatically rebuild if nothing else changed. [jc: fixing the case for interrupted build] Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Frank Lichtenheld committed
Mar 25, 2007 at 13:56 UTC
7b8a74f39cbd58b514dce963e7a571904508661b
1 file changed
+18
-3
Documentation/Makefile
+18
-3
@@ -65,6 +65,11 @@ install: man
65
$(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
66
67
68
+../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
69
+ $(MAKE) -C ../ GIT-VERSION-FILE
70
+
71
+-include ../GIT-VERSION-FILE
72
+
73
#
74
# Determine "include::" file references in asciidoc files.
75
#
@@ -91,17 +96,25 @@ $(cmds_txt): cmd-list.perl $(MAN1_TXT)
96
git.7 git.html: git.txt core-intro.txt
97
98
clean:
94
- rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep
99
+ rm -f *.xml *.xml+ *.html *.html+ *.1 *.7 howto-index.txt howto/*.html doc.dep
100
rm -f $(cmds_txt)
101
102
%.html : %.txt
98
- $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $<
103
+ rm -f $@+ $@
104
+ $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
105
+ $(ASCIIDOC_EXTRA) -o - $< | \
106
+ sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+
107
+ mv $@+ $@
108
109
%.1 %.7 : %.xml
110
xmlto -m callouts.xsl man $<
111
112
%.xml : %.txt
104
- $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf $<
113
+ rm -f $@+ $@
114
+ $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
115
+ $(ASCIIDOC_EXTRA) -o - $< | \
116
+ sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+
117
+ mv $@+ $@
118
119
user-manual.xml: user-manual.txt user-manual.conf
120
$(ASCIIDOC) -b docbook -d book $<
@@ -132,3 +145,5 @@ install-webdoc : html
145
146
quick-install:
147
sh ./install-doc-quick.sh $(DOC_REF) $(mandir)
148
+
149
+.PHONY: .FORCE-GIT-VERSION-FILE