From 00bbc188f0bd2bbec15752bce61605d5236f26c9 Mon Sep 17 00:00:00 2001 From: Brandon Maier Date: Mon, 1 Jul 2024 17:58:28 +0000 Subject: mk: handle stale files when scdoc fails If scdoc fails for any reason, for example because a user hasn't installed it yet, the `> $$@` redirection will still create an empty destination file. On re-runs gmake will see the empty file and assume the target has already completed. This led to installing a blank man page. Use the GNU Make '.DELETE_ON_ERROR' special target which automatically deletes the target if a recipe fails. Link: https://www.gnu.org/software/make/manual/html_node/Special-Targets.html#index-removing-targets-on-failure Signed-off-by: Brandon Maier Acked-by: Robin Jarry --- GNUmakefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 6c666fdd..de1dfb52 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -208,3 +208,5 @@ $(eval $(call install_file,contrib/carddav-query,755,$(DESTDIR)$(BINDIR))) $(sort $(dirs)): mkdir -p $@ + +.DELETE_ON_ERROR: -- cgit