From 6ff2b6408a4c75d45f0bdcaa58b240713f73361f Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Mon, 14 Oct 2019 19:25:01 +0200 Subject: [PATCH] Makefile.include: fail by default when errors are expected The build can still be forced by adding WERROR=0 to the command line --- Makefile.include | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile.include b/Makefile.include index da39ecaadf..c6f4ce8606 100644 --- a/Makefile.include +++ b/Makefile.include @@ -786,7 +786,12 @@ ifneq (, $(filter all flash, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all))) $(shell $(COLOR_ECHO) "\n$(COLOR_YELLOW)EXPECT undesired behaviour!$(COLOR_RESET)" 1>&2) endif + # Fail by default when errors are expected + CONTINUE_ON_EXPECTED_ERRORS ?= 0 ifneq (, $(EXPECT_ERRORS)) + ifneq (1,$(CONTINUE_ON_EXPECTED_ERRORS)) + $(error You can let the build continue on expected errors by setting CONTINUE_ON_EXPECTED_ERRORS=1 to the command line) + endif $(shell $(COLOR_ECHO) "\n\n$(COLOR_RED)EXPECT ERRORS!$(COLOR_RESET)\n\n" 1>&2) endif