| Age | Commit message (Collapse) | Author | Files | Lines |
|
It's known that echo(1) doesn't expand anything. No need to warn.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Also remove it from "share/mk/build/catman/troff.xfail", as it doesn't
fail anymore.
Suggested-by: "G. Branden Robinson" <branden@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This is too common, and I don't see a solution in many cases.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
pcre2grep(1) doesn't have a -T flag, so we need to script a bit to do
something similar.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Write poems, not prose.
This only catches the most obvious issues, but at least that's
something.
We need pcre2grep(3) because it allows multiple patterns, whereas
grep(1) in -P mode only accepts one.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This will be used for adding diagnostics about semantic newlines.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Clang doesn't know [[gnu::nonnull]].
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Within recipes, variables have delayed expansion, which means that we
can't use variables that we've undefined. That's why we need to use
a filter to get the regex file name from the rule prerequisites. This
trick was suggested by Philip.
Cc: Philip Guenther <guenther@gmail.com>
Cc: Paul Smith <psmith@gnu.org>
Cc: Martin Dorey <Martin.Dorey@hitachivantara.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This reduces differences between makefiles, and also makes each makefile
specify the file extension only once, which reduces mistakes.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This is so that adding or removing an exception doesn't trigger a
rebuild of the entire project.
This also makes the different files more similar, which reduces
maintenance work.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This simplifies the Makefile by de-duplicating code, and at the same
time verifies that the autodetection of the language works well.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
groff's CHECKSTYLE already warns about this, but it's imperfect, and it
doesn't work with mdoc(7). This linter is simpler, and works better.
Suggested-by: "G. Branden Robinson" <branden@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
I don't know when this was exacly broken, since we didn't have such
pages until now.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Scripted change:
$ grep -rl 'The authors of the Linux man-pages' \
| xargs sed -i '/Copyright, The authors of the Linux man-pages project/s/The/the/';
Reported-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
- Rename the file CREDITS => AUTHORS
- Say 'authors' in the copyright notice. Scripted change:
$ grep -rn 'The contributors to the Linux man-pages' -l \
| xargs sed -i '/Copyright, The contributors to the Linux man-pages project/s/contributors to/authors of/'
Suggested-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: "G. Branden Robinson" <branden@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Link: <https://lore.kernel.org/linux-man/jpin2dbnp5vpitnh7l4qmvkamzq3h3xljzsznrudgioox3nn72@57uybxbe3h4p/T/#u>
Link: <https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects>
Cc: "G. Branden Robinson" <branden@debian.org>
Cc: Carlos O'Donell <carlos@redhat.com>
Cc: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
"cannot adjust line", which is due to the long URI added to See also.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
We need to escape the # for old versions of make(1). However, new
versions of grep(1) diagnose if it receives an escaped #. To keep both
make(1) and grep(1) happy in both their old and new versions, we need to
take advantage of # not being a comment in bash(1) when not preceeded by
a space, and also of \# being translated into # by bash(1).
alx@debian:~$ echo ''\#
#
alx@debian:~$ echo ''#
#
Fixes: 76f12e3fd3ea (2025-02-10; "share/mk/: Escape '#' in regexes")
Reported-by: Sergei Trofimovich <slyich@gmail.com>
Cc: Florian Weimer <fw@deneb.enyo.de>
Cc: Boris Pigin <boris.pigin@gmail.com>
Suggested-by: Jakub Wilk <jwilk@jwilk.net>
References: <20250227162800.36exbwmqky6d7z4t@jwilk.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
The semantics of '?=' are similar to those of '=', but we need simple
assignment as if ':=', so we can't use '?='. In the future, we'll be
able to use '?:='. For now, let's use ifndef.
Fixes: 0d69e51cd4b8 (2025-02-10; "share/mk/: Use ?= assignments for user-facing variables")
Link: <https://lore.kernel.org/linux-man/378a2eba-c973-4de9-a362-6e25123bf75b@systematicsw.ab.ca/T/#m3be93ab6b875569178981b034b4a874632db2fa9>
Reported-by: Brian Inglis <brian.inglis@systematicsw.ab.ca>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This allows users specifying them as environment variables.
Cc: Sam James <sam@gentoo.org>
Cc: Paul Smith <psmith@gnu.org>
Cc: Guenther Noack <gnoack@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
GNU make(1) 4.2 seems to be interpreting those characters as the start
of a comment, so we need to escape them. That seems to calm those old
versions of make(1), and doesn't affect negatively the newer ones, and
doesn't affect negatively grep(1) either.
Fixes: 35a780a99bd8 (2024-07-20; "share/mk/: CPPFLAGS: Only define _FORTIFY_SOURCE if it's not already defined")
Fixes: 2130162900ab (2024-11-03; "share/mk/, etc/shellcheck/: lint-sh: Add target to lint shell scripts")
Reported-by: Boris Pigin <boris.pigin@gmail.com>
Cc: Sam James <sam@gentoo.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
We use typeof(), which triggers that. It's now standard, so this is a
false positive, IMO.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This makes the line fit in 80 columns, and also makes it simpler to
read.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
add manual page
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Add some spaces for readability and consistency.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
The manual pages in this project had historically used the 5th argument
to TH, with the string "Linux Programmer's Manual". This was showed as
the center-top title of the pages. This was incidentally consistent
with the UNIX Programmer's Manual.
A few years ago, I removed the 5th argument to TH to use the default
string, to follow conventions. At the same time, I put the project name
and version in the 4th argument to TH: "Linux man-pages X.Y".
When we added the scripts written by Deri to produce a PDF book, the
title of the book was "The Linux Manpage Book", and the front page said
"GNU/Linux\nTHE MAN PAGES BOOK". For consistency with the project name,
I changed those some time ago to be title: "The Linux man-pages Book"
and front: "GNU/Linux\nTHE MAN-PAGES BOOK".
However, for consistency with the UNIX Programmer's Manual, and with the
old title used within the project, I'm now (partially) restoring the
title of the book and its front page to be both:
"GNU/Linux Programmer's Manual".
(It's not fully restorative, because it has GNU/Linux where the old
title had just Linux, but half of our documentation is for glibc, so I
think it's deserved.)
(I was never convinced by the old front text: why should it have the
word "book"?)
Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
Cc: "G. Branden Robinson" <branden@debian.org>
Cc: Deri James <deri@chuzzlewit.myzen.co.uk>
Cc: "Michael T. Kerrisk" <mtk.manpages@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This diagnostic is triggered by valid calls to printf(3).
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
The example program in ctime(3) triggers that diagnostic due to a
compile-time check of the signedness of time_t. The code is legitimate.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Those write(2) calls are unimportant, and we don't want to check errors.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Distros expect 'make' to build only what they need. While we want to
build more stuff upstream, for various reasons (mainly, for extra
diagnostics), packagers only want what they'll use, and don't want to
waste CPU time with that.
Also, distros expect 'make install' to only install what they'll use,
which is just the manual pages.
For that, repurpose the build and install targets to do precisely that,
and add build-all and install-all targets that do all that can be done.
Reported-by: Sam James <sam@gentoo.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Cherry-picked-from: liba2i.git 791f163b1a72 (2024-07-18, "share/mk/: Reduce the work of 'make && make install'")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Some distros patch GCC to have that definition built in. Redefining it
ourselves would result in a redefinition, and consequently a diagnostic.
Reported-by: Sam James <sam@gentoo.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Cherry-picked-from: liba2i.git 31bfd8f14a11 (2024-07-17, "share/mk/: CPPFLAGS: Only define _FORTIFY_SOURCE if it's not already defined")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Standard behavior is that setting these variables should append, not
overwrite.
Add variables to allow overwriting, with a trailing '_'.
While at it, put CPPFLAGS after CFLAGS consistently (previously, there
was a mix).
Link: <https://lists.gnu.org/archive/html/help-make/2024-07/msg00001.html>
Reported-by: Sam James <sam@gentoo.org>
Reported-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Suggested-by: Sébastien Hinderer <Sebastien.Hinderer@inria.fr>
Suggested-by: Paul Smith <psmith@gnu.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Cherry-picked-from: liba2i.git 5613b2846104 (2024-07-16, "share/mk/, share/tests/: Refactor *FLAGS and LDLIBS variables")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Cherry-picked-from: liba2i.git 828dd1d21b30 (2024-07-15, "share/mk/: CPPFLAGS: -D_FORTIFY_SOURCE=2")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
EX/EE can't be nested within nf/ni. The mandoc(1) reports weren't
spurious.
Re-enable the mandoc(1) warnings, and fix the code.
Fixes: 31203a0c8dbf ("share/mk/: Globally disable two spurious mandoc(1) warnings")
Link: <https://lists.gnu.org/archive/html/groff/2024-06/msg00019.html>
Reported-by: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
Cc: "G. Branden Robinson" <branden@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
And remove them from XFAIL, since they don't fail anymore.
Reported-by: mandoc(1) (`make lint-man-mandoc`)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
And remove the XFAIL exceptions that were triggering these warnings.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
We purposefully point to groff_man(7), which is not in this project.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Cc: Adam Sampson <ats@offog.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This simplifies some code, and is also in preparation for the following
commit, which will add more linting operations on both types of manual
pages.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
We'll need it for checking the .so link pages.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Due to missing 'U' suffixes in UAPI constants.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
$ make lint-man-mandoc
MANDOC .tmp/man/man2/ioctl_eventpoll.2.lint-man.mandoc.touch
mandoc: .tmp/man/man2/ioctl_eventpoll.2:25:2: STYLE: fill mode already disabled, skipping: EX
mandoc: .tmp/man/man2/ioctl_eventpoll.2:35:2: STYLE: fill mode already enabled, skipping: fi
make: *** [/home/alx/src/linux/man-pages/man-pages/contrib/share/mk/lint/man/mandoc.mk:39: .tmp/man/man2/ioctl_eventpoll.2.lint-man.mandoc.touch] Error 1
Link: <https://lists.gnu.org/archive/html/groff/2024-06/msg00010.html>
Cc: Joe Damato <jdamato@fastly.com>
Cc: "G. Branden Robinson" <branden@debian.org>
Cc: Ingo Schwarze <schwarze@openbsd.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
These are all due to long URIs, which are fine. It's just that groff
can't adjust to both margins.
Link: <https://lore.kernel.org/linux-man/y35l3wyxcjk5tsq4hd5mtqvpor577fmysaufv3gntu5uwsyzrf@wiqk4rbxkm4w/T/#t>
Reported-by: Joe Damato <jdamato@fastly.com>
Reported-by: "G. Branden Robinson" <branden@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This is the default in groff-1.23.0. However, some distros turn it on,
which silenced some warnings.
Link: <https://lore.kernel.org/linux-man/y35l3wyxcjk5tsq4hd5mtqvpor577fmysaufv3gntu5uwsyzrf@wiqk4rbxkm4w/T/#m569eab0d60420fdeac9e48bf237712f18ea91c4e>
Suggested-by: "G. Branden Robinson" <branden@debian.org>
Cc: Joe Damato <jdamato@fastly.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
The SEE ALSO section of prctl(2) is problematic. MR will fix that; for
now, let's skip the errors.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
In this project, it doesn't matter, but in some cases, it's useful that
check doesn't imply build, such as in liba2i.git. Cherry-picking this
change reduces differences in build systems.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Cherry-picked-from: liba2i.git 7246995b3464 ("share/mk/: distcheck: 'check' must be run after 'build'")
Link: <https://git.kernel.org/pub/scm/libs/liba2i/liba2i.git/>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Cherry-picked-from: liba2i.git ecc5ea650c45 ("share/mk/: $LD: Fix definition to include $CPPFLAGS")
Link: <https://git.kernel.org/pub/scm/libs/liba2i/liba2i.git/>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Link: <https://github.com/include-what-you-use/include-what-you-use/pull/1533>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This avoids warnings of the form:
...: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This is a scripted change:
$ mkdir man/;
$ mv man* man/;
$ ln -st . man/man*;
$ find share/mk/ -type f \
| xargs grep -l '^MANDIR *:=' \
| xargs sed -i '/^MANDIR *:=/s,$,/man,';
$ find share/mk/dist/ -type f \
| xargs grep -l man \
| xargs sed -i 's,man%,man/%,g';
Link: <https://lore.kernel.org/linux-man/YxcV4h+Xn7cd6+q2@pevik/T/>
Cc: Petr Vorel <pvorel@suse.cz>
Cc: Jakub Wilk <jwilk@jwilk.net>
Cc: Stefan Puiu <stefan.puiu@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
They have known warnings.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
And use a consistent name for it: TinosR, not TINOR. This removes the
last remaining huge generated file we had in the repository.
Link: <https://technicallywewrite.com/2023/09/16/addfonts>
Link: <https://www.schaffter.ca/mom/momdoc/appendices.html#fonts>
Cc: Jan Eden <tech@eden.one>
Cc: "G. Branden Robinson" <branden@debian.org>
Cc: Deri James <deri@chuzzlewit.myzen.co.uk>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This will allow generating the font description file from it, which will
be done in the next commit.
Link: <https://technicallywewrite.com/2023/09/16/addfonts>
Link: <https://www.schaffter.ca/mom/momdoc/appendices.html#fonts>
Cc: Jan Eden <tech@eden.one>
Cc: "G. Branden Robinson" <branden@debian.org>
Cc: Deri James <deri@chuzzlewit.myzen.co.uk>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Co-developed-by: Deri James <deri@chuzzlewit.myzen.co.uk>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
See gropdf(1).
Reported-by: Deri <deri@chuzzlewit.myzen.co.uk>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
So that they can be folded.
Suggested-by: Deri James <deri@chuzzlewit.myzen.co.uk>
Cc: "G. Branden Robinson" <branden@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Suggested-by: "G. Branden Robinson" <branden@debian.org>
Suggested-by: Deri James <deri@chuzzlewit.myzen.co.uk>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
'if' turns off set -e. We want to read files before 'if', so that if
they don't exist, the shell will error out.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
install(1) doesn't work well in Darwin. It seems to be unable to handle
</dev/stdin>. The problem seems to be that Darwin's stdin misbehaves.
I've only workarounded the install target, and not the dist target,
since it's unlikely that one would run it in such a broken system. But
since installing the pages is a common operation that everybody needs,
let's work around it here.
Fixes: 30c38a8bf8ae ("*.mk: Pipe to install(1)")
Link: <https://github.com/NixOS/nixpkgs/pull/300797>
Closes: <https://bugzilla.kernel.org/show_bug.cgi?id=218730>
Reported-by: Sergei Trofimovich <slyich@gmail.com>
Reported-by: Mario Rodas <https://github.com/marsam>
Cc: Eli Schwartz <eschwartz93@gmail.com>
Cc: Pádraig Brady <P@draigBrady.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
I don't like compressed pages: they make it more difficult/slow to grep
them. This was added to make it easier for users to install compressed
pages even when installing from source, but probably nobody cares at all
these days about a few KiB per page; drive space got cheap. Also, some
of the algorithms were added just for benchmarking (for demonstrating
that they were bad in this case), and not for real use.
This reduces a use of compression tools, which seem to be dangerous
these days.
Link: <https://tukaani.org/xz-backdoor/>
Link: <https://cmpct.info/~sam/blog/posts/automatic-manpage-compression/>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
With the larger font size, these pages have warnings.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Link: <https://journals.uc.edu/index.php/vl/article/view/5765>
Reported-by: Paul Eggert <eggert@cs.ucla.edu>
Suggested-by: "G. Branden Robinson" <branden@debian.org>
Cc: "Thomas E. Dickey" dickey@his.com
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Simplify a pipeline, by using cat(1) to actually catenate stuff.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Suggested-by: "G. Branden Robinson" <branden@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This is done for simplifying, and as a side effect, it also allows
much more control on the script (e.g., TROFFFLAGS).
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This will allow downstream packages to set their own version, just by
setting $DISTVERSION.
It will be stamped at `make install` time.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Each page has its own date.
Add new 'build-man' target, which stamps the date and version in the
pages (in $builddir, not the source ones).
Build-system internal stuff:
$CURDIR will be used for the build system, while $srcdir will be
used for the project root of the repository. This helps use
this build system in other projects.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Use one directory per each (Debian) package, and one file per command.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
They're part of the build system, so put them under <share/mk/>.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
That's what we use.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
man2html(1) crashes on tzfile(5), and the upstream project is defunct.
Link: <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1067022>
Cc: Paul Eggert <eggert@cs.ucla.edu>
Cc: "G. Branden Robinson" <branden@debian.org>
Cc: Robert Luberda <robert@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
clang(1)
That warning has false positives, such as in unix(7).
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This implementation is simpler.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
When $DISTNAME is too long, mandoc(1) breaks the last line. The last
two lines can always be removed safely, which makes it work also in this
case.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Default to 'yes'.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Except with groff(1) from git HEAD, which will be 1.24.0 eventually.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Comitter date is always increasing, while author date may jump
backwards, which is problematic with make(1).
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
In groff from git HEAD, it doesn't fail, but in 1.23.0, which still
has the default base paragraph indentation set to 7, it reports
troff:man2/fanotify_init.2:322: warning [p 4, 0.7i]: cannot adjust line
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This is mainly for debugging purposes. I won't document it in
'make help' for now, as it will clutter the output, and isn't so useful
for normal users.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Use a variable for the options passed to recursive make(1), to avoid
repetition.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
We're using install(1), but it's just an implementation detail.
Since we're not installing into the system, CP is less confusing.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
If any of $DISTVERSION, $DISTNAME, or $DISTDATE have changed since the
last 'make dist', force regeneration of the version file, even if it
wouldn't change due to normal dependencies. This makes sure that the
tarball has correct values.
It doesn't need to depend on all $DISTFILES.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Otherwise, the files within the 'dist' tarball will have a timestamp
older than their last actual modification, which is problematic with
'distcheck'.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This makes sure we don't accidentally produce release tarballs from a
dirty repository.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
We don't call git(1) inside tarballs anymore to get the $DISTNAME, so we
can safely assume that git(1) should never fail, and if it fails, we
better get an error message.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Piping the output to sed(1) didn't behave well with -Orecurse. Using a
variable behaves well, keeping output synchronized. The length of the
variable name is specific, so that `$(INFO_)` uses exactly 8 characters,
a tab.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Hardcode the version and date, and don't use git(1) for selecting the
distribution files.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Some variables are only part of the implementation of our build system,
and users should not modify them; others are designed to be set by users
when they invoke make(1). Define the latter in share/mk/configure/, so
that they are more visible.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This adds support for neomutt.man from the neomutt project.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This reverts commit bb42ee0d7793cf0fe2d2ec36c99891227797902c.
Programs should specify _GNU_SOURCE if they need it.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
If any makefile is modified, all files should be remade.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
It was being hardocded in a recipe, but we shouldn't do that.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
That is, ignore any warnings from clang(1). We have a different target
for that.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
To get some definitions that are essential in our programs.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
There were several important bugs regarding these variables that made
them unusable:
- intro(*) pages were completely ignoring them.
- The rules for non-intro pages were also ignoring them.
The variables were only being effectively used for updating the .so
links to other pages, but not the page filenames themselves.
Behavior prior to this patch:
$ rm -rf /tmp/dest;
$ echo '.so man2type/open_how.2type' >man2type/foo.2type;
$ echo '.so man2type/open_how.2type' >man2type/intro.2type;
$ make install-man2type install-manintro \
DESTDIR=/tmp/dest/dir \
man2typedir=/mantoo \
man2typeext=.twotype \
Z=.gz \
LINK_PAGES=symlink;
INSTALL /tmp/dest/dir/mantoo/
INSTALL /tmp/dest/dir/mantoo/foo.2type.gz
INSTALL /tmp/dest/dir/mantoo/open_how.2type.gz
INSTALL /tmp/dest/dir/usr/local/share/man/man1/
INSTALL /tmp/dest/dir/usr/local/share/man/man1/intro.1.gz
INSTALL /tmp/dest/dir/usr/local/share/man/man2type/
INSTALL /tmp/dest/dir/usr/local/share/man/man2type/intro.2type.gz
INSTALL /tmp/dest/dir/usr/local/share/man/man2/
INSTALL /tmp/dest/dir/usr/local/share/man/man2/intro.2.gz
INSTALL /tmp/dest/dir/usr/local/share/man/man3/
[...]
$ readlink /tmp/dest/dir/mantoo/foo.2type.gz;
../mantoo/open_how.twotype.gz
$ readlink /tmp/dest/dir/usr/local/share/man/man2type/intro.2type.gz;
../mantoo/open_how.twotype.gz
Notice the dead symlinks above.
Behavior after this patch:
$ rm -rf /tmp/dest;
$ echo '.so man2type/open_how.2type' >man2type/foo.2type;
$ echo '.so man2type/open_how.2type' >man2type/intro.2type;
$ make install-man2type install-manintro \
DESTDIR=/tmp/dest/dir \
man2typedir=/mantoo \
man2typeext=.twotype \
Z=.gz \
LINK_PAGES=symlink;
INSTALL /tmp/dest/dir/mantoo/
INSTALL /tmp/dest/dir/mantoo/foo.twotype.gz
INSTALL /tmp/dest/dir/mantoo/open_how.twotype.gz
INSTALL /tmp/dest/dir/usr/local/share/man/man1/
INSTALL /tmp/dest/dir/usr/local/share/man/man1/intro.1.gz
INSTALL /tmp/dest/dir/usr/local/share/man/man2/
INSTALL /tmp/dest/dir/usr/local/share/man/man2/intro.2.gz
INSTALL /tmp/dest/dir/mantoo/intro.twotype.gz
INSTALL /tmp/dest/dir/usr/local/share/man/man3/
[...]
$ readlink /tmp/dest/dir/mantoo/foo.twotype.gz;
../mantoo/open_how.twotype.gz
$ readlink /tmp/dest/dir/mantoo/intro.twotype.gz;
../mantoo/open_how.twotype.gz
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Cosmetic changes in preparation for next commit.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
For consistency, let's use $(MAN$(s)DIR).
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Remove the redundant special file name. It would be better to specify
/dev/stdin, if we wanted to specify a file name. But the command just
works as a filter without a filename, so there's no need for that at
all. Remove this redundant code.
The other compressors are compatible with gzip(1) in that regard. Do
the same.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
For consistency with other $(MAN*) variables, remove the underscore.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
GNU Make (since version 4.4) provides the same functionality with
`--debug=print`. Remove this custom variable, which is now redundant
with the new option.
- Define .SILENT: unconditionally.
- Define HIDE_ERR unconditionally, and let the user redefine it to an
empty string. Document this.
Cc: Paul Smith <psmith@gnu.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Debian installs intro(*) pages --including intro(3)-- in the manpages
package, not in manpages-dev, even if they would otherwise belong to the
-dev one due to their section. This is because even if someone may not
be interested in installing development manual pages, an introduction to
the section, explaining what one could find there when installed, is
useful.
Let's make it easy to do that with a specialized target that installs
all intro(*) pages.
This is a breaking change, since from now on, the only way to install
intro(*) pages is through this new target, and the old install-man*
targets won't install their own intro(*) pages. However, of course, the
wrapper targets `install` and `install-man` still install the intro(*)
pages.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
We used sort(1) for sorting pages, but sortman is more appropriate.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
After this patch, you can do 2>/dev/null to only see one line per
Makefile recipe being run, which is nice and useful (for example, to
have an overview of which pages are failing, without having to care
about the specific errors). I used this for example, to know which
files need to be touched to silence the known positives in `make lint`
in the Debian packaging is override_dh_test_auto.
In checkpatch(1), it's the program that writes to stdout. Redirect it.
In clang-tidy(1) and cppcheck(1), it was a mistake of mine, since I
redirected to stdout to filter the output, and then forgot to redirect
back to stderr.
Fixes: acaa21bc4a6f ("Makefile, etc/clang-tidy/config.yaml: lint-clang-tidy: Add target to run clang-tidy(1) to lint example programs")
Fixes: eb1bdc8c117a ("Makefile: lint-iwyu: Be silent if there are no problems")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Debian packaging (gbp-buildpackage(1)) produces a .pc/ dir in the root
of the repo, which then produces a build failure in dh_auto_test
(`make check -j4`). Let's ignore dot-dirs, since they won't likely
contain anything useful for our build system.
Fixes: 11e3443c0c68 ("*.mk: Allow non-standard source MANDIRS")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
It's more robust to only spell the variable name once. We've fixed typos
related to that in the past, and in this patch we're fixing another one:
DEFAULT_CPPCHECKFLAgS += --inconclusive
Even if we could merge some of those lines into one (because they're
short), I prefer to keep one line per option. Semantic newlines, aren't
they? :)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Suggested-by: Dmitry Goncharov <dgoncharov@users.sf.net>
Suggested-by: Torbjorn SVENSSON <torbjorn.svensson@foss.st.com>
Cc: Philip Guenther <guenther@gmail.com>
Cc: Bruno Haible <bruno@clisp.org>
Cc: Paul Smith <psmith@gnu.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Add an empty double-colon rule that targets the makefiles, to instruct
make(1) to not remake makefiles. This improves (considerably reduces)
the output of 'make -d'.
Suggested-by: Dmitry Goncharov <dgoncharov@users.sf.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
We don't need to see all warnings everywhere we call troff(1). Instead,
put all warnings in nroff mode, which we only run for the warnings, and
then only ask for warnings that depend on the output in other
invocations of troff(1).
-wbreak happens to enable only and all so-called "output warnings". It
is an implementation detail of groff(1), but that's the best we can do
now. If groff(1) changes their warnings organization, we'll need to
adapt to it.
Link: <https://lists.gnu.org/archive/html/groff/2023-05/msg00046.html>
Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This simplifies the makefiles, and has the benefit that we can edit them
without editing the makefile (thus without causing unnecessary rebuilds).
Suggested-by: Bjarni Ingi Gislason <bjarniig@simnet.is>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
We have some pages that come from UCB, and therefore need that macro.
It's not like we're going to accidentally use that macro, so let's
ignore the warning.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
It's the best tool for certain purposes (at least, so far).
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Ideally, we want this warning, but it has false positives in the example
programs, so let's disable it for now. Hopefully, groff will split
those two, and then we'll be able to re-enable the one we want.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
This happens when the second argument is a subsection, and the warning
is right because the page ends up with no section title, but let's
forget about it for now.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|