From 7a3320f4bb4af5a6d1844fdefb7f2d3178917ccf Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Thu, 17 Sep 2020 11:54:49 -0700 Subject: [PATCH] build(make): Defensive make settings https://tech.davis-hansson.com/p/make/ Prevents things like silent shell pipeline errors in recipes, unexpected behavior from undefined variables, etc. --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 6dd87409e..e85f29b48 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,16 @@ # NOTE: this Makefile requires GNU make +### Defensive settings for make: +# https://tech.davis-hansson.com/p/make/ +SHELL := bash +.ONESHELL: +.SHELLFLAGS := -xeu -o pipefail -c +.SILENT: +.DELETE_ON_ERROR: +MAKEFLAGS += --warn-undefined-variables +MAKEFLAGS += --no-builtin-rules + default: @echo "no default target"