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