From: Andre Noll Date: Sun, 25 Apr 2021 22:17:37 +0000 (+0200) Subject: build: Activate .DELETE_ON_ERROR. X-Git-Tag: v1.0.4~5^2~2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=c1840c5bb555ba09c09bdeb2f29305681038317f;p=lopsub.git build: Activate .DELETE_ON_ERROR. Since m4 lacks the -o option to specify an output file, we redirect stdout in several recipes, in particular in the recipe that creates lopsub.h from lopsub.h.m4. If the m4 command fails, lopsub.h will be incomplete or empty, yet it will be considered as up-to-date by make(1). This patch teaches make(1) to remove such incomplete output files on errors. --- diff --git a/Makefile b/Makefile index c0057a3..31c2102 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,13 @@ endif .ONESHELL: .SHELLFLAGS := -ec +# Recipes which redirect stdout to the target of the rule (i.e., constructs +# like cmd > $@) create empty or incomplete output files if the command fails, +# for example when cmd was not found. Since the target exists and is uptodate +# in this case, this may lead to all sorts of problems. The following target +# makes sure that such files are removed. +.DELETE_ON_ERROR: + PREFIX ?= /usr/local M4 := m4 LN := ln -f