Retire git-runstatus for real.
[git/git.git] / Documentation / Makefile
CommitLineData
4a5d6939
MW
1MAN1_TXT= \
2 $(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
3 $(wildcard git-*.txt)) \
4 gitk.txt
891dbc6e 5MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt
b2bf34d6 6MAN7_TXT=git.txt
b790abb8 7
5cefc33b
JH
8MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)
9MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT))
10MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT))
11
12DOC_HTML=$(MAN_HTML)
8db9307c 13
a1d4aa74 14ARTICLES = tutorial
e31952da 15ARTICLES += tutorial-2
dcc6e28f 16ARTICLES += core-tutorial
a1d4aa74
JH
17ARTICLES += cvs-migration
18ARTICLES += diffcore
19ARTICLES += howto-index
20ARTICLES += repository-layout
6d35cc76 21ARTICLES += hooks
db9536c8 22ARTICLES += everyday
4a5d6939 23ARTICLES += git-tools
f562e6f3 24ARTICLES += glossary
8db9307c 25# with their own formatting rules.
f562e6f3 26SP_ARTICLES = howto/revert-branch-rebase user-manual
8db9307c
JH
27
28DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
789d5774 29
b2bf34d6 30DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
2d76548b 31DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
b2bf34d6
DG
32DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
33
d2b8593f 34prefix?=$(HOME)
e14421b9 35bindir?=$(prefix)/bin
5d6491c7 36htmldir?=$(prefix)/share/doc/git-doc
45fd8bd3 37mandir?=$(prefix)/share/man
7b8cf0cf 38man1dir=$(mandir)/man1
4392da4d 39man5dir=$(mandir)/man5
7b8cf0cf 40man7dir=$(mandir)/man7
a682ef9f 41# DESTDIR=
87a81c83 42
1187d756 43ASCIIDOC=asciidoc
26cfcfbf 44ASCIIDOC_EXTRA =
d2b8593f 45INSTALL?=install
4cb08df5 46RM ?= rm -f
6538d1ef 47DOC_REF = origin/man
87a81c83 48
4739809c
DK
49infodir?=$(prefix)/share/info
50MAKEINFO=makeinfo
51INSTALL_INFO=install-info
52DOCBOOK2X_TEXI=docbook2x-texi
c680dd83
JH
53ifndef PERL_PATH
54 PERL_PATH = /usr/bin/perl
55endif
4739809c 56
95676853 57-include ../config.mak.autogen
4fa96e15 58-include ../config.mak
95676853 59
7f55cf45
JF
60ifdef ASCIIDOC8
61ASCIIDOC_EXTRA += -a asciidoc7compatible
62endif
63ifdef DOCBOOK_XSL_172
64ASCIIDOC_EXTRA += -a docbook-xsl-172
65endif
66
b2bf34d6
DG
67#
68# Please note that there is a minor bug in asciidoc.
69# The version after 6.0.3 _will_ include the patch found here:
70# http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
71#
72# Until that version is released you may have to apply the patch
73# yourself - yes, all 6 characters of it!
74#
75
76all: html man
b790abb8
DG
77
78html: $(DOC_HTML)
79
4392da4d 80$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
b2bf34d6 81
4392da4d 82man: man1 man5 man7
b2bf34d6 83man1: $(DOC_MAN1)
4392da4d 84man5: $(DOC_MAN5)
b2bf34d6 85man7: $(DOC_MAN7)
b790abb8 86
5cefc33b 87info: git.info gitman.info
4739809c 88
b163512d 89install: man
41650765
RS
90 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
91 $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
92 $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
93 $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
94 $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
95 $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
87a81c83 96
4739809c 97install-info: info
41650765 98 $(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
5cefc33b 99 $(INSTALL) -m 644 git.info gitman.info $(DESTDIR)$(infodir)
4739809c
DK
100 if test -r $(DESTDIR)$(infodir)/dir; then \
101 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\
5cefc33b 102 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) gitman.info ;\
4739809c
DK
103 else \
104 echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
105 fi
37465016 106
5d6491c7
CC
107install-html: html
108 sh ./install-webdoc.sh $(DESTDIR)$(htmldir)
109
7b8a74f3
FL
110../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
111 $(MAKE) -C ../ GIT-VERSION-FILE
112
113-include ../GIT-VERSION-FILE
114
93d69d86
JL
115#
116# Determine "include::" file references in asciidoc files.
117#
fb612d54 118doc.dep : $(wildcard *.txt) build-docdep.perl
4cb08df5 119 $(RM) $@+ $@
c680dd83 120 $(PERL_PATH) ./build-docdep.perl >$@+
a5ae8e64 121 mv $@+ $@
93d69d86 122
a5ae8e64 123-include doc.dep
37465016 124
72fe6a59
JH
125cmds_txt = cmds-ancillaryinterrogators.txt \
126 cmds-ancillarymanipulators.txt \
127 cmds-mainporcelain.txt \
128 cmds-plumbinginterrogators.txt \
129 cmds-plumbingmanipulators.txt \
89bf2077
JH
130 cmds-synchingrepositories.txt \
131 cmds-synchelpers.txt \
132 cmds-purehelpers.txt \
133 cmds-foreignscminterface.txt
72fe6a59 134
d7907392
JH
135$(cmds_txt): cmd-list.made
136
79d30668 137cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
f9286765 138 $(RM) $@
c680dd83 139 $(PERL_PATH) ./cmd-list.perl ../command-list.txt
d7907392 140 date >$@
b790abb8 141
40dac517 142git.7 git.html: git.txt
93d69d86 143
b790abb8 144clean:
4739809c 145 $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 *.texi *.texi+ howto-index.txt howto/*.html doc.dep
4cb08df5 146 $(RM) $(cmds_txt) *.made
b790abb8
DG
147
148%.html : %.txt
4cb08df5 149 $(RM) $@+ $@
7b8a74f3 150 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
4159c578 151 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
7b8a74f3 152 mv $@+ $@
b790abb8 153
4392da4d 154%.1 %.5 %.7 : %.xml
50cff52f 155 $(RM) $@
776e994a 156 xmlto -m callouts.xsl man $<
b790abb8
DG
157
158%.xml : %.txt
4cb08df5 159 $(RM) $@+ $@
7b8a74f3 160 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
4159c578 161 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
7b8a74f3 162 mv $@+ $@
3f971fc4 163
d19fbc3c 164user-manual.xml: user-manual.txt user-manual.conf
1187d756 165 $(ASCIIDOC) -b docbook -d book $<
d19fbc3c 166
1cffddd6 167XSLT = docbook.xsl
0a3985dc 168XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
1c95c565 169
d19fbc3c 170user-manual.html: user-manual.xml
1c95c565 171 xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
d19fbc3c 172
50b3555c
JH
173git.info: user-manual.texi
174 $(MAKEINFO) --no-split -o $@ user-manual.texi
5cefc33b 175
50b3555c 176user-manual.texi: user-manual.xml
5cefc33b
JH
177 $(RM) $@+ $@
178 $(DOCBOOK2X_TEXI) user-manual.xml --to-stdout | $(PERL_PATH) fix-texi.perl >$@+
179 mv $@+ $@
180
181gitman.texi: $(MAN_XML) cat-texi.perl
182 $(RM) $@+ $@
183 ($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --to-stdout $(xml);)) | \
184 $(PERL_PATH) cat-texi.perl $@ >$@+
185 mv $@+ $@
186
187gitman.info: gitman.texi
4739809c 188 $(MAKEINFO) --no-split $*.texi
5cefc33b
JH
189
190$(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
191 $(RM) $@+ $@
192 $(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+
193 mv $@+ $@
4739809c 194
e6fc2346 195howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
4cb08df5 196 $(RM) $@+ $@
e6fc2346
JH
197 sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
198 mv $@+ $@
199
8db9307c 200$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
1187d756 201 $(ASCIIDOC) -b xhtml11 $*.txt
e6fc2346
JH
202
203WEBDOC_DEST = /pub/software/scm/git/docs
204
8d0991d7 205$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
4cb08df5 206 $(RM) $@+ $@
1187d756 207 sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+
8d0991d7
JH
208 mv $@+ $@
209
e6fc2346
JH
210install-webdoc : html
211 sh ./install-webdoc.sh $(WEBDOC_DEST)
6538d1ef
EW
212
213quick-install:
214 sh ./install-doc-quick.sh $(DOC_REF) $(mandir)
7b8a74f3
FL
215
216.PHONY: .FORCE-GIT-VERSION-FILE