From 018fdb48ed182c0b13bdfa2a163e1e09ffdca921 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Mon, 7 Aug 2023 08:50:07 +0100 Subject: [PATCH] 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 --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 89104f6760..23257888e6 100644 --- a/Makefile +++ b/Makefile @@ -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