The third batch
[git/gitster.git] / Documentation / Makefile
blobaedfe99d1d35889aa24ed6b9085e614dbc240096
1 # Import tree-wide shared Makefile behavior and libraries
2 include ../shared.mak
4 .PHONY: FORCE
6 # Guard against environment variables
7 MAN1_TXT =
8 MAN5_TXT =
9 MAN7_TXT =
10 HOWTO_TXT =
11 DOC_DEP_TXT =
12 TECH_DOCS =
13 ARTICLES =
14 SP_ARTICLES =
15 OBSOLETE_HTML =
17 -include GIT-EXCLUDED-PROGRAMS
19 MAN1_TXT += $(filter-out \
20 $(patsubst %,%.txt,$(EXCLUDED_PROGRAMS)) \
21 $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
22 $(wildcard git-*.txt))
23 MAN1_TXT += git.txt
24 MAN1_TXT += gitk.txt
25 MAN1_TXT += gitweb.txt
26 MAN1_TXT += scalar.txt
28 # man5 / man7 guides (note: new guides should also be added to command-list.txt)
29 MAN5_TXT += gitattributes.txt
30 MAN5_TXT += gitformat-bundle.txt
31 MAN5_TXT += gitformat-chunk.txt
32 MAN5_TXT += gitformat-commit-graph.txt
33 MAN5_TXT += gitformat-index.txt
34 MAN5_TXT += gitformat-pack.txt
35 MAN5_TXT += gitformat-signature.txt
36 MAN5_TXT += githooks.txt
37 MAN5_TXT += gitignore.txt
38 MAN5_TXT += gitmailmap.txt
39 MAN5_TXT += gitmodules.txt
40 MAN5_TXT += gitprotocol-capabilities.txt
41 MAN5_TXT += gitprotocol-common.txt
42 MAN5_TXT += gitprotocol-http.txt
43 MAN5_TXT += gitprotocol-pack.txt
44 MAN5_TXT += gitprotocol-v2.txt
45 MAN5_TXT += gitrepository-layout.txt
46 MAN5_TXT += gitweb.conf.txt
48 MAN7_TXT += gitcli.txt
49 MAN7_TXT += gitcore-tutorial.txt
50 MAN7_TXT += gitcredentials.txt
51 MAN7_TXT += gitcvs-migration.txt
52 MAN7_TXT += gitdiffcore.txt
53 MAN7_TXT += giteveryday.txt
54 MAN7_TXT += gitfaq.txt
55 MAN7_TXT += gitglossary.txt
56 MAN7_TXT += gitpacking.txt
57 MAN7_TXT += gitnamespaces.txt
58 MAN7_TXT += gitremote-helpers.txt
59 MAN7_TXT += gitrevisions.txt
60 MAN7_TXT += gitsubmodules.txt
61 MAN7_TXT += gittutorial-2.txt
62 MAN7_TXT += gittutorial.txt
63 MAN7_TXT += gitworkflows.txt
65 HOWTO_TXT += $(wildcard howto/*.txt)
67 DOC_DEP_TXT += $(wildcard *.txt)
68 DOC_DEP_TXT += $(wildcard config/*.txt)
69 DOC_DEP_TXT += $(wildcard includes/*.txt)
71 ifdef MAN_FILTER
72 MAN_TXT = $(filter $(MAN_FILTER),$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))
73 else
74 MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)
75 MAN_FILTER = $(MAN_TXT)
76 endif
78 MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT))
79 MAN_HTML = $(patsubst %.txt,%.html,$(MAN_TXT))
80 GIT_MAN_REF = master
82 OBSOLETE_HTML += everyday.html
83 OBSOLETE_HTML += git-remote-helpers.html
85 ARTICLES += howto-index
86 ARTICLES += git-tools
87 ARTICLES += git-bisect-lk2009
88 # with their own formatting rules.
89 SP_ARTICLES += user-manual
90 SP_ARTICLES += howto/new-command
91 SP_ARTICLES += howto/revert-branch-rebase
92 SP_ARTICLES += howto/using-merge-subtree
93 SP_ARTICLES += howto/using-signed-tag-in-pull-request
94 SP_ARTICLES += howto/use-git-daemon
95 SP_ARTICLES += howto/update-hook-example
96 SP_ARTICLES += howto/setup-git-server-over-http
97 SP_ARTICLES += howto/separating-topic-branches
98 SP_ARTICLES += howto/revert-a-faulty-merge
99 SP_ARTICLES += howto/recover-corrupted-blob-object
100 SP_ARTICLES += howto/recover-corrupted-object-harder
101 SP_ARTICLES += howto/rebuild-from-update-hook
102 SP_ARTICLES += howto/rebase-from-internal-branch
103 SP_ARTICLES += howto/keep-canonical-history-correct
104 SP_ARTICLES += howto/maintain-git
105 SP_ARTICLES += howto/coordinate-embargoed-releases
106 API_DOCS = $(patsubst %.txt,%,$(filter-out technical/api-index-skel.txt technical/api-index.txt, $(wildcard technical/api-*.txt)))
107 SP_ARTICLES += $(API_DOCS)
109 TECH_DOCS += DecisionMaking
110 TECH_DOCS += ReviewingGuidelines
111 TECH_DOCS += MyFirstContribution
112 TECH_DOCS += MyFirstObjectWalk
113 TECH_DOCS += SubmittingPatches
114 TECH_DOCS += ToolsForGit
115 TECH_DOCS += technical/bitmap-format
116 TECH_DOCS += technical/build-systems
117 TECH_DOCS += technical/bundle-uri
118 TECH_DOCS += technical/hash-function-transition
119 TECH_DOCS += technical/long-running-process-protocol
120 TECH_DOCS += technical/multi-pack-index
121 TECH_DOCS += technical/pack-heuristics
122 TECH_DOCS += technical/parallel-checkout
123 TECH_DOCS += technical/partial-clone
124 TECH_DOCS += technical/platform-support
125 TECH_DOCS += technical/racy-git
126 TECH_DOCS += technical/reftable
127 TECH_DOCS += technical/scalar
128 TECH_DOCS += technical/send-pack-pipeline
129 TECH_DOCS += technical/shallow
130 TECH_DOCS += technical/trivial-merge
131 TECH_DOCS += technical/unit-tests
132 SP_ARTICLES += $(TECH_DOCS)
133 SP_ARTICLES += technical/api-index
135 ARTICLES_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
136 HTML_FILTER ?= $(ARTICLES_HTML) $(OBSOLETE_HTML)
137 DOC_HTML = $(MAN_HTML) $(filter $(HTML_FILTER),$(ARTICLES_HTML) $(OBSOLETE_HTML))
139 DOC_MAN1 = $(patsubst %.txt,%.1,$(filter $(MAN_FILTER),$(MAN1_TXT)))
140 DOC_MAN5 = $(patsubst %.txt,%.5,$(filter $(MAN_FILTER),$(MAN5_TXT)))
141 DOC_MAN7 = $(patsubst %.txt,%.7,$(filter $(MAN_FILTER),$(MAN7_TXT)))
143 prefix ?= $(HOME)
144 bindir ?= $(prefix)/bin
145 htmldir ?= $(prefix)/share/doc/git-doc
146 infodir ?= $(prefix)/share/info
147 pdfdir ?= $(prefix)/share/doc/git-doc
148 mandir ?= $(prefix)/share/man
149 man1dir = $(mandir)/man1
150 man5dir = $(mandir)/man5
151 man7dir = $(mandir)/man7
152 # DESTDIR =
154 ASCIIDOC = asciidoc
155 ASCIIDOC_EXTRA =
156 ASCIIDOC_HTML = xhtml11
157 ASCIIDOC_DOCBOOK = docbook
158 ASCIIDOC_CONF = -f asciidoc.conf
159 ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF)
160 ASCIIDOC_DEPS = asciidoc.conf GIT-ASCIIDOCFLAGS
161 TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML)
162 TXT_TO_XML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_DOCBOOK)
163 MANPAGE_XSL = manpage-normal.xsl
164 XMLTO = xmlto
165 XMLTO_EXTRA =
166 INSTALL ?= install
167 RM ?= rm -f
168 MAN_REPO = ../../git-manpages
169 HTML_REPO = ../../git-htmldocs
171 MAKEINFO = makeinfo
172 INSTALL_INFO = install-info
173 DOCBOOK2X_TEXI = docbook2x-texi
174 DBLATEX = dblatex
175 ASCIIDOC_DBLATEX_DIR = /etc/asciidoc/dblatex
176 DBLATEX_COMMON = -p $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.xsl -s $(ASCIIDOC_DBLATEX_DIR)/asciidoc-dblatex.sty
177 ifndef PERL_PATH
178 PERL_PATH = /usr/bin/perl
179 endif
181 -include ../config.mak.autogen
182 -include ../config.mak
184 # Set GIT_VERSION_OVERRIDE such that version_gen knows to substitute
185 # GIT_VERSION in case it was set by the user.
186 GIT_VERSION_OVERRIDE := $(GIT_VERSION)
188 ifndef NO_MAN_BOLD_LITERAL
189 XMLTO_EXTRA += -m manpage-bold-literal.xsl
190 endif
192 # Newer DocBook stylesheet emits warning cruft in the output when
193 # this is not set, and if set it shows an absolute link. Older
194 # stylesheets simply ignore this parameter.
196 # Distros may want to use MAN_BASE_URL=file:///path/to/git/docs/
197 # or similar.
198 ifndef MAN_BASE_URL
199 MAN_BASE_URL = file://$(htmldir)/
200 endif
201 XMLTO_EXTRA += --stringparam man.base.url.for.relative.links='$(MAN_BASE_URL)'
203 ifdef USE_ASCIIDOCTOR
204 ASCIIDOC = asciidoctor
205 ASCIIDOC_CONF =
206 ASCIIDOC_HTML = xhtml5
207 ASCIIDOC_DOCBOOK = docbook5
208 ASCIIDOC_EXTRA += -acompat-mode -atabsize=8
209 ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions
210 ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
211 ASCIIDOC_EXTRA += -adocinfo=shared
212 ASCIIDOC_DEPS = asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
213 DBLATEX_COMMON =
214 XMLTO_EXTRA += --skip-validation
215 XMLTO_EXTRA += -x manpage.xsl
217 asciidoctor-extensions.rb: asciidoctor-extensions.rb.in FORCE
218 $(QUIET_GEN)$(call version_gen,"$(shell pwd)/..",$<,$@)
219 else
220 asciidoc.conf: asciidoc.conf.in FORCE
221 $(QUIET_GEN)$(call version_gen,"$(shell pwd)/..",$<,$@)
222 endif
224 ASCIIDOC_DEPS += docinfo.html
226 SHELL_PATH ?= $(SHELL)
227 # Shell quote;
228 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
230 ASCIIDOC_EXTRA += -abuild_dir='$(shell pwd)'
231 ifdef DEFAULT_PAGER
232 DEFAULT_PAGER_SQ = $(subst ','\'',$(DEFAULT_PAGER))
233 ASCIIDOC_EXTRA += -a 'git-default-pager=$(DEFAULT_PAGER_SQ)'
234 endif
236 ifdef DEFAULT_EDITOR
237 DEFAULT_EDITOR_SQ = $(subst ','\'',$(DEFAULT_EDITOR))
238 ASCIIDOC_EXTRA += -a 'git-default-editor=$(DEFAULT_EDITOR_SQ)'
239 endif
241 all: html man
243 html: $(DOC_HTML)
245 man: man1 man5 man7
246 man1: $(DOC_MAN1)
247 man5: $(DOC_MAN5)
248 man7: $(DOC_MAN7)
250 info: git.info gitman.info
252 pdf: user-manual.pdf
254 install: install-man
256 install-man: man
257 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
258 $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
259 $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
260 $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
261 $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
262 $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
264 install-info: info
265 $(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
266 $(INSTALL) -m 644 git.info gitman.info $(DESTDIR)$(infodir)
267 if test -r $(DESTDIR)$(infodir)/dir; then \
268 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\
269 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) gitman.info ;\
270 else \
271 echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
274 install-pdf: pdf
275 $(INSTALL) -d -m 755 $(DESTDIR)$(pdfdir)
276 $(INSTALL) -m 644 user-manual.pdf $(DESTDIR)$(pdfdir)
278 install-html: html
279 '$(SHELL_PATH_SQ)' ./install-webdoc.sh $(DESTDIR)$(htmldir)
281 mergetools_txt = mergetools-diff.txt mergetools-merge.txt
284 # Determine "include::" file references in asciidoc files.
286 docdep_prereqs = \
287 $(mergetools_txt) \
288 cmd-list.made $(cmds_txt)
290 doc.dep : $(docdep_prereqs) $(DOC_DEP_TXT) build-docdep.perl
291 $(QUIET_GEN)$(PERL_PATH) ./build-docdep.perl "$(shell pwd)" >$@ $(QUIET_STDERR)
293 ifneq ($(MAKECMDGOALS),clean)
294 -include doc.dep
295 endif
297 cmds_txt = cmds-ancillaryinterrogators.txt \
298 cmds-ancillarymanipulators.txt \
299 cmds-mainporcelain.txt \
300 cmds-plumbinginterrogators.txt \
301 cmds-plumbingmanipulators.txt \
302 cmds-synchingrepositories.txt \
303 cmds-synchelpers.txt \
304 cmds-guide.txt \
305 cmds-developerinterfaces.txt \
306 cmds-userinterfaces.txt \
307 cmds-purehelpers.txt \
308 cmds-foreignscminterface.txt
310 $(cmds_txt): cmd-list.made
312 cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
313 $(QUIET_GEN)$(PERL_PATH) ./cmd-list.perl .. . $(cmds_txt) && \
314 date >$@
316 mergetools-%.txt: generate-mergetool-list.sh ../git-mergetool--lib.sh $(wildcard ../mergetools/*)
317 mergetools-diff.txt:
318 $(QUIET_GEN)$(SHELL_PATH) ./generate-mergetool-list.sh .. diff $@
319 mergetools-merge.txt:
320 $(QUIET_GEN)$(SHELL_PATH) ./generate-mergetool-list.sh .. merge $@
322 TRACK_ASCIIDOCFLAGS = $(subst ','\'',$(ASCIIDOC_COMMON):$(ASCIIDOC_HTML):$(ASCIIDOC_DOCBOOK))
324 GIT-ASCIIDOCFLAGS: FORCE
325 @FLAGS='$(TRACK_ASCIIDOCFLAGS)'; \
326 if test x"$$FLAGS" != x"`cat GIT-ASCIIDOCFLAGS 2>/dev/null`" ; then \
327 echo >&2 " * new asciidoc flags"; \
328 echo "$$FLAGS" >GIT-ASCIIDOCFLAGS; \
331 clean:
332 $(RM) -rf .build/
333 $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
334 $(RM) *.texi *.texi+ *.texi++ git.info gitman.info
335 $(RM) *.pdf
336 $(RM) howto-index.txt howto/*.html doc.dep
337 $(RM) technical/*.html technical/api-index.txt
338 $(RM) SubmittingPatches.txt
339 $(RM) $(cmds_txt) $(mergetools_txt) *.made
340 $(RM) GIT-ASCIIDOCFLAGS
341 $(RM) asciidoc.conf asciidoctor-extensions.rb
342 $(RM) -rf tmp-meson-diff
344 docinfo.html: docinfo-html.in
345 $(QUIET_GEN)$(RM) $@ && cat $< >$@
347 $(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS)
348 $(QUIET_ASCIIDOC)$(TXT_TO_HTML) -d manpage -o $@ $<
350 $(OBSOLETE_HTML): %.html : %.txto $(ASCIIDOC_DEPS)
351 $(QUIET_ASCIIDOC)$(TXT_TO_HTML) -o $@ $<
353 manpage-prereqs := $(wildcard manpage*.xsl)
354 manpage-cmd = $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
356 %.1 : %.xml $(manpage-prereqs)
357 $(manpage-cmd)
358 %.5 : %.xml $(manpage-prereqs)
359 $(manpage-cmd)
360 %.7 : %.xml $(manpage-prereqs)
361 $(manpage-cmd)
363 %.xml : %.txt $(ASCIIDOC_DEPS)
364 $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $<
366 user-manual.xml: user-manual.txt $(ASCIIDOC_DEPS)
367 $(QUIET_ASCIIDOC)$(TXT_TO_XML) -d book -o $@ $<
369 technical/api-index.txt: technical/api-index-skel.txt \
370 technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
371 $(QUIET_GEN)'$(SHELL_PATH_SQ)' technical/api-index.sh ./technical ./technical/api-index.txt
373 technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
374 $(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt \
375 $(ASCIIDOC_DEPS)
376 $(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
378 SubmittingPatches.txt: SubmittingPatches
379 $(QUIET_GEN) cp $< $@
381 XSLT = docbook.xsl
382 XSLTOPTS =
383 XSLTOPTS += --xinclude
384 XSLTOPTS += --stringparam html.stylesheet docbook-xsl.css
385 XSLTOPTS += --param generate.consistent.ids 1
387 user-manual.html: user-manual.xml $(XSLT)
388 $(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
390 git.info: user-manual.texi
391 $(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi
393 user-manual.texi: user-manual.xml
394 $(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@+ && \
395 $(PERL_PATH) fix-texi.perl <$@+ >$@ && \
396 $(RM) $@+
398 user-manual.pdf: user-manual.xml
399 $(QUIET_DBLATEX)$(DBLATEX) -o $@ $(DBLATEX_COMMON) $<
401 gitman.texi: $(MAN_XML) cat-texi.perl texi.xsl
402 $(QUIET_DB2TEXI) \
403 ($(foreach xml,$(sort $(MAN_XML)),xsltproc -o $(xml)+ texi.xsl $(xml) && \
404 $(DOCBOOK2X_TEXI) --encoding=UTF-8 --to-stdout $(xml)+ && \
405 $(RM) $(xml)+ &&) true) > $@+ && \
406 $(PERL_PATH) cat-texi.perl $@ <$@+ >$@ && \
407 $(RM) $@+
409 gitman.info: gitman.texi
410 $(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $<
412 $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
413 $(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@
415 howto-index.txt: howto/howto-index.sh $(HOWTO_TXT)
416 $(QUIET_GEN)'$(SHELL_PATH_SQ)' ./howto/howto-index.sh $(sort $(HOWTO_TXT)) >$@
418 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt $(ASCIIDOC_DEPS)
419 $(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
421 WEBDOC_DEST = /pub/software/scm/git/docs
423 howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
424 $(patsubst %.txt,%.html,$(HOWTO_TXT)): %.html : %.txt $(ASCIIDOC_DEPS)
425 $(QUIET_ASCIIDOC) \
426 sed -e '1,/^$$/d' $< | \
427 $(TXT_TO_HTML) - >$@
429 install-webdoc : html
430 '$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST)
432 # You must have a clone of 'git-htmldocs' and 'git-manpages' repositories
433 # next to the 'git' repository itself for the following to work.
435 quick-install: quick-install-man
437 require-manrepo::
438 @if test ! -d $(MAN_REPO); \
439 then echo "git-manpages repository must exist at $(MAN_REPO)"; exit 1; fi
441 quick-install-man: require-manrepo
442 '$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(MAN_REPO) $(DESTDIR)$(mandir) $(GIT_MAN_REF)
444 require-htmlrepo::
445 @if test ! -d $(HTML_REPO); \
446 then echo "git-htmldocs repository must exist at $(HTML_REPO)"; exit 1; fi
448 quick-install-html: require-htmlrepo
449 '$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REPO) $(DESTDIR)$(htmldir) $(GIT_MAN_REF)
451 print-man1:
452 @for i in $(MAN1_TXT); do echo $$i; done
454 ## Lint: gitlink
455 LINT_DOCS_GITLINK = $(patsubst %.txt,.build/lint-docs/gitlink/%.ok,$(HOWTO_TXT) $(DOC_DEP_TXT))
456 $(LINT_DOCS_GITLINK): lint-gitlink.perl
457 $(LINT_DOCS_GITLINK): .build/lint-docs/gitlink/%.ok: %.txt
458 $(call mkdir_p_parent_template)
459 $(QUIET_LINT_GITLINK)$(PERL_PATH) lint-gitlink.perl \
460 $< \
461 $(HOWTO_TXT) $(DOC_DEP_TXT) \
462 --section=1 $(MAN1_TXT) \
463 --section=5 $(MAN5_TXT) \
464 --section=7 $(MAN7_TXT) >$@
465 .PHONY: lint-docs-gitlink
466 lint-docs-gitlink: $(LINT_DOCS_GITLINK)
468 ## Lint: man-end-blurb
469 LINT_DOCS_MAN_END_BLURB = $(patsubst %.txt,.build/lint-docs/man-end-blurb/%.ok,$(MAN_TXT))
470 $(LINT_DOCS_MAN_END_BLURB): lint-man-end-blurb.perl
471 $(LINT_DOCS_MAN_END_BLURB): .build/lint-docs/man-end-blurb/%.ok: %.txt
472 $(call mkdir_p_parent_template)
473 $(QUIET_LINT_MANEND)$(PERL_PATH) lint-man-end-blurb.perl $< >$@
474 .PHONY: lint-docs-man-end-blurb
476 ## Lint: man-section-order
477 LINT_DOCS_MAN_SECTION_ORDER = $(patsubst %.txt,.build/lint-docs/man-section-order/%.ok,$(MAN_TXT))
478 $(LINT_DOCS_MAN_SECTION_ORDER): lint-man-section-order.perl
479 $(LINT_DOCS_MAN_SECTION_ORDER): .build/lint-docs/man-section-order/%.ok: %.txt
480 $(call mkdir_p_parent_template)
481 $(QUIET_LINT_MANSEC)$(PERL_PATH) lint-man-section-order.perl $< >$@
482 .PHONY: lint-docs-man-section-order
483 lint-docs-man-section-order: $(LINT_DOCS_MAN_SECTION_ORDER)
485 .PHONY: lint-docs-fsck-msgids
486 LINT_DOCS_FSCK_MSGIDS = .build/lint-docs/fsck-msgids.ok
487 $(LINT_DOCS_FSCK_MSGIDS): lint-fsck-msgids.perl
488 $(LINT_DOCS_FSCK_MSGIDS): ../fsck.h fsck-msgids.txt
489 $(call mkdir_p_parent_template)
490 $(QUIET_GEN)$(PERL_PATH) lint-fsck-msgids.perl \
491 ../fsck.h fsck-msgids.txt $@
493 lint-docs-fsck-msgids: $(LINT_DOCS_FSCK_MSGIDS)
495 lint-docs-manpages:
496 $(QUIET_GEN)./lint-manpages.sh
498 .PHONY: lint-docs-meson
499 lint-docs-meson:
500 @# awk acts up when trying to match single quotes, so we use \047 instead.
501 @mkdir -p tmp-meson-diff && \
502 awk "/^manpages = {$$/ {flag=1 ; next } /^}$$/ { flag=0 } flag { gsub(/^ \047/, \"\"); gsub(/\047 : [157],\$$/, \"\"); print }" meson.build | \
503 grep -v -e '#' -e '^$$' | \
504 sort >tmp-meson-diff/meson.txt && \
505 ls git*.txt scalar.txt | grep -v -e git-bisect-lk2009.txt -e git-tools.txt >tmp-meson-diff/actual.txt && \
506 if ! cmp tmp-meson-diff/meson.txt tmp-meson-diff/actual.txt; then \
507 echo "Meson man pages differ from actual man pages:"; \
508 diff -u tmp-meson-diff/meson.txt tmp-meson-diff/actual.txt; \
509 exit 1; \
512 ## Lint: list of targets above
513 .PHONY: lint-docs
514 lint-docs: lint-docs-fsck-msgids
515 lint-docs: lint-docs-gitlink
516 lint-docs: lint-docs-man-end-blurb
517 lint-docs: lint-docs-man-section-order
518 lint-docs: lint-docs-manpages
519 lint-docs: lint-docs-meson
521 ifeq ($(wildcard po/Makefile),po/Makefile)
522 doc-l10n install-l10n::
523 $(MAKE) -C po $@
524 endif
526 .PHONY: FORCE