Commit | Line | Data |
---|---|---|
a617578d JK |
1 | # Guard against environment variables |
2 | MAN1_TXT = | |
3 | MAN5_TXT = | |
4 | MAN7_TXT = | |
43cc5ce9 JH |
5 | TECH_DOCS = |
6 | ARTICLES = | |
7 | SP_ARTICLES = | |
5a568ea0 | 8 | OBSOLETE_HTML = |
a617578d JK |
9 | |
10 | MAN1_TXT += $(filter-out \ | |
11 | $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \ | |
12 | $(wildcard git-*.txt)) | |
13 | MAN1_TXT += git.txt | |
14 | MAN1_TXT += gitk.txt | |
b9a5f681 | 15 | MAN1_TXT += gitremote-helpers.txt |
a617578d JK |
16 | MAN1_TXT += gitweb.txt |
17 | ||
18 | MAN5_TXT += gitattributes.txt | |
19 | MAN5_TXT += githooks.txt | |
20 | MAN5_TXT += gitignore.txt | |
21 | MAN5_TXT += gitmodules.txt | |
22 | MAN5_TXT += gitrepository-layout.txt | |
23 | MAN5_TXT += gitweb.conf.txt | |
24 | ||
25 | MAN7_TXT += gitcli.txt | |
26 | MAN7_TXT += gitcore-tutorial.txt | |
a6fc9fd3 | 27 | MAN7_TXT += gitcredentials.txt |
a617578d JK |
28 | MAN7_TXT += gitcvs-migration.txt |
29 | MAN7_TXT += gitdiffcore.txt | |
673151a9 | 30 | MAN7_TXT += giteveryday.txt |
a617578d JK |
31 | MAN7_TXT += gitglossary.txt |
32 | MAN7_TXT += gitnamespaces.txt | |
33 | MAN7_TXT += gitrevisions.txt | |
d4803455 | 34 | MAN7_TXT += gitsubmodules.txt |
a617578d JK |
35 | MAN7_TXT += gittutorial-2.txt |
36 | MAN7_TXT += gittutorial.txt | |
37 | MAN7_TXT += gitworkflows.txt | |
b790abb8 | 38 | |
3d5b568f JNA |
39 | ifdef MAN_FILTER |
40 | MAN_TXT = $(filter $(MAN_FILTER),$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)) | |
41 | else | |
5cefc33b | 42 | MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT) |
3d5b568f JNA |
43 | MAN_FILTER = $(MAN_TXT) |
44 | endif | |
45 | ||
692cfd6b JK |
46 | MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT)) |
47 | MAN_HTML = $(patsubst %.txt,%.html,$(MAN_TXT)) | |
65289e9d | 48 | GIT_MAN_REF = master |
5cefc33b | 49 | |
673151a9 | 50 | OBSOLETE_HTML += everyday.html |
5a568ea0 | 51 | OBSOLETE_HTML += git-remote-helpers.html |
8db9307c | 52 | |
43cc5ce9 | 53 | ARTICLES += howto-index |
4a5d6939 | 54 | ARTICLES += git-tools |
69a9cd31 | 55 | ARTICLES += git-bisect-lk2009 |
8db9307c | 56 | # with their own formatting rules. |
43cc5ce9 | 57 | SP_ARTICLES += user-manual |
81670e9b | 58 | SP_ARTICLES += howto/new-command |
11b17afc JH |
59 | SP_ARTICLES += howto/revert-branch-rebase |
60 | SP_ARTICLES += howto/using-merge-subtree | |
61 | SP_ARTICLES += howto/using-signed-tag-in-pull-request | |
5e00439f TA |
62 | SP_ARTICLES += howto/use-git-daemon |
63 | SP_ARTICLES += howto/update-hook-example | |
64 | SP_ARTICLES += howto/setup-git-server-over-http | |
65 | SP_ARTICLES += howto/separating-topic-branches | |
66 | SP_ARTICLES += howto/revert-a-faulty-merge | |
67 | SP_ARTICLES += howto/recover-corrupted-blob-object | |
41dfbb2d | 68 | SP_ARTICLES += howto/recover-corrupted-object-harder |
5e00439f | 69 | SP_ARTICLES += howto/rebuild-from-update-hook |
5e00439f | 70 | SP_ARTICLES += howto/rebase-from-internal-branch |
0678b649 | 71 | SP_ARTICLES += howto/keep-canonical-history-correct |
5e00439f | 72 | SP_ARTICLES += howto/maintain-git |
530e741c JH |
73 | API_DOCS = $(patsubst %.txt,%,$(filter-out technical/api-index-skel.txt technical/api-index.txt, $(wildcard technical/api-*.txt))) |
74 | SP_ARTICLES += $(API_DOCS) | |
5e00439f | 75 | |
049e64aa | 76 | TECH_DOCS += SubmittingPatches |
752414ae | 77 | TECH_DOCS += technical/hash-function-transition |
43cc5ce9 | 78 | TECH_DOCS += technical/http-protocol |
586aa786 | 79 | TECH_DOCS += technical/index-format |
addad105 | 80 | TECH_DOCS += technical/long-running-process-protocol |
60568178 | 81 | TECH_DOCS += technical/multi-pack-index |
5e00439f TA |
82 | TECH_DOCS += technical/pack-format |
83 | TECH_DOCS += technical/pack-heuristics | |
84 | TECH_DOCS += technical/pack-protocol | |
5641eb94 | 85 | TECH_DOCS += technical/partial-clone |
5e00439f TA |
86 | TECH_DOCS += technical/protocol-capabilities |
87 | TECH_DOCS += technical/protocol-common | |
ed10cb95 | 88 | TECH_DOCS += technical/protocol-v2 |
5e00439f TA |
89 | TECH_DOCS += technical/racy-git |
90 | TECH_DOCS += technical/send-pack-pipeline | |
91 | TECH_DOCS += technical/shallow | |
76f9d8ba | 92 | TECH_DOCS += technical/signature-format |
5e00439f TA |
93 | TECH_DOCS += technical/trivial-merge |
94 | SP_ARTICLES += $(TECH_DOCS) | |
530e741c | 95 | SP_ARTICLES += technical/api-index |
8db9307c | 96 | |
3d5b568f JNA |
97 | ARTICLES_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES)) |
98 | HTML_FILTER ?= $(ARTICLES_HTML) $(OBSOLETE_HTML) | |
99 | DOC_HTML = $(MAN_HTML) $(filter $(HTML_FILTER),$(ARTICLES_HTML) $(OBSOLETE_HTML)) | |
789d5774 | 100 | |
3d5b568f JNA |
101 | DOC_MAN1 = $(patsubst %.txt,%.1,$(filter $(MAN_FILTER),$(MAN1_TXT))) |
102 | DOC_MAN5 = $(patsubst %.txt,%.5,$(filter $(MAN_FILTER),$(MAN5_TXT))) | |
103 | DOC_MAN7 = $(patsubst %.txt,%.7,$(filter $(MAN_FILTER),$(MAN7_TXT))) | |
b2bf34d6 | 104 | |
692cfd6b JK |
105 | prefix ?= $(HOME) |
106 | bindir ?= $(prefix)/bin | |
107 | htmldir ?= $(prefix)/share/doc/git-doc | |
e21db2c6 | 108 | infodir ?= $(prefix)/share/info |
692cfd6b JK |
109 | pdfdir ?= $(prefix)/share/doc/git-doc |
110 | mandir ?= $(prefix)/share/man | |
111 | man1dir = $(mandir)/man1 | |
112 | man5dir = $(mandir)/man5 | |
113 | man7dir = $(mandir)/man7 | |
114 | # DESTDIR = | |
87a81c83 | 115 | |
dd4f3075 | 116 | ASCIIDOC = asciidoc |
26cfcfbf | 117 | ASCIIDOC_EXTRA = |
7d61547d | 118 | ASCIIDOC_HTML = xhtml11 |
119 | ASCIIDOC_DOCBOOK = docbook | |
120 | ASCIIDOC_CONF = -f asciidoc.conf | |
da8a3664 | 121 | ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF) \ |
a4c04448 | 122 | -agit_version=$(GIT_VERSION) |
da8a3664 | 123 | TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML) |
124 | TXT_TO_XML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_DOCBOOK) | |
c30e9485 | 125 | MANPAGE_XSL = manpage-normal.xsl |
dd4f3075 | 126 | XMLTO = xmlto |
5121a6d9 | 127 | XMLTO_EXTRA = |
692cfd6b | 128 | INSTALL ?= install |
4cb08df5 | 129 | RM ?= rm -f |
fcbebfdd JH |
130 | MAN_REPO = ../../git-manpages |
131 | HTML_REPO = ../../git-htmldocs | |
87a81c83 | 132 | |
692cfd6b JK |
133 | MAKEINFO = makeinfo |
134 | INSTALL_INFO = install-info | |
135 | DOCBOOK2X_TEXI = docbook2x-texi | |
136 | DBLATEX = dblatex | |
0079d6eb | 137 | ASCIIDOC_DBLATEX_DIR = /etc/asciidoc/dblatex |
ae4e3e8d | 138 | DBLATEX_COMMON = -p $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.xsl -s $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.sty |
c680dd83 JH |
139 | ifndef PERL_PATH |
140 | PERL_PATH = /usr/bin/perl | |
141 | endif | |
4739809c | 142 | |
95676853 | 143 | -include ../config.mak.autogen |
4fa96e15 | 144 | -include ../config.mak |
95676853 | 145 | |
8fa2b45f CJ |
146 | # |
147 | # For docbook-xsl ... | |
79c461d5 JK |
148 | # -1.68.1, no extra settings are needed? |
149 | # 1.69.0, set ASCIIDOC_ROFF? | |
2346431e | 150 | # 1.69.1-1.71.0, set DOCBOOK_SUPPRESS_SP? |
79c461d5 | 151 | # 1.71.1, set ASCIIDOC_ROFF? |
8fa2b45f | 152 | # 1.72.0, set DOCBOOK_XSL_172. |
79c461d5 | 153 | # 1.73.0-, no extra settings are needed |
8fa2b45f CJ |
154 | # |
155 | ||
7f55cf45 | 156 | ifdef DOCBOOK_XSL_172 |
8fa2b45f | 157 | ASCIIDOC_EXTRA += -a git-asciidoc-no-roff |
7a2078b4 | 158 | MANPAGE_XSL = manpage-1.72.xsl |
8fa2b45f | 159 | else |
79c461d5 | 160 | ifndef ASCIIDOC_ROFF |
8fa2b45f CJ |
161 | # docbook-xsl after 1.72 needs the regular XSL, but will not |
162 | # pass-thru raw roff codes from asciidoc.conf, so turn them off. | |
163 | ASCIIDOC_EXTRA += -a git-asciidoc-no-roff | |
164 | endif | |
7f55cf45 | 165 | endif |
59457170 | 166 | ifndef NO_MAN_BOLD_LITERAL |
5121a6d9 CJ |
167 | XMLTO_EXTRA += -m manpage-bold-literal.xsl |
168 | endif | |
2346431e CJ |
169 | ifdef DOCBOOK_SUPPRESS_SP |
170 | XMLTO_EXTRA += -m manpage-suppress-sp.xsl | |
171 | endif | |
7f55cf45 | 172 | |
8dd35c71 | 173 | # Newer DocBook stylesheet emits warning cruft in the output when |
50d9bbba TZ |
174 | # this is not set, and if set it shows an absolute link. Older |
175 | # stylesheets simply ignore this parameter. | |
59a0a0bd | 176 | # |
50d9bbba TZ |
177 | # Distros may want to use MAN_BASE_URL=file:///path/to/git/docs/ |
178 | # or similar. | |
179 | ifndef MAN_BASE_URL | |
180 | MAN_BASE_URL = file://$(htmldir)/ | |
59a0a0bd | 181 | endif |
50d9bbba | 182 | XMLTO_EXTRA += -m manpage-base-url.xsl |
a479a564 | 183 | |
204d363f TR |
184 | # If your target system uses GNU groff, it may try to render |
185 | # apostrophes as a "pretty" apostrophe using unicode. This breaks | |
186 | # cut&paste, so you should set GNU_ROFF to force them to be ASCII | |
187 | # apostrophes. Unfortunately does not work with non-GNU roff. | |
188 | ifdef GNU_ROFF | |
189 | XMLTO_EXTRA += -m manpage-quote-apos.xsl | |
190 | endif | |
191 | ||
ec3366eb | 192 | ifdef USE_ASCIIDOCTOR |
193 | ASCIIDOC = asciidoctor | |
194 | ASCIIDOC_CONF = | |
195 | ASCIIDOC_HTML = xhtml5 | |
196 | ASCIIDOC_DOCBOOK = docbook45 | |
743e63f3 | 197 | ASCIIDOC_EXTRA += -acompat-mode -atabsize=8 |
55d2d812 | 198 | ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions |
ec3366eb | 199 | ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;' |
200 | DBLATEX_COMMON = | |
201 | endif | |
202 | ||
ee7ec2f9 BW |
203 | SHELL_PATH ?= $(SHELL) |
204 | # Shell quote; | |
205 | SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) | |
206 | ||
5b58619a JN |
207 | ifdef DEFAULT_PAGER |
208 | DEFAULT_PAGER_SQ = $(subst ','\'',$(DEFAULT_PAGER)) | |
209 | ASCIIDOC_EXTRA += -a 'git-default-pager=$(DEFAULT_PAGER_SQ)' | |
210 | endif | |
211 | ||
212 | ifdef DEFAULT_EDITOR | |
213 | DEFAULT_EDITOR_SQ = $(subst ','\'',$(DEFAULT_EDITOR)) | |
214 | ASCIIDOC_EXTRA += -a 'git-default-editor=$(DEFAULT_EDITOR_SQ)' | |
215 | endif | |
216 | ||
bb230097 CJ |
217 | QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir |
218 | QUIET_SUBDIR1 = | |
219 | ||
220 | ifneq ($(findstring $(MAKEFLAGS),w),w) | |
221 | PRINT_DIR = --no-print-directory | |
222 | else # "make -w" | |
223 | NO_SUBDIR = : | |
224 | endif | |
225 | ||
226 | ifneq ($(findstring $(MAKEFLAGS),s),s) | |
227 | ifndef V | |
228 | QUIET_ASCIIDOC = @echo ' ' ASCIIDOC $@; | |
229 | QUIET_XMLTO = @echo ' ' XMLTO $@; | |
230 | QUIET_DB2TEXI = @echo ' ' DB2TEXI $@; | |
231 | QUIET_MAKEINFO = @echo ' ' MAKEINFO $@; | |
232 | QUIET_DBLATEX = @echo ' ' DBLATEX $@; | |
233 | QUIET_XSLTPROC = @echo ' ' XSLTPROC $@; | |
234 | QUIET_GEN = @echo ' ' GEN $@; | |
ab81411c | 235 | QUIET_LINT = @echo ' ' LINT $@; |
bb230097 CJ |
236 | QUIET_STDERR = 2> /dev/null |
237 | QUIET_SUBDIR0 = +@subdir= | |
238 | QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \ | |
239 | $(MAKE) $(PRINT_DIR) -C $$subdir | |
240 | export V | |
241 | endif | |
242 | endif | |
243 | ||
b2bf34d6 | 244 | all: html man |
b790abb8 DG |
245 | |
246 | html: $(DOC_HTML) | |
247 | ||
4392da4d | 248 | man: man1 man5 man7 |
b2bf34d6 | 249 | man1: $(DOC_MAN1) |
4392da4d | 250 | man5: $(DOC_MAN5) |
b2bf34d6 | 251 | man7: $(DOC_MAN7) |
b790abb8 | 252 | |
5cefc33b | 253 | info: git.info gitman.info |
4739809c | 254 | |
a325a1a7 MV |
255 | pdf: user-manual.pdf |
256 | ||
b1a46b70 MH |
257 | install: install-man |
258 | ||
259 | install-man: man | |
41650765 RS |
260 | $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir) |
261 | $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir) | |
262 | $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir) | |
263 | $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir) | |
264 | $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir) | |
265 | $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir) | |
87a81c83 | 266 | |
4739809c | 267 | install-info: info |
41650765 | 268 | $(INSTALL) -d -m 755 $(DESTDIR)$(infodir) |
5cefc33b | 269 | $(INSTALL) -m 644 git.info gitman.info $(DESTDIR)$(infodir) |
4739809c DK |
270 | if test -r $(DESTDIR)$(infodir)/dir; then \ |
271 | $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\ | |
5cefc33b | 272 | $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) gitman.info ;\ |
4739809c DK |
273 | else \ |
274 | echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \ | |
275 | fi | |
37465016 | 276 | |
a325a1a7 MV |
277 | install-pdf: pdf |
278 | $(INSTALL) -d -m 755 $(DESTDIR)$(pdfdir) | |
279 | $(INSTALL) -m 644 user-manual.pdf $(DESTDIR)$(pdfdir) | |
280 | ||
5d6491c7 | 281 | install-html: html |
ee7ec2f9 | 282 | '$(SHELL_PATH_SQ)' ./install-webdoc.sh $(DESTDIR)$(htmldir) |
5d6491c7 | 283 | |
13fca9f3 | 284 | ../GIT-VERSION-FILE: FORCE |
bb230097 | 285 | $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE |
7b8a74f3 FL |
286 | |
287 | -include ../GIT-VERSION-FILE | |
288 | ||
93d69d86 JL |
289 | # |
290 | # Determine "include::" file references in asciidoc files. | |
291 | # | |
f35ec546 DA |
292 | docdep_prereqs = \ |
293 | mergetools-list.made $(mergetools_txt) \ | |
294 | cmd-list.made $(cmds_txt) | |
295 | ||
76b993af | 296 | doc.dep : $(docdep_prereqs) $(wildcard *.txt) $(wildcard config/*.txt) build-docdep.perl |
bb230097 CJ |
297 | $(QUIET_GEN)$(RM) $@+ $@ && \ |
298 | $(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \ | |
a5ae8e64 | 299 | mv $@+ $@ |
93d69d86 | 300 | |
a5ae8e64 | 301 | -include doc.dep |
37465016 | 302 | |
72fe6a59 JH |
303 | cmds_txt = cmds-ancillaryinterrogators.txt \ |
304 | cmds-ancillarymanipulators.txt \ | |
305 | cmds-mainporcelain.txt \ | |
306 | cmds-plumbinginterrogators.txt \ | |
307 | cmds-plumbingmanipulators.txt \ | |
89bf2077 JH |
308 | cmds-synchingrepositories.txt \ |
309 | cmds-synchelpers.txt \ | |
310 | cmds-purehelpers.txt \ | |
311 | cmds-foreignscminterface.txt | |
72fe6a59 | 312 | |
d7907392 JH |
313 | $(cmds_txt): cmd-list.made |
314 | ||
79d30668 | 315 | cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT) |
bb230097 CJ |
316 | $(QUIET_GEN)$(RM) $@ && \ |
317 | $(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \ | |
d7907392 | 318 | date >$@ |
b790abb8 | 319 | |
f35ec546 DA |
320 | mergetools_txt = mergetools-diff.txt mergetools-merge.txt |
321 | ||
322 | $(mergetools_txt): mergetools-list.made | |
323 | ||
324 | mergetools-list.made: ../git-mergetool--lib.sh $(wildcard ../mergetools/*) | |
325 | $(QUIET_GEN)$(RM) $@ && \ | |
326 | $(SHELL_PATH) -c 'MERGE_TOOLS_DIR=../mergetools && \ | |
327 | . ../git-mergetool--lib.sh && \ | |
328 | show_tool_names can_diff "* " || :' >mergetools-diff.txt && \ | |
329 | $(SHELL_PATH) -c 'MERGE_TOOLS_DIR=../mergetools && \ | |
330 | . ../git-mergetool--lib.sh && \ | |
331 | show_tool_names can_merge "* " || :' >mergetools-merge.txt && \ | |
332 | date >$@ | |
333 | ||
b790abb8 | 334 | clean: |
4c785e50 | 335 | $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 |
c6a5ad21 | 336 | $(RM) *.texi *.texi+ *.texi++ git.info gitman.info |
ae8044a2 | 337 | $(RM) *.pdf |
530e741c | 338 | $(RM) howto-index.txt howto/*.html doc.dep |
5e00439f | 339 | $(RM) technical/*.html technical/api-index.txt |
049e64aa | 340 | $(RM) SubmittingPatches.txt |
f35ec546 | 341 | $(RM) $(cmds_txt) $(mergetools_txt) *.made |
50d9bbba | 342 | $(RM) manpage-base-url.xsl |
b790abb8 | 343 | |
fdb04244 | 344 | $(MAN_HTML): %.html : %.txt asciidoc.conf |
bb230097 | 345 | $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ |
da8a3664 | 346 | $(TXT_TO_HTML) -d manpage -o $@+ $< && \ |
7b8a74f3 | 347 | mv $@+ $@ |
b790abb8 | 348 | |
bd4a3d61 JK |
349 | $(OBSOLETE_HTML): %.html : %.txto asciidoc.conf |
350 | $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ | |
da8a3664 | 351 | $(TXT_TO_HTML) -o $@+ $< && \ |
bd4a3d61 JK |
352 | mv $@+ $@ |
353 | ||
50d9bbba | 354 | manpage-base-url.xsl: manpage-base-url.xsl.in |
96a7501a | 355 | $(QUIET_GEN)sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@ |
50d9bbba TZ |
356 | |
357 | %.1 %.5 %.7 : %.xml manpage-base-url.xsl | |
bb230097 | 358 | $(QUIET_XMLTO)$(RM) $@ && \ |
dd4f3075 | 359 | $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< |
b790abb8 | 360 | |
fdb04244 | 361 | %.xml : %.txt asciidoc.conf |
bb230097 | 362 | $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ |
da8a3664 | 363 | $(TXT_TO_XML) -d manpage -o $@+ $< && \ |
7b8a74f3 | 364 | mv $@+ $@ |
3f971fc4 | 365 | |
d19fbc3c | 366 | user-manual.xml: user-manual.txt user-manual.conf |
f9dae0d3 | 367 | $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ |
03920ac6 | 368 | $(TXT_TO_XML) -d book -o $@+ $< && \ |
f9dae0d3 | 369 | mv $@+ $@ |
d19fbc3c | 370 | |
530e741c JH |
371 | technical/api-index.txt: technical/api-index-skel.txt \ |
372 | technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS)) | |
ee7ec2f9 | 373 | $(QUIET_GEN)cd technical && '$(SHELL_PATH_SQ)' ./api-index.sh |
530e741c | 374 | |
fe77b416 | 375 | technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../ |
fdb04244 | 376 | $(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt asciidoc.conf |
da8a3664 | 377 | $(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt |
530e741c | 378 | |
049e64aa | 379 | SubmittingPatches.txt: SubmittingPatches |
380 | $(QUIET_GEN) cp $< $@ | |
381 | ||
1cffddd6 | 382 | XSLT = docbook.xsl |
0a3985dc | 383 | XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css |
1c95c565 | 384 | |
f2aff316 | 385 | user-manual.html: user-manual.xml $(XSLT) |
f9dae0d3 JN |
386 | $(QUIET_XSLTPROC)$(RM) $@+ $@ && \ |
387 | xsltproc $(XSLTOPTS) -o $@+ $(XSLT) $< && \ | |
388 | mv $@+ $@ | |
d19fbc3c | 389 | |
50b3555c | 390 | git.info: user-manual.texi |
bb230097 | 391 | $(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi |
5cefc33b | 392 | |
50b3555c | 393 | user-manual.texi: user-manual.xml |
bb230097 | 394 | $(QUIET_DB2TEXI)$(RM) $@+ $@ && \ |
c6a5ad21 CJ |
395 | $(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@++ && \ |
396 | $(PERL_PATH) fix-texi.perl <$@++ >$@+ && \ | |
397 | rm $@++ && \ | |
5cefc33b JH |
398 | mv $@+ $@ |
399 | ||
a325a1a7 | 400 | user-manual.pdf: user-manual.xml |
bb230097 | 401 | $(QUIET_DBLATEX)$(RM) $@+ $@ && \ |
ae4e3e8d | 402 | $(DBLATEX) -o $@+ $(DBLATEX_COMMON) $< && \ |
a325a1a7 MV |
403 | mv $@+ $@ |
404 | ||
95e5efc6 | 405 | gitman.texi: $(MAN_XML) cat-texi.perl texi.xsl |
bb230097 | 406 | $(QUIET_DB2TEXI)$(RM) $@+ $@ && \ |
95e5efc6 | 407 | ($(foreach xml,$(sort $(MAN_XML)),xsltproc -o $(xml)+ texi.xsl $(xml) && \ |
408 | $(DOCBOOK2X_TEXI) --encoding=UTF-8 --to-stdout $(xml)+ && \ | |
409 | rm $(xml)+ &&) true) > $@++ && \ | |
c6a5ad21 CJ |
410 | $(PERL_PATH) cat-texi.perl $@ <$@++ >$@+ && \ |
411 | rm $@++ && \ | |
5cefc33b JH |
412 | mv $@+ $@ |
413 | ||
414 | gitman.info: gitman.texi | |
bb230097 | 415 | $(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi |
5cefc33b JH |
416 | |
417 | $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml | |
bb230097 CJ |
418 | $(QUIET_DB2TEXI)$(RM) $@+ $@ && \ |
419 | $(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \ | |
5cefc33b | 420 | mv $@+ $@ |
4739809c | 421 | |
e6fc2346 | 422 | howto-index.txt: howto-index.sh $(wildcard howto/*.txt) |
bb230097 | 423 | $(QUIET_GEN)$(RM) $@+ $@ && \ |
854dfda8 | 424 | '$(SHELL_PATH_SQ)' ./howto-index.sh $(sort $(wildcard howto/*.txt)) >$@+ && \ |
e6fc2346 JH |
425 | mv $@+ $@ |
426 | ||
8db9307c | 427 | $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt |
da8a3664 | 428 | $(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt |
e6fc2346 JH |
429 | |
430 | WEBDOC_DEST = /pub/software/scm/git/docs | |
431 | ||
fe77b416 | 432 | howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../ |
8d0991d7 | 433 | $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt |
bb230097 | 434 | $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ |
7d61547d | 435 | sed -e '1,/^$$/d' $< | \ |
da8a3664 | 436 | $(TXT_TO_HTML) - >$@+ && \ |
8d0991d7 JH |
437 | mv $@+ $@ |
438 | ||
e6fc2346 | 439 | install-webdoc : html |
ee7ec2f9 | 440 | '$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST) |
6538d1ef | 441 | |
2de9b711 TA |
442 | # You must have a clone of 'git-htmldocs' and 'git-manpages' repositories |
443 | # next to the 'git' repository itself for the following to work. | |
fcbebfdd | 444 | |
b1a46b70 MH |
445 | quick-install: quick-install-man |
446 | ||
fcbebfdd JH |
447 | require-manrepo:: |
448 | @if test ! -d $(MAN_REPO); \ | |
449 | then echo "git-manpages repository must exist at $(MAN_REPO)"; exit 1; fi | |
450 | ||
451 | quick-install-man: require-manrepo | |
65289e9d | 452 | '$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(MAN_REPO) $(DESTDIR)$(mandir) $(GIT_MAN_REF) |
fcbebfdd JH |
453 | |
454 | require-htmlrepo:: | |
455 | @if test ! -d $(HTML_REPO); \ | |
456 | then echo "git-htmldocs repository must exist at $(HTML_REPO)"; exit 1; fi | |
7b8a74f3 | 457 | |
fcbebfdd | 458 | quick-install-html: require-htmlrepo |
65289e9d | 459 | '$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REPO) $(DESTDIR)$(htmldir) $(GIT_MAN_REF) |
6fe570de | 460 | |
5fafce0b JK |
461 | print-man1: |
462 | @for i in $(MAN1_TXT); do echo $$i; done | |
463 | ||
ab81411c JH |
464 | lint-docs:: |
465 | $(QUIET_LINT)$(PERL_PATH) lint-gitlink.perl | |
466 | ||
3d5b568f JNA |
467 | ifeq ($(wildcard po/Makefile),po/Makefile) |
468 | doc-l10n install-l10n:: | |
469 | $(MAKE) -C po $@ | |
470 | endif | |
471 | ||
13fca9f3 | 472 | .PHONY: FORCE |