]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/Makefile
Merge branch 'master' of git://repo.or.cz/git/fastimport
[thirdparty/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
4392da4d 8DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))
8db9307c 9
a1d4aa74 10ARTICLES = tutorial
e31952da 11ARTICLES += tutorial-2
dcc6e28f 12ARTICLES += core-tutorial
a1d4aa74
JH
13ARTICLES += cvs-migration
14ARTICLES += diffcore
15ARTICLES += howto-index
16ARTICLES += repository-layout
6d35cc76 17ARTICLES += hooks
db9536c8 18ARTICLES += everyday
4a5d6939 19ARTICLES += git-tools
f562e6f3 20ARTICLES += glossary
8db9307c 21# with their own formatting rules.
f562e6f3 22SP_ARTICLES = howto/revert-branch-rebase user-manual
8db9307c
JH
23
24DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
789d5774 25
b2bf34d6 26DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
2d76548b 27DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
b2bf34d6
DG
28DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
29
d2b8593f 30prefix?=$(HOME)
e14421b9 31bindir?=$(prefix)/bin
45fd8bd3 32mandir?=$(prefix)/share/man
7b8cf0cf 33man1dir=$(mandir)/man1
4392da4d 34man5dir=$(mandir)/man5
7b8cf0cf 35man7dir=$(mandir)/man7
a682ef9f 36# DESTDIR=
87a81c83 37
1187d756 38ASCIIDOC=asciidoc
26cfcfbf 39ASCIIDOC_EXTRA =
4c7100a9
JH
40ifdef ASCIIDOC8
41ASCIIDOC_EXTRA += -a asciidoc7compatible
42endif
d2b8593f 43INSTALL?=install
6538d1ef 44DOC_REF = origin/man
87a81c83 45
95676853 46-include ../config.mak.autogen
4fa96e15 47-include ../config.mak
95676853 48
b2bf34d6
DG
49#
50# Please note that there is a minor bug in asciidoc.
51# The version after 6.0.3 _will_ include the patch found here:
52# http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
53#
54# Until that version is released you may have to apply the patch
55# yourself - yes, all 6 characters of it!
56#
57
58all: html man
b790abb8
DG
59
60html: $(DOC_HTML)
61
4392da4d 62$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
b2bf34d6 63
4392da4d 64man: man1 man5 man7
b2bf34d6 65man1: $(DOC_MAN1)
4392da4d 66man5: $(DOC_MAN5)
b2bf34d6 67man7: $(DOC_MAN7)
b790abb8 68
b163512d 69install: man
4392da4d
JH
70 $(INSTALL) -d -m755 $(DESTDIR)$(man1dir)
71 $(INSTALL) -d -m755 $(DESTDIR)$(man5dir)
72 $(INSTALL) -d -m755 $(DESTDIR)$(man7dir)
d44c92d6 73 $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
88e7fdf2 74 $(INSTALL) -m644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
d44c92d6 75 $(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
87a81c83 76
37465016 77
7b8a74f3
FL
78../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
79 $(MAKE) -C ../ GIT-VERSION-FILE
80
81-include ../GIT-VERSION-FILE
82
93d69d86
JL
83#
84# Determine "include::" file references in asciidoc files.
85#
fb612d54 86doc.dep : $(wildcard *.txt) build-docdep.perl
a5ae8e64
JH
87 rm -f $@+ $@
88 perl ./build-docdep.perl >$@+
89 mv $@+ $@
93d69d86 90
a5ae8e64 91-include doc.dep
37465016 92
72fe6a59
JH
93cmds_txt = cmds-ancillaryinterrogators.txt \
94 cmds-ancillarymanipulators.txt \
95 cmds-mainporcelain.txt \
96 cmds-plumbinginterrogators.txt \
97 cmds-plumbingmanipulators.txt \
89bf2077
JH
98 cmds-synchingrepositories.txt \
99 cmds-synchelpers.txt \
100 cmds-purehelpers.txt \
101 cmds-foreignscminterface.txt
72fe6a59 102
d7907392
JH
103$(cmds_txt): cmd-list.made
104
105cmd-list.made: cmd-list.perl $(MAN1_TXT)
72fe6a59 106 perl ./cmd-list.perl
d7907392 107 date >$@
b790abb8 108
72fe6a59 109git.7 git.html: git.txt core-intro.txt
93d69d86 110
b790abb8 111clean:
4392da4d 112 rm -f *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 howto-index.txt howto/*.html doc.dep
d7907392 113 rm -f $(cmds_txt) *.made
b790abb8
DG
114
115%.html : %.txt
7b8a74f3
FL
116 rm -f $@+ $@
117 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
4159c578 118 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
7b8a74f3 119 mv $@+ $@
b790abb8 120
4392da4d 121%.1 %.5 %.7 : %.xml
776e994a 122 xmlto -m callouts.xsl man $<
b790abb8
DG
123
124%.xml : %.txt
7b8a74f3
FL
125 rm -f $@+ $@
126 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
4159c578 127 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
7b8a74f3 128 mv $@+ $@
3f971fc4 129
d19fbc3c 130user-manual.xml: user-manual.txt user-manual.conf
1187d756 131 $(ASCIIDOC) -b docbook -d book $<
d19fbc3c 132
1c95c565 133XSLT = http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
0a3985dc 134XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
1c95c565 135
d19fbc3c 136user-manual.html: user-manual.xml
1c95c565 137 xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
d19fbc3c 138
e6fc2346
JH
139howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
140 rm -f $@+ $@
141 sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
142 mv $@+ $@
143
8db9307c 144$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
1187d756 145 $(ASCIIDOC) -b xhtml11 $*.txt
e6fc2346
JH
146
147WEBDOC_DEST = /pub/software/scm/git/docs
148
8d0991d7
JH
149$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
150 rm -f $@+ $@
1187d756 151 sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+
8d0991d7
JH
152 mv $@+ $@
153
e6fc2346
JH
154install-webdoc : html
155 sh ./install-webdoc.sh $(WEBDOC_DEST)
6538d1ef
EW
156
157quick-install:
158 sh ./install-doc-quick.sh $(DOC_REF) $(mandir)
7b8a74f3
FL
159
160.PHONY: .FORCE-GIT-VERSION-FILE