From af16edf499d9ed320d5725b0828465cc5b184045 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Tue, 28 Jun 2022 08:03:48 +0100 Subject: Makefile: use GNU sed to convert manpages on FreeBSD The sed implementation on FreeBSD has a strict interpretation of posix 'basic' regular expressions. It would be better to re-implement this using 'extended' regular expressions but for now, just use GNU sed. This should have no functional difference on currently supported platforms. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 4fe928bad..2ba6e1876 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,11 @@ PYTHON ?= $(shell command -v python3 python|head -n1) PKG_MANAGER ?= $(shell command -v dnf yum|head -n1) # ~/.local/bin is not in PATH on all systems PRE_COMMIT = $(shell command -v bin/venv/bin/pre-commit ~/.local/bin/pre-commit pre-commit | head -n1) +ifeq ($(shell uname -s),FreeBSD) +SED=gsed +else +SED=sed +endif # This isn't what we actually build; it's a superset, used for target # dependencies. Basically: all *.go and *.c files, except *_test.go, @@ -428,7 +433,7 @@ $(MANPAGES): %: %.md .install.md2man docdir ### replaces "\" at the end of a line with two spaces ### this ensures that manpages are renderd correctly - @sed -e 's/\((podman[^)]*\.md\(#.*\)\?)\)//g' \ + @$(SED) -e 's/\((podman[^)]*\.md\(#.*\)\?)\)//g' \ -e 's/\[\(podman[^]]*\)\]/\1/g' \ -e 's/\[\([^]]*\)](http[^)]\+)/\1/g' \ -e 's;<\(/\)\?\(a\|a\s\+[^>]*\|sup\)>;;g' \ -- cgit v1.2.3-54-g00ecf