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