From 88b118688e4e0375ead627d7e3ad63f1937e201c Mon Sep 17 00:00:00 2001 From: Cory Snider Date: Tue, 27 Aug 2024 15:49:43 -0400 Subject: [PATCH] man: create parent directories in install recipe Support the use of `make install` in packaging scripts, where the $mandir tree might not exist under $DESTDIR. For portability, create the parent directories using a separate install command instead of relying on the non-portable `-D` flag. Set errexit so the install target fails if any install step fails. Signed-off-by: Cory Snider --- man/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/man/Makefile b/man/Makefile index b91f7ecf5a..397830dc1e 100644 --- a/man/Makefile +++ b/man/Makefile @@ -35,7 +35,9 @@ man%: .PHONY: install install: all + @set -ex; \ for sec in $(sections); do \ + $(INSTALL) -d $(DESTDIR)$(mandir)/man$$sec && \ $(INSTALL_DATA) man$$sec/* $(DESTDIR)$(mandir)/man$$sec; \ done