Commit | Line | Data |
---|---|---|
4a5d6939 MW |
1 | MAN1_TXT= \ |
2 | $(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \ | |
3 | $(wildcard git-*.txt)) \ | |
9e1f0a85 | 4 | gitk.txt git.txt |
30eba7bf CC |
5 | MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt githooks.txt \ |
6 | gitrepository-layout.txt | |
9e1f0a85 | 7 | MAN7_TXT=gitcli.txt gittutorial.txt gittutorial-2.txt \ |
30eba7bf CC |
8 | gitcvs-migration.txt gitcore-tutorial.txt gitglossary.txt \ |
9 | gitdiffcore.txt | |
b790abb8 | 10 | |
5cefc33b JH |
11 | MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT) |
12 | MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT)) | |
13 | MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT)) | |
14 | ||
15 | DOC_HTML=$(MAN_HTML) | |
8db9307c | 16 | |
30eba7bf | 17 | ARTICLES = howto-index |
db9536c8 | 18 | ARTICLES += everyday |
4a5d6939 | 19 | ARTICLES += git-tools |
8db9307c | 20 | # with their own formatting rules. |
471a5ce5 | 21 | SP_ARTICLES = howto/revert-branch-rebase howto/using-merge-subtree user-manual |
530e741c JH |
22 | API_DOCS = $(patsubst %.txt,%,$(filter-out technical/api-index-skel.txt technical/api-index.txt, $(wildcard technical/api-*.txt))) |
23 | SP_ARTICLES += $(API_DOCS) | |
24 | SP_ARTICLES += technical/api-index | |
8db9307c JH |
25 | |
26 | DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES)) | |
789d5774 | 27 | |
b2bf34d6 | 28 | DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT)) |
2d76548b | 29 | DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT)) |
b2bf34d6 DG |
30 | DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT)) |
31 | ||
d2b8593f | 32 | prefix?=$(HOME) |
e14421b9 | 33 | bindir?=$(prefix)/bin |
5d6491c7 | 34 | htmldir?=$(prefix)/share/doc/git-doc |
45fd8bd3 | 35 | mandir?=$(prefix)/share/man |
7b8cf0cf | 36 | man1dir=$(mandir)/man1 |
4392da4d | 37 | man5dir=$(mandir)/man5 |
7b8cf0cf | 38 | man7dir=$(mandir)/man7 |
a682ef9f | 39 | # DESTDIR= |
87a81c83 | 40 | |
1187d756 | 41 | ASCIIDOC=asciidoc |
26cfcfbf | 42 | ASCIIDOC_EXTRA = |
7a2078b4 | 43 | MANPAGE_XSL = callouts.xsl |
d2b8593f | 44 | INSTALL?=install |
4cb08df5 | 45 | RM ?= rm -f |
6538d1ef | 46 | DOC_REF = origin/man |
87a81c83 | 47 | |
4739809c DK |
48 | infodir?=$(prefix)/share/info |
49 | MAKEINFO=makeinfo | |
50 | INSTALL_INFO=install-info | |
51 | DOCBOOK2X_TEXI=docbook2x-texi | |
c680dd83 JH |
52 | ifndef PERL_PATH |
53 | PERL_PATH = /usr/bin/perl | |
54 | endif | |
4739809c | 55 | |
95676853 | 56 | -include ../config.mak.autogen |
4fa96e15 | 57 | -include ../config.mak |
95676853 | 58 | |
7f55cf45 JF |
59 | ifdef ASCIIDOC8 |
60 | ASCIIDOC_EXTRA += -a asciidoc7compatible | |
61 | endif | |
62 | ifdef DOCBOOK_XSL_172 | |
63 | ASCIIDOC_EXTRA += -a docbook-xsl-172 | |
7a2078b4 | 64 | MANPAGE_XSL = manpage-1.72.xsl |
7f55cf45 JF |
65 | endif |
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 | ||
76 | all: html man | |
b790abb8 DG |
77 | |
78 | html: $(DOC_HTML) | |
79 | ||
4392da4d | 80 | $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf |
b2bf34d6 | 81 | |
4392da4d | 82 | man: man1 man5 man7 |
b2bf34d6 | 83 | man1: $(DOC_MAN1) |
4392da4d | 84 | man5: $(DOC_MAN5) |
b2bf34d6 | 85 | man7: $(DOC_MAN7) |
b790abb8 | 86 | |
5cefc33b | 87 | info: git.info gitman.info |
4739809c | 88 | |
b163512d | 89 | install: 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 | 97 | install-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 |
107 | install-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 | 118 | doc.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 |
125 | cmds_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 | 137 | cmd-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 DG |
141 | |
142 | clean: | |
4c785e50 JH |
143 | $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 |
144 | $(RM) *.texi *.texi+ git.info gitman.info | |
530e741c JH |
145 | $(RM) howto-index.txt howto/*.html doc.dep |
146 | $(RM) technical/api-*.html technical/api-index.txt | |
4cb08df5 | 147 | $(RM) $(cmds_txt) *.made |
b790abb8 | 148 | |
530e741c | 149 | $(MAN_HTML): %.html : %.txt |
4cb08df5 | 150 | $(RM) $@+ $@ |
7b8a74f3 | 151 | $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \ |
4159c578 | 152 | $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< |
7b8a74f3 | 153 | mv $@+ $@ |
b790abb8 | 154 | |
4392da4d | 155 | %.1 %.5 %.7 : %.xml |
50cff52f | 156 | $(RM) $@ |
7a2078b4 | 157 | xmlto -m $(MANPAGE_XSL) man $< |
b790abb8 DG |
158 | |
159 | %.xml : %.txt | |
4cb08df5 | 160 | $(RM) $@+ $@ |
7b8a74f3 | 161 | $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \ |
4159c578 | 162 | $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< |
7b8a74f3 | 163 | mv $@+ $@ |
3f971fc4 | 164 | |
d19fbc3c | 165 | user-manual.xml: user-manual.txt user-manual.conf |
1187d756 | 166 | $(ASCIIDOC) -b docbook -d book $< |
d19fbc3c | 167 | |
530e741c JH |
168 | technical/api-index.txt: technical/api-index-skel.txt \ |
169 | technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS)) | |
170 | cd technical && sh ./api-index.sh | |
171 | ||
172 | $(patsubst %,%.html,$(API_DOCS) technical/api-index): %.html : %.txt | |
173 | $(ASCIIDOC) -b xhtml11 -f asciidoc.conf \ | |
174 | $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt | |
175 | ||
1cffddd6 | 176 | XSLT = docbook.xsl |
0a3985dc | 177 | XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css |
1c95c565 | 178 | |
d19fbc3c | 179 | user-manual.html: user-manual.xml |
1c95c565 | 180 | xsltproc $(XSLTOPTS) -o $@ $(XSLT) $< |
d19fbc3c | 181 | |
50b3555c JH |
182 | git.info: user-manual.texi |
183 | $(MAKEINFO) --no-split -o $@ user-manual.texi | |
5cefc33b | 184 | |
50b3555c | 185 | user-manual.texi: user-manual.xml |
5cefc33b JH |
186 | $(RM) $@+ $@ |
187 | $(DOCBOOK2X_TEXI) user-manual.xml --to-stdout | $(PERL_PATH) fix-texi.perl >$@+ | |
188 | mv $@+ $@ | |
189 | ||
190 | gitman.texi: $(MAN_XML) cat-texi.perl | |
191 | $(RM) $@+ $@ | |
192 | ($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --to-stdout $(xml);)) | \ | |
193 | $(PERL_PATH) cat-texi.perl $@ >$@+ | |
194 | mv $@+ $@ | |
195 | ||
196 | gitman.info: gitman.texi | |
4739809c | 197 | $(MAKEINFO) --no-split $*.texi |
5cefc33b JH |
198 | |
199 | $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml | |
200 | $(RM) $@+ $@ | |
201 | $(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ | |
202 | mv $@+ $@ | |
4739809c | 203 | |
e6fc2346 | 204 | howto-index.txt: howto-index.sh $(wildcard howto/*.txt) |
4cb08df5 | 205 | $(RM) $@+ $@ |
e6fc2346 JH |
206 | sh ./howto-index.sh $(wildcard howto/*.txt) >$@+ |
207 | mv $@+ $@ | |
208 | ||
8db9307c | 209 | $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt |
1187d756 | 210 | $(ASCIIDOC) -b xhtml11 $*.txt |
e6fc2346 JH |
211 | |
212 | WEBDOC_DEST = /pub/software/scm/git/docs | |
213 | ||
8d0991d7 | 214 | $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt |
4cb08df5 | 215 | $(RM) $@+ $@ |
1187d756 | 216 | sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+ |
8d0991d7 JH |
217 | mv $@+ $@ |
218 | ||
e6fc2346 JH |
219 | install-webdoc : html |
220 | sh ./install-webdoc.sh $(WEBDOC_DEST) | |
6538d1ef EW |
221 | |
222 | quick-install: | |
5682694a | 223 | sh ./install-doc-quick.sh $(DOC_REF) $(DESTDIR)$(mandir) |
7b8a74f3 FL |
224 | |
225 | .PHONY: .FORCE-GIT-VERSION-FILE |