]> git.ipfire.org Git - thirdparty/man-pages.git/blob - Makefile
Many pages: Add '\" t' comment where necessary
[thirdparty/man-pages.git] / Makefile
1 ########################################################################
2 # Copyright (C) 2021, 2022 Alejandro Colomar <alx@kernel.org>
3 # SPDX-License-Identifier: GPL-2.0 OR LGPL-2.0
4 ########################################################################
5 # Conventions:
6 #
7 # - Follow "Makefile Conventions" from the "GNU Coding Standards" closely.
8 # However, when something could be improved, don't follow those.
9 # - Uppercase variables, when referring files, refer to files in this repo.
10 # - Lowercase variables, when referring files, refer to system files.
11 # - Lowercase variables starting with '_' refer to absolute paths,
12 # including $(DESTDIR).
13 # - Uppercase variables starting with '_' refer to temporary files produced
14 # in $builddir.
15 # - Variables ending with '_' refer to a subdir of their parent dir, which
16 # is in a variable of the same name but without the '_'. The subdir is
17 # named after this project: <*/man>.
18 # - Variables ending in '_rm' refer to files that can be removed (exist).
19 # - Variables ending in '_rmdir' refer to dirs that can be removed (exist).
20 # - Targets of the form '%-rm' remove their corresponding file '%'.
21 # - Targets of the form '%/.-rmdir' remove their corresponding dir '%/'.
22 # - Targets of the form '%/.' create their corresponding directory '%/'.
23 # - Every file or directory to be created depends on its parent directory.
24 # This avoids race conditions caused by `mkdir -p`. Only the root
25 # directories are created with parents.
26 # - The 'FORCE' target is used to make phony some variables that can't be
27 # .PHONY to avoid some optimizations.
28 #
29 ########################################################################
30
31 SHELL := /usr/bin/env bash -Eeuo pipefail
32
33
34 MAKEFLAGS += --no-builtin-rules
35 MAKEFLAGS += --no-builtin-variables
36 MAKEFLAGS += --no-print-directory
37 MAKEFLAGS += --warn-undefined-variables
38
39
40 srcdir := .
41
42
43 .PHONY: all
44 all: build
45 @:
46
47 .PHONY: help
48 help:
49 $(info Targets:)
50 $(info )
51 $(info all Alias for "build")
52 $(info )
53 $(info clean Remove $$(builddir))
54 $(info )
55 $(info build Alias for "build-html")
56 $(info )
57 $(info build-html Build HTML manual pages)
58 $(info html Alias for "build-html")
59 $(info )
60 $(info build-src Alias for "build-src-ld")
61 $(info build-src-c Extract C programs from EXAMPLES)
62 $(info build-src-cc Compile C programs from EXAMPLES)
63 $(info build-src-ld Link C programs from EXAMPLES)
64 $(info )
65 $(info lint Wrapper for "lint-c lint-man")
66 $(info lint-c Wrapper for lint-c-* targets)
67 $(info lint-c-checkpatch Lint C programs from EXAMPLES with checkpatch(1))
68 $(info lint-c-clang-tidy Lint C programs from EXAMPLES with clang-tidy(1))
69 $(info lint-c-cpplint Lint C programs from EXAMPLES with cpplint(1))
70 $(info lint-c-iwyu Lint C programs from EXAMPLES with iwyu(1))
71 $(info lint-man Wrapper for lint-man-* targets)
72 $(info lint-man-groff Lint man pages with groff(1))
73 $(info lint-man-mandoc Lint man pages with mandoc(1))
74 $(info lint-man-tbl Lint man pages about '\" t' comment for tbl(1))
75 $(info )
76 $(info [un]install Alias for "[un]install-man")
77 $(info [un]install-man Wrapper for [un]install-man* targets)
78 $(info [un]install-man1 [Un]install man pages in section 1)
79 $(info [un]install-man2 [Un]install man pages in section 2)
80 $(info [un]install-man2type [Un]install man pages in section 2type)
81 $(info [un]install-man3 [Un]install man pages in section 3)
82 $(info [un]install-man3const [Un]install man pages in section 3const)
83 $(info [un]install-man3head [Un]install man pages in section 3head)
84 $(info [un]install-man3type [Un]install man pages in section 3type)
85 $(info [un]install-man4 [Un]install man pages in section 4)
86 $(info [un]install-man5 [Un]install man pages in section 5)
87 $(info [un]install-man6 [Un]install man pages in section 6)
88 $(info [un]install-man7 [Un]install man pages in section 7)
89 $(info [un]install-man8 [Un]install man pages in section 8)
90 $(info )
91 $(info [un]install-html [Un]install HTML manual pages)
92 $(info )
93 $(info dist Wrapper for dist-* targets)
94 $(info dist-tar Create a tarball of the repository)
95 $(info dist-gz Create a compressed tarball (.tar.gz))
96 $(info dist-xz Create a compressed tarball (.tar.xz))
97 $(info )
98 $(info help Print this help)
99 $(info )
100 $(info Variables:)
101 $(info )
102 $(info V Define to non-empty string for verbose output)
103
104
105 .SECONDEXPANSION:
106
107
108 include $(srcdir)/lib/build.mk
109 include $(srcdir)/lib/build-html.mk
110 include $(srcdir)/lib/build-src.mk
111 include $(srcdir)/lib/dist.mk
112 include $(srcdir)/lib/install.mk
113 include $(srcdir)/lib/install-html.mk
114 include $(srcdir)/lib/install-man.mk
115 include $(srcdir)/lib/lint.mk
116 include $(srcdir)/lib/lint-c.mk
117 include $(srcdir)/lib/lint-man.mk
118 include $(srcdir)/lib/verbose.mk
119
120
121 FORCE: