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