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