Makefile: work around the lack of 'man -l' on FreeBSD

The mandoc(1) utility is used for this on FreeBSD systems. This fixes a
confusing (but harmless) series of error messages when building manpages
on FreeBSD.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
This commit is contained in:
Doug Rabson 2023-08-07 08:50:07 +01:00
parent e9a3b7cfa1
commit 018fdb48ed
1 changed files with 3 additions and 1 deletions

View File

@ -69,9 +69,11 @@ PRE_COMMIT = $(shell command -v bin/venv/bin/pre-commit ~/.local/bin/pre-commit
ifeq ($(shell uname -s),FreeBSD)
SED=gsed
GREP=ggrep
MAN_L= mandoc
else
SED=sed
GREP=grep
MAN_L= man -l
endif
# This isn't what we actually build; it's a superset, used for target
@ -503,7 +505,7 @@ $(MANPAGES): %: %.md .install.md2man docdir
@if grep 'included file options/' docs/build/man/*; then \
echo "FATAL: man pages must not contain ^^^^"; exit 1; \
fi
@if man -l $(subst source/markdown,build/man,$@) | grep -Pazoq '│\s+│\n\s+├─+┼─+┤\n\s+│\s+│'; then \
@if $(MAN_L) $(subst source/markdown,build/man,$@) | $(GREP) -Pazoq '│\s+│\n\s+├─+┼─+┤\n\s+│\s+│'; then \
echo "FATAL: $< has a too-long table column; use 'man -l $(subst source/markdown,build/man,$@)' and look for empty table cells."; exit 1; \
fi