]> git.ipfire.org Git - thirdparty/man-pages.git/blame - Makefile
epoll_create.2: HISTORYise "max_user_instances" EMFILE
[thirdparty/man-pages.git] / Makefile
CommitLineData
336ae0d2 1########################################################################
dfd35089
AC
2# Copyright 2021-2022, Alejandro Colomar <alx@kernel.org>
3# SPDX-License-Identifier: GPL-3.0-or-later
336ae0d2
AC
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.
179d5a07 9# - Uppercase variables, when referring files, refer to files in this repo.
336ae0d2 10# - Lowercase variables, when referring files, refer to system files.
179d5a07
AC
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.
336ae0d2
AC
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).
336ae0d2 19# - Targets of the form '%-rm' remove their corresponding file '%'.
336ae0d2
AC
20#
21########################################################################
22
26061fbd 23SHELL := /usr/bin/env bash -Eeuo pipefail
a82aaca1
AC
24
25
e1ebd693
AC
26MAKEFLAGS += --no-builtin-rules
27MAKEFLAGS += --no-builtin-variables
336ae0d2
AC
28MAKEFLAGS += --warn-undefined-variables
29
30
edaa12e6
AC
31srcdir := .
32DATAROOTDIR := $(srcdir)/share
33MAKEFILEDIR := $(DATAROOTDIR)/mk
179d5a07 34
ece893c0 35
e8116fad 36.PHONY: all
a28ddbed 37all: build;
77160b72
AC
38
39.PHONY: help
40help:
41 $(info all Alias for "build")
42 $(info )
43 $(info clean Remove $$(builddir))
44 $(info )
851b01cf 45 $(info build Wrapper for build-* targets)
aa344d4b 46 $(info )
6d6e7065
AC
47 $(info build-pre Preprocess man pages; alias for "build-pre-tbl")
48 $(info build-pre-preconv Preprocess man pages with preconv(1))
49 $(info build-pre-tbl Preprocess man pages with tbl(1))
50 $(info )
aa344d4b 51 $(info build-catman Build cat pages; alias for "build-catman-grotty")
aa344d4b 52 $(info build-catman-eqn eqn(1) step of "build-catman")
3c8198d1
AC
53 $(info build-catman-troff Wrapper for build-catman-troff-* targets)
54 $(info build-catman-troff-man troff(1) step of "build-catman" for man(7) pages)
55 $(info build-catman-troff-mdoc troff(1) step of "build-catman" for mdoc(7) pages)
aa344d4b 56 $(info build-catman-grotty grotty(1) step of "build-catman")
77160b72
AC
57 $(info )
58 $(info build-html Build HTML manual pages)
59 $(info html Alias for "build-html")
60 $(info )
851b01cf
AC
61 $(info build-pdf Build PDF manual pages; alias for "build-pdf-grops")
62 $(info build-pdf-eqn eqn(1) step of "build-pdf")
63 $(info build-pdf-troff Wrapper for build-pdf-troff-* targets)
64 $(info build-pdf-troff-man troff(1) step of "build-pdf" for man(7) pages)
65 $(info build-pdf-troff-mdoc troff(1) step of "build-pdf" for mdoc(7) pages)
66 $(info build-pdf-gropdf gropdf(1) step of "build-pdf")
67 $(info )
68 $(info build-ps Build PostScript manual pages; alias for "build-ps-grops")
ae60bbe5
AC
69 $(info build-ps-eqn eqn(1) step of "build-ps")
70 $(info build-ps-troff Wrapper for build-ps-troff-* targets)
71 $(info build-ps-troff-man troff(1) step of "build-ps" for man(7) pages)
72 $(info build-ps-troff-mdoc troff(1) step of "build-ps" for mdoc(7) pages)
73 $(info build-ps-grops grops(1) step of "build-ps")
74 $(info )
77160b72
AC
75 $(info build-src Alias for "build-src-ld")
76 $(info build-src-c Extract C programs from EXAMPLES)
77 $(info build-src-cc Compile C programs from EXAMPLES)
78 $(info build-src-ld Link C programs from EXAMPLES)
79 $(info )
c76a5871 80 $(info lint Wrapper for "lint-c lint-man lint-mdoc")
77160b72
AC
81 $(info lint-c Wrapper for lint-c-* targets)
82 $(info lint-c-checkpatch Lint C programs from EXAMPLES with checkpatch(1))
83 $(info lint-c-clang-tidy Lint C programs from EXAMPLES with clang-tidy(1))
d5057f71 84 $(info lint-c-cppcheck Lint C programs from EXAMPLES with cppcheck(1))
77160b72
AC
85 $(info lint-c-cpplint Lint C programs from EXAMPLES with cpplint(1))
86 $(info lint-c-iwyu Lint C programs from EXAMPLES with iwyu(1))
87 $(info lint-man Wrapper for lint-man-* targets)
c76a5871
AC
88 $(info lint-man-mandoc Lint man(7) pages with mandoc(1))
89 $(info lint-man-tbl Lint man(7) pages about '\" t' comment for tbl(1))
90 $(info lint-mdoc Wrapper for lint-mdoc-* targets)
91 $(info lint-mdoc-mandoc Lint mdoc(7) pages with mandoc(1))
aa344d4b
AC
92 $(info )
93 $(info check Alias for "check-catman")
94 $(info check-catman Check cat pages; alias for "check-catman-grep")
95 $(info check-catman-col Filter cat pages with col(1))
96 $(info check-catman-grep Check cat pages with grep(1))
77160b72
AC
97 $(info )
98 $(info [un]install Alias for "[un]install-man")
99 $(info [un]install-man Wrapper for [un]install-man* targets)
77160b72
AC
100 $(info [un]install-man1 [Un]install man pages in section 1)
101 $(info [un]install-man2 [Un]install man pages in section 2)
451a27a7 102 $(info [un]install-man2type [Un]install man pages in section 2type)
77160b72 103 $(info [un]install-man3 [Un]install man pages in section 3)
23461f53 104 $(info [un]install-man3const [Un]install man pages in section 3const)
5f836211 105 $(info [un]install-man3head [Un]install man pages in section 3head)
451a27a7 106 $(info [un]install-man3type [Un]install man pages in section 3type)
77160b72
AC
107 $(info [un]install-man4 [Un]install man pages in section 4)
108 $(info [un]install-man5 [Un]install man pages in section 5)
109 $(info [un]install-man6 [Un]install man pages in section 6)
110 $(info [un]install-man7 [Un]install man pages in section 7)
111 $(info [un]install-man8 [Un]install man pages in section 8)
112 $(info )
113 $(info [un]install-html [Un]install HTML manual pages)
114 $(info )
115 $(info dist Wrapper for dist-* targets)
116 $(info dist-tar Create a tarball of the repository)
e5b23b9c 117 $(info dist-bz2 Create a compressed tarball (.tar.bz2))
77160b72 118 $(info dist-gz Create a compressed tarball (.tar.gz))
69ad9598 119 $(info dist-lz Create a compressed tarball (.tar.lz))
77160b72
AC
120 $(info dist-xz Create a compressed tarball (.tar.xz))
121 $(info )
77160b72 122 $(info help Print this help)
67950cc6 123 $(info help-variables Print all variables available, and their default values)
34caa7cd 124 $(info )
34caa7cd 125
e8116fad 126
336ae0d2 127.SECONDEXPANSION:
336ae0d2
AC
128
129
edaa12e6
AC
130include $(MAKEFILEDIR)/check/_.mk
131include $(MAKEFILEDIR)/check/catman.mk
132include $(MAKEFILEDIR)/build/_.mk
133include $(MAKEFILEDIR)/build/catman.mk
134include $(MAKEFILEDIR)/build/html.mk
851b01cf 135include $(MAKEFILEDIR)/build/pdf.mk
6d6e7065 136include $(MAKEFILEDIR)/build/pre.mk
ae60bbe5 137include $(MAKEFILEDIR)/build/ps.mk
edaa12e6
AC
138include $(MAKEFILEDIR)/build/src.mk
139include $(MAKEFILEDIR)/dist.mk
140include $(MAKEFILEDIR)/install/_.mk
141include $(MAKEFILEDIR)/install/html.mk
142include $(MAKEFILEDIR)/install/man.mk
143include $(MAKEFILEDIR)/lint/_.mk
144include $(MAKEFILEDIR)/lint/c.mk
c76a5871
AC
145include $(MAKEFILEDIR)/lint/man/_.mk
146include $(MAKEFILEDIR)/lint/man/man.mk
147include $(MAKEFILEDIR)/lint/man/mdoc.mk
c98d237c 148include $(MAKEFILEDIR)/make.mk
edaa12e6 149include $(MAKEFILEDIR)/verbose.mk
f60ff4d8 150
336ae0d2 151
a5918e4a 152.PHONY: help-variables
67950cc6
AC
153help-variables:
154 $(info V Define to non-empty string for verbose output)
155 $(info )
bc15c1d7 156 $(info LINK_PAGES How to install link pages. [".so", "symlink"])
db579553 157 $(info Z Install pages compressed. ["", ".bz2", ".gz", ".lz", ".xz"])
67950cc6
AC
158 $(info )
159 $(info DISTNAME $$(git describe))
160 $(info DISTVERSION /$$DISTNAME/s/man-pages-//)
161 $(info )
162 $(info # Directory variables:)
163 $(info )
7c90d7d0 164 $(info builddir .tmp)
67950cc6
AC
165 $(info DESTDIR )
166 $(info prefix /usr/local)
167 $(info mandir $$(datarootdir)/man)
168 $(info docdir $$(datarootdir)/doc)
169 $(info )
170 $(info man1dir $$(mandir)/man1)
171 $(info man2dir $$(mandir)/man2)
172 $(info man2typedir $$(mandir)/man2type)
173 $(info man3dir $$(mandir)/man3)
174 $(info man3constdir $$(mandir)/man3const)
175 $(info man3headdir $$(mandir)/man3head)
176 $(info man3typedir $$(mandir)/man3type)
177 $(info man4dir $$(mandir)/man4)
178 $(info man5dir $$(mandir)/man5)
179 $(info man6dir $$(mandir)/man6)
180 $(info man7dir $$(mandir)/man7)
181 $(info man8dir $$(mandir)/man8)
182 $(info )
183 $(info htmldir $$(docdir))
184 $(info htmlext .html)
185 $(info )
186 $(info # Command variables (and flags):)
187 $(info )
50174cce
AC
188 $(info - MANWIDTH)
189 $(info - NROFF_OUT_DEVICE)
67950cc6
AC
190 $(info PRECONV {EXTRA_,}PRECONVFLAGS)
191 $(info TBL)
192 $(info EQN {EXTRA_,}EQNFLAGS)
c9cbd326 193 $(info TROFF {EXTRA_,}TROFFFLAGS{,_MAN,_MDOC} {EXTRA_,}NROFFFLAGS)
851b01cf 194 $(info GROPDF {EXTRA_,}GROPDFFLAGS)
ae60bbe5 195 $(info GROPS {EXTRA_,}GROPSFLAGS)
67950cc6
AC
196 $(info GROTTY {EXTRA_,}GROTTYFLAGS)
197 $(info COL {EXTRA_,}COLFLAGS)
198 $(info )
67950cc6
AC
199 $(info MANDOC {EXTRA_,}MANDOCFLAGS)
200 $(info MAN2HTML {EXTRA_,}MAN2HTMLFLAGS)
201 $(info )
c2fffefb 202 $(info BZIP2 {EXTRA_,}BZIP2FLAGS)
3baab045 203 $(info CP)
67950cc6
AC
204 $(info ECHO)
205 $(info EXPR)
206 $(info FIND)
207 $(info GIT)
c2fffefb 208 $(info GZIP {EXTRA_,}GZIPFLAGS)
67950cc6
AC
209 $(info HEAD)
210 $(info LN)
211 $(info LOCALE)
c2fffefb 212 $(info LZIP {EXTRA_,}LZIPFLAGS)
67950cc6
AC
213 $(info PKGCONF)
214 $(info SED)
215 $(info SORT)
216 $(info SPONGE)
217 $(info TAC)
218 $(info TAIL)
219 $(info TAR)
220 $(info TEST)
221 $(info XARGS)
c2fffefb 222 $(info XZ {EXTRA_,}XZFLAGS)
67950cc6
AC
223 $(info )
224 $(info INSTALL)
225 $(info INSTALL_DATA)
226 $(info MKDIR)
227 $(info RM)
228 $(info )
229 $(info - {EXTRA_,}CPPFLAGS)
230 $(info CC {EXTRA_,}CFLAGS)
231 $(info LD {EXTRA_,}LDFLAGS {EXTRA_,}LDLIBS)
232 $(info )
233 $(info CHECKPATCH {EXTRA_,}CHECKPATCHFLAGS)
234 $(info CLANG-TIDY {EXTRA_,}CLANG-TIDYFLAGS)
235 $(info CPPCHECK {EXTRA_,}CPPCHECKFLAGS)
236 $(info CPPLINT {EXTRA_,}CPPLINTFLAGS)
237 $(info IWYU {EXTRA_,}IWYUFLAGS)
238 $(info )
239
240
250d9062 241.DELETE_ON_ERROR: