Mark user-manual as UTF-8
[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
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
4cb08df5 44RM ?= rm -f
6538d1ef 45DOC_REF = origin/man
87a81c83 46
95676853 47-include ../config.mak.autogen
4fa96e15 48-include ../config.mak
95676853 49
b2bf34d6
DG
50#
51# Please note that there is a minor bug in asciidoc.
52# The version after 6.0.3 _will_ include the patch found here:
53# http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
54#
55# Until that version is released you may have to apply the patch
56# yourself - yes, all 6 characters of it!
57#
58
59all: html man
b790abb8
DG
60
61html: $(DOC_HTML)
62
4392da4d 63$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
b2bf34d6 64
4392da4d 65man: man1 man5 man7
b2bf34d6 66man1: $(DOC_MAN1)
4392da4d 67man5: $(DOC_MAN5)
b2bf34d6 68man7: $(DOC_MAN7)
b790abb8 69
b163512d 70install: man
4392da4d
JH
71 $(INSTALL) -d -m755 $(DESTDIR)$(man1dir)
72 $(INSTALL) -d -m755 $(DESTDIR)$(man5dir)
73 $(INSTALL) -d -m755 $(DESTDIR)$(man7dir)
d44c92d6 74 $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
88e7fdf2 75 $(INSTALL) -m644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
d44c92d6 76 $(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
87a81c83 77
37465016 78
7b8a74f3
FL
79../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
80 $(MAKE) -C ../ GIT-VERSION-FILE
81
82-include ../GIT-VERSION-FILE
83
93d69d86
JL
84#
85# Determine "include::" file references in asciidoc files.
86#
fb612d54 87doc.dep : $(wildcard *.txt) build-docdep.perl
4cb08df5 88 $(RM) $@+ $@
a5ae8e64
JH
89 perl ./build-docdep.perl >$@+
90 mv $@+ $@
93d69d86 91
a5ae8e64 92-include doc.dep
37465016 93
72fe6a59
JH
94cmds_txt = cmds-ancillaryinterrogators.txt \
95 cmds-ancillarymanipulators.txt \
96 cmds-mainporcelain.txt \
97 cmds-plumbinginterrogators.txt \
98 cmds-plumbingmanipulators.txt \
89bf2077
JH
99 cmds-synchingrepositories.txt \
100 cmds-synchelpers.txt \
101 cmds-purehelpers.txt \
102 cmds-foreignscminterface.txt
72fe6a59 103
d7907392
JH
104$(cmds_txt): cmd-list.made
105
106cmd-list.made: cmd-list.perl $(MAN1_TXT)
72fe6a59 107 perl ./cmd-list.perl
d7907392 108 date >$@
b790abb8 109
72fe6a59 110git.7 git.html: git.txt core-intro.txt
93d69d86 111
b790abb8 112clean:
4cb08df5
EM
113 $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 howto-index.txt howto/*.html doc.dep
114 $(RM) $(cmds_txt) *.made
b790abb8
DG
115
116%.html : %.txt
4cb08df5 117 $(RM) $@+ $@
7b8a74f3 118 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
4159c578 119 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
7b8a74f3 120 mv $@+ $@
b790abb8 121
4392da4d 122%.1 %.5 %.7 : %.xml
776e994a 123 xmlto -m callouts.xsl man $<
b790abb8
DG
124
125%.xml : %.txt
4cb08df5 126 $(RM) $@+ $@
7b8a74f3 127 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
4159c578 128 $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
7b8a74f3 129 mv $@+ $@
3f971fc4 130
d19fbc3c 131user-manual.xml: user-manual.txt user-manual.conf
1187d756 132 $(ASCIIDOC) -b docbook -d book $<
d19fbc3c 133
1cffddd6 134XSLT = docbook.xsl
0a3985dc 135XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
1c95c565 136
d19fbc3c 137user-manual.html: user-manual.xml
1c95c565 138 xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
d19fbc3c 139
e6fc2346 140howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
4cb08df5 141 $(RM) $@+ $@
e6fc2346
JH
142 sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
143 mv $@+ $@
144
8db9307c 145$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
1187d756 146 $(ASCIIDOC) -b xhtml11 $*.txt
e6fc2346
JH
147
148WEBDOC_DEST = /pub/software/scm/git/docs
149
8d0991d7 150$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
4cb08df5 151 $(RM) $@+ $@
1187d756 152 sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+
8d0991d7
JH
153 mv $@+ $@
154
e6fc2346
JH
155install-webdoc : html
156 sh ./install-webdoc.sh $(WEBDOC_DEST)
6538d1ef
EW
157
158quick-install:
159 sh ./install-doc-quick.sh $(DOC_REF) $(mandir)
7b8a74f3
FL
160
161.PHONY: .FORCE-GIT-VERSION-FILE