aboutsummaryrefslogtreecommitdiffstats
path: root/share
AgeCommit message (Collapse)AuthorFilesLines
2025-11-06share/mk/: $SHELLCHECKFLAGS: Disable SC2028Alejandro Colomar1-1/+3
It's known that echo(1) doesn't expand anything. No need to warn. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-05man/man4/console_codes.4: ffixAlejandro Colomar1-1/+0
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>
2025-09-25share/mk/: lint-man-dash: Diagnose unescaped dashesAlejandro Colomar3-0/+54
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-25share/mk/: build-catman-troff: Ignore adjustment warningAlejandro Colomar1-0/+1
This is too common, and I don't see a solution in many cases. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-21share/mk/: lint-man-poems: Align outputAlejandro Colomar1-1/+8
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>
2025-09-21share/mk/: $AWK: Add dependencyAlejandro Colomar1-0/+14
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-21share/mk/: lint-man-poems: Diagnose (lack of) semantic newlinesAlejandro Colomar4-0/+54
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>
2025-09-21share/mk/: $PCRE2GREP: Add dependencyAlejandro Colomar1-0/+14
This will be used for adding diagnostics about semantic newlines. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-20share/mk/: $CLANG_CFLAGS: Add -Wno-unknown-attributesAlejandro Colomar1-0/+1
Clang doesn't know [[gnu::nonnull]]. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-20share/mk/, etc/clang-tidy: Silence diagnostics about unnamed parametersAlejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-14share/mk/: Unify variable names for regex filesAlejandro Colomar4-22/+18
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>
2025-09-11share/mk/: Merge handling of man(7) and mdoc(7) pagesAlejandro Colomar15-75/+37
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-11share/mk/: Fix includeAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-11share/mk/: Use $ext to simplifyAlejandro Colomar27-40/+106
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>
2025-09-11share/mk/: Unify local variable namesAlejandro Colomar7-48/+54
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-11share/mk/: Remove unused variablesAlejandro Colomar5-24/+10
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-10share/mk/: lint, build, check: Move exceptions to separate filesAlejandro Colomar32-507/+625
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>
2025-09-09share/mk/: $DOWNLOAD: Remove unused variableAlejandro Colomar1-2/+0
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-09share/mk/: build-*-troff: Merge targets for man(7) and mdoc(7)Alejandro Colomar8-76/+28
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>
2025-09-07share/mk/: lint-man-quote: Diagnose an unmatched quoteAlejandro Colomar3-0/+48
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-08-24share/mk/: lint-man-ws: Diagnose spurious use of white spaceAlejandro Colomar3-1/+57
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-08-24share/mk/: lint-man-blank: Add target to lint about blank linesAlejandro Colomar2-1/+43
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>
2025-08-20share/mk/: lint-man-tbl: Show target name in diagnosticsAlejandro Colomar1-3/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-07-22share/mk/build/pdf/book/prepare.pl: Add support for man3attrAlejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-06-28share/mk/: uninstall-man: Fix support for pages with ':' in their file nameAlejandro Colomar1-1/+2
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>
2025-05-17*: grfixAlejandro Colomar139-139/+139
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>
2025-05-10*, AUTHORS: Consistently refer to authorsAlejandro Colomar139-139/+139
- 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>
2025-05-06*, CREDITS: Unify copyright noticesAlejandro Colomar139-139/+139
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>
2025-05-06share/mk/build/: Ignore known diagnosticsAlejandro Colomar2-0/+2
"cannot adjust line", which is due to the long URI added to See also. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-03-01share/mk/build/pdf/book/prepare.pl: Add support for the Unix V10 manualDeri James1-11/+40
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-02-27share/mk/: Don't pass an escaped # to grep(1)Alejandro Colomar2-2/+2
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>
2025-02-24share/mk/: diffoscope(1) is in the diffoscope-minimal packageAlejandro Colomar2-3/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-02-16share/mk/: Use ifndef and := instead of ?=Alejandro Colomar64-209/+499
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>
2025-02-10share/mk/: Use ?= assignments for user-facing variablesAlejandro Colomar64-146/+146
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>
2025-02-10share/mk/: Escape '#' in regexesAlejandro Colomar2-2/+2
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>
2025-01-28share/mk/build/: Ignore known errors with pathname.7Alejandro Colomar2-0/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-01-28share/mk/build/pdf/book/prepare.pl: Fix duplicate overview-panel entriesDeri1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-01-05share/mk/: $CLANG_CFLAGS: Add -Wno-language-extension-tokenAlejandro Colomar1-0/+1
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>
2024-11-26share/mk/: $MANINTROPAGES: Remove redundant grep(1) callAlejandro Colomar1-1/+0
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-26share/mk/: $MANEXT: Use extended regexAlejandro Colomar2-7/+7
This makes the line fit in 80 columns, and also makes it simpler to read. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-26src/bin/sortman, sortman.1, share/mk/: Move sortman script to src/bin/, and ↵Alejandro Colomar1-1/+4
add manual page Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-03share/mk/: wsfixAlejandro Colomar6-8/+8
Add some spaces for readability and consistency. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-03share/mk/: lint-c: Skip some false positivesAlejandro Colomar2-0/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-03share/mk/: [un]install-bin: Add target to [un]install shell scriptsAlejandro Colomar4-2/+44
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-03share/mk/, etc/shellcheck/: lint-sh: Add target to lint shell scriptsAlejandro Colomar6-1/+83
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-08-28share/mk/: build-pdf-book: Rename book to "GNU/Linux Programmer's Manual"Alejandro Colomar2-2/+2
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>
2024-08-27share/mk/: $CLANG_CFLAGS: -Wno-used-but-marked-unusedAlejandro Colomar1-1/+2
This diagnostic is triggered by valid calls to printf(3). Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-08-27share/mk/: $CLANG_CFLAGS: -Wno-unreachable-codeAlejandro Colomar1-0/+1
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>
2024-07-22share/mk/: Skip expected warningsAlejandro Colomar2-0/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-07-20share/mk/: Silence spurious warningsAlejandro Colomar1-0/+2
Those write(2) calls are unimportant, and we don't want to check errors. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-07-20share/mk/: Silence spurious warningsAlejandro Colomar2-1/+5
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-07-20share/mk/: Reduce the work of 'make && make install'Alejandro Colomar3-4/+11
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>
2024-07-20share/mk/: CPPFLAGS: Only define _FORTIFY_SOURCE if it's not already definedAlejandro Colomar1-3/+18
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>
2024-07-20share/mk/, share/tests/: Refactor *FLAGS and LDLIBS variablesAlejandro Colomar55-95/+95
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>
2024-07-20share/mk/: CPPFLAGS: -D_FORTIFY_SOURCE=2Alejandro Colomar1-1/+2
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>
2024-07-20share/mk/: CosmeticAlejandro Colomar1-1/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-06-17man/, share/mk/: Fix nested EX/EE within nf/fiAlejandro Colomar1-2/+0
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>
2024-06-16man/, share/mk/: srcfix, and remove corresponding XFAIL exceptionsAlejandro Colomar1-4/+0
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>
2024-06-16share/mk/: Globally disable two spurious mandoc(1) warningsAlejandro Colomar2-9/+2
And remove the XFAIL exceptions that were triggering these warnings. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-06-15share/mk/: lint-man-so: Skip man.7Alejandro Colomar1-0/+9
We purposefully point to groff_man(7), which is not in this project. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-06-15share/mk/: lint-man-so: Check that .so link pages point to an existing fileAlejandro Colomar2-1/+32
Cc: Adam Sampson <ats@offog.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-06-15share/mk/: lint-man: Merge linting of man(7) and mdoc(7) pagesAlejandro Colomar6-57/+9
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>
2024-06-15share/mk/: $CUT: Add dependency on cut(1)Alejandro Colomar1-0/+12
We'll need it for checking the .so link pages. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-06-14share/mk/: Skip spurious warnings from mandoc(1)Alejandro Colomar1-0/+7
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-06-13share/mk/: Skip expected warningsAlejandro Colomar1-0/+1
Due to missing 'U' suffixes in UAPI constants. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-06-13share/mk/: Skip spurious warning from mandoc(1)Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-06-12share/mk/: Skip spurious warning from mandoc(1)Alejandro Colomar1-0/+1
$ 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>
2024-06-11share/mk/: Skip expected failuresAlejandro Colomar2-0/+5
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>
2024-06-11share/mk/: TROFFFLAGS: -rU0: Disable generation of OSC 8 URI hyperlinksAlejandro Colomar1-1/+2
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>
2024-05-31share/mk/: Skip expected failuresAlejandro Colomar2-0/+2
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>
2024-05-29man2const/, share/mk/: 2const: New sub-chapterAlejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-05-06share/mk/: distcheck: Run 'check' after 'build'Alejandro Colomar1-2/+5
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>
2024-05-05share/mk/: $LD: Fix definition to include $CPPFLAGSAlejandro Colomar1-1/+2
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>
2024-05-02share/mk/: lint-c-iwyu: Add exceptionAlejandro Colomar1-0/+1
Link: <https://github.com/include-what-you-use/include-what-you-use/pull/1533> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-05-02share/mk/: $CPPCHECKFLAGS: Add --check-level=exhaustiveAlejandro Colomar1-0/+1
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>
2024-05-02man/, share/mk/: Move man*/ to man/Alejandro Colomar2-3/+3
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>
2024-04-26share/mk/: build-html: Don't build mbind.2 and set_mempolicy.2Alejandro Colomar1-0/+2
They have known warnings. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-04-19share/mk/: Fix includesAlejandro Colomar1-3/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-04-19share/mk/: Split makefilesAlejandro Colomar6-41/+87
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-04-19share/mk/: build-fonts-tinos: Build TinosR from TinosR.afmAlejandro Colomar4-3528/+26
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>
2024-04-19share/mk/: build-fonts-tinos: Build TinosR.afm from Tinos-Regular.ttfAlejandro Colomar3-3/+37
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>
2024-04-18share/mk/: Remove unused variableAlejandro Colomar1-1/+0
Co-developed-by: Deri James <deri@chuzzlewit.myzen.co.uk> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-04-17share/mk/: build-fonts: Use $FONTSDIR/devpdf/, and add the download fileAlejandro Colomar6-5/+32
See gropdf(1). Reported-by: Deri <deri@chuzzlewit.myzen.co.uk> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-04-16share/mk/: build-pdf-book: Fix chapter bookmarksAlejandro Colomar1-1/+2
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>
2024-04-16share/mk/: build-pdf-book: Add support for mdoc(7) pages, with -mandocAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-04-16share/mk/: build-pdf-book: Use -rC1, to have strictly increasing page numbersAlejandro Colomar1-1/+1
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>
2024-04-16share/mk/: Read files before 'if'Alejandro Colomar2-14/+21
'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>
2024-04-16share/mk/: install-man: Don't pipe to install(1)Alejandro Colomar1-3/+3
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>
2024-04-16share/mk/: build-pdf-book: Use the system's man(7) macrosAlejandro Colomar2-1613/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-04-09share/mk/: Remove support for installing compressed pagesAlejandro Colomar2-51/+4
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>
2024-04-08share/mk/: build: Add exceptionsAlejandro Colomar2-0/+4
With the larger font size, these pages have warnings. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-04-08share/mk/: $TROFFFLAGS: Use a larger font sizeAlejandro Colomar1-1/+3
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>
2024-03-29share/mk/: Useful Use of CatAlejandro Colomar1-5/+2
Simplify a pipeline, by using cat(1) to actually catenate stuff. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-26share/mk/: Reorganize files for generating the PDF bookAlejandro Colomar5-6/+1904
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-26share/mk/: Generate the fonts during the buildAlejandro Colomar6-3/+3607
Suggested-by: "G. Branden Robinson" <branden@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-26share/mk/: $CFLAGS: -Wno-reserved-identifier, -Wno-unused-macrosAlejandro Colomar1-0/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-26share/mk/: lint-c-iwyu: Add exceptionsAlejandro Colomar1-0/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-26share/mk/: lint-c: Lint headers from EXAMPLESAlejandro Colomar4-4/+4
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-26share/mk/: Sync with liba2i's build systemAlejandro Colomar22-303/+327
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-24share/mk/: build-pdf*, install-pdf*: Rename targets for consistencyAlejandro Colomar10-60/+88
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-24share/mk/, scripts/LinuxManBook/build.sh: Embed script in the makefilesAlejandro Colomar1-10/+12
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>
2024-03-24share/mk/: [un]install-pdf: Add target to install the PDF bookAlejandro Colomar3-6/+40
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-24share/mk/: $EXTRAVERSION: Add variable to append to the versionAlejandro Colomar1-1/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-24share/mk/: Derive $DISTNAME from $DISTVERSIONAlejandro Colomar2-8/+10
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-24share/mk/: Reorganize build systemAlejandro Colomar39-106/+134
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-23share/mk/: dist: Don't stamp the version on the manual pagesAlejandro Colomar1-4/+1
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>
2024-03-23share/mk/: $MANPAGEDATECMD: Use a variable for setting the date of manual pagesAlejandro Colomar3-2/+5
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-23share/mk/: build-*: Specify manual pages' version and dateAlejandro Colomar9-48/+27
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-23share/mk/: Fix includesAlejandro Colomar3-6/+7
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-22share/mk/: build-man: Split ruleAlejandro Colomar6-5/+82
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-22share/mk/: Use more robust regexAlejandro Colomar2-4/+4
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-21share/mk/: build-book, build-man, install-man: Specify version and dateAlejandro Colomar4-7/+41
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>
2024-03-20share/mk/: Reorganize dependenciesAlejandro Colomar97-276/+562
Use one directory per each (Debian) package, and one file per command. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-19share/lint, share/mk/: Move *.grep filesAlejandro Colomar6-5/+5
They're part of the build system, so put them under <share/mk/>. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-19share/mk/: Split long lineAlejandro Colomar1-1/+7
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-19share/mk/: Rename variablesAlejandro Colomar4-12/+13
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-19share/mk/: We don't use man2html(1) any moreAlejandro Colomar1-15/+0
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-19share/mk/: $htmlext: Remove unused variableAlejandro Colomar1-3/+0
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-19share/mk/: Print SED rather than CPAlejandro Colomar1-1/+1
That's what we use. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-19share/mk/: wsfixAlejandro Colomar1-5/+5
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-18share/mk/: sort(1) input to tar(1)Alejandro Colomar1-0/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-18share/mk/: Consistency fixes in copyright linesAlejandro Colomar36-36/+36
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-18share/mk/: build-html: Skip known errors (in groff-1.23.0)Alejandro Colomar1-1/+4
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-18share/mk/: Update licenseAlejandro Colomar12-48/+24
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-18share/mk/: Use grohtml(1) instead of man2html(1)Alejandro Colomar6-40/+103
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>
2024-03-14scripts/LinuxManBook/build.sh, share/mk/: Use command variablesAlejandro Colomar3-0/+17
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-12share/mk/configure/build-depends/cc.mk: Use -Wno-unsafe-buffer-usage with ↵Alejandro Colomar1-1/+3
clang(1) That warning has false positives, such as in unix(7). Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-10share/mk/: dist: Don't package .git/Alejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-03-05share/mk/: Add missing includeAlejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-28share/mk/: distcheck: Rewrite most of itAlejandro Colomar7-240/+18
This implementation is simpler. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-28share/mk/: build-ex-src: Support long $DISTNAMEAlejandro Colomar1-0/+2
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>
2024-02-28share/mk/: Fix pathAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-26share/mk/, man*/: build-ex: Skip expected failuresAlejandro Colomar2-0/+54
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-26share/mk/, etc/: Fix dependenciesAlejandro Colomar4-4/+4
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-26share/mk/: lint-c: Skip expected failuresAlejandro Colomar6-23/+330
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-26share/mk/: $SKIP_XFAIL: Add variable to allow skipping expected failuresAlejandro Colomar12-298/+183
Default to 'yes'. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-26share/mk/: distcheck: string_copying.7 fails 'check-catman'Alejandro Colomar1-0/+1
Except with groff(1) from git HEAD, which will be 1.24.0 eventually. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-26share/mk/configure/version.mk: $DISTDATECMD: Use committer date, not author dateAlejandro Colomar1-1/+1
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>
2024-02-26share/mk/: Simplify codeAlejandro Colomar1-3/+4
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-25share/mk/: distcheck: Ignore fanotify_init.2 build errorsAlejandro Colomar1-0/+6
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>
2024-02-25share/mk/: distcheck-*: Add targets to run 'distcheck' partiallyAlejandro Colomar9-4/+65
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>
2024-02-25share/mk/: srcfixAlejandro Colomar7-48/+65
Use a variable for the options passed to recursive make(1), to avoid repetition. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-25share/mk/: dist: Show CP instead of INSTALLAlejandro Colomar1-1/+1
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>
2024-02-25share/mk/: dist: FORCE regeneration of version file if necessaryAlejandro Colomar1-1/+17
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>
2024-02-25share/mk/: $DISTDATE: If the repository is "dirty", use the newest timestampAlejandro Colomar3-9/+26
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>
2024-02-25share/mk/: dist: Preserve links with cp(1)Alejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-25share/mk/: Consistently use 'cp -T'Alejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-25share/mk/configure/version.mk: $DISTNAME: Pass --dirty to git-describe(1)Alejandro Colomar1-1/+1
This makes sure we don't accidentally produce release tarballs from a dirty repository. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-25share/mk/configure/version.mk: $DISTNAME: Don't hide git(1) errorsAlejandro Colomar1-1/+1
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>
2024-02-25share/mk/: distcheck: Remove old directory before untarring the new tarballAlejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-25share/mk/: distcheck: Fix dependenciesAlejandro Colomar7-15/+15
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-25share/mk/: Fix pathAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-25share/mk/: distcheck: Support an absolute path in $builddirAlejandro Colomar10-268/+272
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-25share/mk/: distcheck: Use temporary dirs within $builddirAlejandro Colomar10-35/+32
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-25share/mk/: Use a variable to prefix recursive make(1) outputAlejandro Colomar43-95/+92
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>
2024-02-17share/mk/: clean: Also remove 'distcheck' tmp dirsAlejandro Colomar2-10/+26
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-17share/mk/: $(info ...): Make output more consistentAlejandro Colomar38-66/+65
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-17share/mk/: Use $(TRUE) instead of ':'Alejandro Colomar4-4/+5
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-17share/mk/dist/: dist: Support recursive 'dist'Alejandro Colomar2-9/+24
Hardcode the version and date, and don't use git(1) for selecting the distribution files. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-17share/mk/: distcheck: Add targetAlejandro Colomar11-0/+537
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-17share/mk/: Reorganize build systemAlejandro Colomar52-594/+979
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-17share/mk/: Move configuration variables to share/mk/configure/Alejandro Colomar25-84/+114
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>
2024-02-17share/mk/: Move '.SILENT:' to GNUmakefileAlejandro Colomar1-3/+0
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-02-17share/mk/: Reorganize build dependenciesAlejandro Colomar52-318/+718
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-01-22*.mk: Allow pages with the suffix .man and no numberAlejandro Colomar1-1/+1
This adds support for neomutt.man from the neomutt project. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-12-03*.mk: build-book: Use sponge(1) to update the book atomicallyAlejandro Colomar1-1/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-12-01*.mk: build-book: Add target for building the Linux Man BookAlejandro Colomar2-1/+32
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-24*: Remove trailing white spaceAlejandro Colomar1-5/+5
Scripted change: $ grep -rl '\s$' | xargs sed -i 's/ * * *$//g' Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-09-06Revert "*.mk: DEFAULT_CPPFLAGS: -D_GNU_SOURCE"Alejandro Colomar1-3/+1
This reverts commit bb42ee0d7793cf0fe2d2ec36c99891227797902c. Programs should specify _GNU_SOURCE if they need it. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-09-06*.mk: Have the makefiles as dependencies of all filesAlejandro Colomar12-33/+33
If any makefile is modified, all files should be remade. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-09-02*.mk: dist-*: Use a function to define similar rulesAlejandro Colomar1-17/+11
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-09-02*.mk: GZIPFLAGS: Add -nAlejandro Colomar2-2/+2
It was being hardocded in a recipe, but we shouldn't do that. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-31*.mk: lint-c-iwyu: Fail iff iwyu(1) finds problemsAlejandro Colomar1-4/+8
That is, ignore any warnings from clang(1). We have a different target for that. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-31*.mk: DEFAULT_CPPFLAGS: -D_GNU_SOURCEAlejandro Colomar1-1/+3
To get some definitions that are essential in our programs. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-29*.mk: man*ext: Make the variables actually usableAlejandro Colomar2-6/+14
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>
2023-08-29*.mk: srcfixAlejandro Colomar1-2/+4
Cosmetic changes in preparation for next commit. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-29*.mk: man*ext: Don't include $(Z) in $(man*ext)Alejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-29*.mk: srcfixAlejandro Colomar1-1/+1
For consistency, let's use $(MAN$(s)DIR). Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-28*.mk: Use $(foreach ...) to reduce repetitionAlejandro Colomar1-13/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-28*.mk: gzip(1) doesn't need '-' to act as a filterAlejandro Colomar1-3/+3
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>
2023-08-28*.mk: Pipe to install(1)Alejandro Colomar2-6/+7
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-28*.mk: MANSECTIONS: Deduce values from existing mandirsAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-28*.mk: MANSECTIONS: Rename variableAlejandro Colomar2-16/+16
For consistency with other $(MAN*) variables, remove the underscore. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-28*.mk: Remove 'V' variableAlejandro Colomar1-4/+2
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>
2023-08-27*.mk: Use $(foreach ..., $(eval ...) to reduce repetitionAlejandro Colomar6-172/+89
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-17*.mk: Allow any combination of common suffixes to manual pagesAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-17*.mk: Tighten regex for finding manual pagesAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-13*.mk: [un]install-manintro: Add target to [un]install intro(*) pages separatelyAlejandro Colomar2-15/+31
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>
2023-08-13*.mk: Use ./scripts/sortman instead of sort(1)Alejandro Colomar4-5/+5
We used sort(1) for sorting pages, but sortman is more appropriate. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-08-03*.mk: lint-c: Redirect error output to stderrAlejandro Colomar1-3/+3
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>
2023-08-03*.mk: Ignore dot-dirs within $(MANDIR)Alejandro Colomar3-4/+4
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>
2023-07-17*.mk: Escape newlines instead of using +=Alejandro Colomar6-44/+55
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>
2023-07-16Makefile: SimplifyAlejandro Colomar1-23/+0
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>
2023-07-16Makefile: Improve Makefile troubleshootingAlejandro Colomar1-0/+23
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>
2023-05-09*.mk: Use -wbreak in TROFFFLAGS, and -ww in NROFFFLAGSAlejandro Colomar2-1/+2
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>
2023-05-03man*/, man.ignore.grep: srcfix; warn about blank linesAlejandro Colomar1-1/+0
- Use the dummy character to avoid warnings in examples. - Re-enable the warning. Suggested-by: "G. Branden Robinson" <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-05-02*.mk, *.grep: Move grep patterns to .grep filesAlejandro Colomar6-18/+27
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>
2023-04-29*.mk: build-catman-troff: Silence warnings about using UCAlejandro Colomar1-0/+1
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>
2023-04-29*.mk: build-catman-troff: Silence warnings about using PDAlejandro Colomar1-0/+1
It's the best tool for certain purposes (at least, so far). Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-29*.mk: build-catman-troff: Silence warnings about blank lines in inputAlejandro Colomar1-0/+1
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>