aboutsummaryrefslogtreecommitdiffstats
path: root/share
AgeCommit message (Collapse)AuthorFilesLines
2023-04-29*.mk: install-man: Ignore pages in non-standard source MANDIRSAlejandro Colomar1-12/+12
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-29*.mk: build-catman-troff: Silence warnings about missing fifth argumentAlejandro Colomar1-1/+4
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>
2023-04-29*.mk: Allow non-standard source MANDIRSAlejandro Colomar3-4/+4
Some projects don't store their source manual pages in a directory structure resembling $MANPATH. Allow such a directory structure so that we can for example lint groff's source manual pages: $ make check lint MANDIR=~/src/gnu/groff; Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-29*.mk: Don't rmdirAlejandro Colomar5-40/+3
There's no need; we can leave empty dirs on 'make uninstall', and it allows some simplifications. We don't need the FORCE target anymore, and don't need some directory variables either. While at it, I found some unused variable that should have been removed a long time ago: $installdirs_manX Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-29*.mk: MANEXT: Support man pages with .man and/or .in suffixesAlejandro Colomar1-1/+1
Those are common in some projects in their source pages; especially '.in' when it's a template that will be completed by the build system. This allows linting other projects' pages by running a command like: $ make lint MANDIR=/home/alx/src/nginx/unit/master/docs/man Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-28*.mk: lint-mdoc-mandoc: Silence warning about referenced manuals not foundAlejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-28*.mk: lint-mdoc-mandoc: Silence warnings about ISO 8601 format in the dateAlejandro Colomar1-0/+1
ISO 8601 is the standard way to express a date. Don't warn about it. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-28*.mk: lint-mdoc-mandoc: Silence warnings about lowercase in DtAlejandro Colomar1-0/+1
See commit 4896a4f8c4b8 ("lint-man.mk: lint-man-mandoc: Silence warnings about lowercase in TH") Cc: Ingo Schwarze <schwarze@openbsd.org> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-28*.mk: Fix error detectionAlejandro Colomar2-2/+2
See also this commit: 0440d04f8317 ("lint-man.mk: lint-man-groff-eqn: Fix error detection") Reported-by: Ralph Corderoy <ralph@inputplus.co.uk> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-28*.mk: Rewrite pipelines to make it easier to ignore some warningsAlejandro Colomar3-18/+18
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-28*.mk: Move -T$NROFF_OUT_DEVICE into NROFFFLAGSAlejandro Colomar1-5/+4
This avoids breaking some long lines. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-28*.mk: Move -rCHECKSTYLE to NROFFFLAGSAlejandro Colomar2-8/+8
Having that in TROFFFLAGS caused repeated warnings for every different format we produce. Let's have these warnings only in nroff mode. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-28*.mk: Keep error messages in stderrAlejandro Colomar3-9/+9
We redirected them to stdout for some filtering, but forgot to put it back where it belongs. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-26*.mk: Handle pathnames with ':'Alejandro Colomar6-9/+39
Since make(1) uses ':' as a special character in rules, it needs to be handled carefully. A way to make it work is to escape it with '\:'. We can use sed(1) to do that right when we get the pathnames. The only problem with ':' is in rules' targets and prerequisites: everywhere else it's fine; so let's discuss what needs to be done in those places: - In the targets, it's as easy as escaping. - In prerequisites, we can't second-expand variables containing such pathnames, as the '\' would not be used by make(1) to escape the ':', but it would be interpreted as part of the pathname. This means we need to expand rules written using second expansion into several rules that only expand their variables once. - $(wildcard ...) also performs the escape, so after using it the pathnames are not escaped. If we used those variables in targets, we would need to escape the ':'s again, but since we don't we can skip that. The trick to make this work is to second-expand these variables. Link: <https://stackoverflow.com/a/76096683/6872717> Cc: GNU Make <bug-make@gnu.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-25*.mk: Use empty recipes for .PHONY targetsAlejandro Colomar17-96/+48
The @: dummy recipe was there to avoid having rules without recipes. Rules without recipes can be confusing, as the reader can't know if a recipe is being defined somewhere else. Also, implicit rules might apply (in general, but we disable all implicit stuff). However, @: is also problematic, since make really needs to run that command, which is unnecessary overhead. But okay, :(1) (really called true(1), but wouldn't it be a nice man page name?) that's not meaningful overhead. And the bigger problem: having a recipe hides the usual: make: Nothing to be done for 'all'. We already disable it by using .SILENCE:, but the message can be seen when using V=1 (after this patch; prior to this patch, it was impossible to find that message). It is good to be able to know that make(1) says there's nothing to be done, as a confirmation. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-23groff.mk, checkstyle.tmac: Remove unnecessary tmac fileAlejandro Colomar1-5/+0
We used it for transforming groff_man(7)'s CHECKSTYLE into errors, but we already do that with grep(1). Moreover, the tmac was hiding troff(1)'s warnings. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-23*.mk: build-pdf: Build PDF manual pagesAlejandro Colomar2-1/+75
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-23*.mk: build-ps*: Build PostScript manual pagesAlejandro Colomar2-1/+75
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-23*.mk: TROFFFLAGS{_MAN,_MDOC}: Include -man/-mdoc in the flags variablesAlejandro Colomar2-2/+4
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-23groff.mk: TROFFFLAGS_MAN: tfixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-23*.mk: ffixAlejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-23groff.mk: TROFFFLAGS: Remove -tAlejandro Colomar1-2/+1
That was probably a typo; it doesn't make sense to ask troff(1) to pass the tbl(1) preprocessor, since we already did. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-23*.mk: Factor out device-independent groff(1) flagsAlejandro Colomar2-28/+51
Add {EXTRA_,}NROFFFLAGS (used exclusively in 'build-catman'). This refactor will allow building other formats. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-23*.mk: build-pre*: Split device-independent preprocessing from the catman targetsAlejandro Colomar2-25/+50
To build other output formats from the same sources, let's split the generic part of the pipelines. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-23install/_.mk: Make pattern rule more explicitAlejandro Colomar1-1/+1
Specify $DESTDIR, so that it's more clear what this rule is about. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-23dist.mk: Create directories with $INSTALLAlejandro Colomar1-0/+5
Other directories in $builddir are created with $MKDIR, but since these should be as if installed, it makes sense to use the same command as when installing. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-23*/mk: mkdir -p (and install -d) are safe to useAlejandro Colomar6-16/+5
There are no race conditions, contrary to what some sources say. Previously, we had each directory depend on its parent directory, so that only a few parent-most directories would be created with parents, and all others would be created when their parents exist. That was due to FUD about TOCTOU race conditions with mkdir -p and parallel make, but it was just FUD. This patch makes it so that each directory is directly created with parents without specifying any dependency. This simplifies the makefile at some cost: calling mkdir -p so many times is a bit slower. However, it's only about 5%, so we can live with it, since we're talking about hundreds of a second for creating all the directories that this build system knows about. Reported-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-22*.mk: Make comment more genericAlejandro Colomar20-20/+20
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-22*.mk: License consistently with GPL-3.0-or-laterAlejandro Colomar20-37/+37
Also, use consistent formatting for the license and copyright. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-22*.mk: check-catman: Support mdoc(7) pagesAlejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-22*.mk: build-catman-troff, build-catman-troff-man, build-catman-troff-mdoc: ↵Alejandro Colomar1-17/+36
Support mdoc(7) pages Split the old build-catman-troff target into two subtargets; the ...-man one supports man(7) pages, while the ...-mdoc one supports mdoc(7) pages. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-22catman.mk: build-catman-troff: Fail if troff(1) writes to stderrAlejandro Colomar1-1/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-22*.mk: lint, lint-mdoc, lint-mdoc-mandoc: Support mdoc(7) pagesAlejandro Colomar5-15/+75
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-21build-catman.mk: Use .set suffix for troff(1) outputAlejandro Colomar1-4/+4
Suggested-by: Ralph Corderoy <ralph@inputplus.co.uk> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-14*.mk, INSTALL: build-src-c: Optimize pipelineAlejandro Colomar3-3/+2
Calling man(1) is slow. Since we only need to format the page, calling mandoc(1) is faster and simpler (we could also use groff(1), but mandoc(1) is probably faster and simpler than groff(1) too). This brings times down ~3x in my system. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-14src.mk: Optimize pipelineAlejandro Colomar1-5/+3
This pipeline is run for every make(1) invokation, and it was very slow, due to running a new sed(1) process for every manual page. Remove the while loop, and rewrite so that all the commands in the pipeline are only run once. This brings times down ~10x in my system, from 1.5 s, to just 0.14 s. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-04-14*.mk: Move makefiles from lib/ to share/mk/Alejandro Colomar18-0/+1145
According to the FHS, lib/ is for arch-dependent files, while share/ is for arch-independent files. While moving, create a more organized directory structure. Signed-off-by: Alejandro Colomar <alx@kernel.org>