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