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