1 ########################################################################
2 # Copyright (C) 2021, 2022 Alejandro Colomar <alx@kernel.org>
3 # SPDX-License-Identifier: GPL-2.0 OR LGPL-2.0
4 ########################################################################
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
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.
29 ########################################################################
31 SHELL
:= /usr
/bin
/env bash
-Eeuo pipefail
34 MAKEFLAGS
+= --no-builtin-rules
35 MAKEFLAGS
+= --no-builtin-variables
36 MAKEFLAGS
+= --no-print-directory
37 MAKEFLAGS
+= --warn-undefined-variables
51 $(info all Alias for
"build")
53 $(info clean Remove
$$(builddir
))
55 $(info build Alias for
"build-html")
57 $(info build-html Build HTML manual pages
)
58 $(info html Alias for
"build-html")
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
)
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-cppcheck Lint C programs from EXAMPLES with cppcheck
(1))
70 $(info lint-c-cpplint Lint C programs from EXAMPLES with cpplint
(1))
71 $(info lint-c-iwyu Lint C programs from EXAMPLES with iwyu
(1))
72 $(info lint-man Wrapper for lint-man-
* targets
)
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 lint-man-groff Alias for
"lint-man-groff-grep")
76 $(info lint-man-groff-preconv Lint man pages with preconv
(1))
77 $(info lint-man-groff-tbl Lint man pages with tbl
(1))
78 $(info lint-man-groff-eqn Lint man pages with eqn
(1))
79 $(info lint-man-groff-troff Lint man pages with troff
(1))
80 $(info lint-man-groff-grotty Lint man pages with grotty
(1))
81 $(info lint-man-groff-col Lint man pages with col
(1))
82 $(info lint-man-groff-grep Lint man pages with grep
(1))
84 $(info [un
]install Alias for
"[un]install-man")
85 $(info [un
]install-man Wrapper for
[un
]install-man
* targets
)
86 $(info [un
]install-man1
[Un
]install man pages in section
1)
87 $(info [un
]install-man2
[Un
]install man pages in section
2)
88 $(info [un
]install-man2type
[Un
]install man pages in section
2type
)
89 $(info [un
]install-man3
[Un
]install man pages in section
3)
90 $(info [un
]install-man3const
[Un
]install man pages in section
3const
)
91 $(info [un
]install-man3head
[Un
]install man pages in section
3head
)
92 $(info [un
]install-man3type
[Un
]install man pages in section
3type
)
93 $(info [un
]install-man4
[Un
]install man pages in section
4)
94 $(info [un
]install-man5
[Un
]install man pages in section
5)
95 $(info [un
]install-man6
[Un
]install man pages in section
6)
96 $(info [un
]install-man7
[Un
]install man pages in section
7)
97 $(info [un
]install-man8
[Un
]install man pages in section
8)
99 $(info [un
]install-html
[Un
]install HTML manual pages
)
101 $(info dist Wrapper for dist-
* targets
)
102 $(info dist-tar Create a tarball of the repository
)
103 $(info dist-gz Create a compressed tarball
(.
tar.gz
))
104 $(info dist-xz Create a compressed tarball
(.
tar.xz
))
106 $(info help Print this help
)
110 $(info V Define to non-empty string for verbose output
)
116 include $(srcdir)/lib
/build.mk
117 include $(srcdir)/lib
/build-html.mk
118 include $(srcdir)/lib
/build-src.mk
119 include $(srcdir)/lib
/dist.mk
120 include $(srcdir)/lib
/install.mk
121 include $(srcdir)/lib
/install-html.mk
122 include $(srcdir)/lib
/install-man.mk
123 include $(srcdir)/lib
/lint.mk
124 include $(srcdir)/lib
/lint-c.mk
125 include $(srcdir)/lib
/lint-man.mk
126 include $(srcdir)/lib
/verbose.mk