From 90fdd091767ed8674846dd99ba505d58977b2b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Wed, 20 Jun 2018 18:59:21 +0200 Subject: [PATCH] Makefile.include: detect if BASELIBS changed after its first use --- Makefile.include | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Makefile.include b/Makefile.include index 49eb367a2c..6ee815bd93 100644 --- a/Makefile.include +++ b/Makefile.include @@ -362,6 +362,9 @@ LINKFLAGPREFIX ?= -Wl, DIRS += $(EXTERNAL_MODULE_DIRS) +# Save value to verify it is not modified later +_BASELIBS_VALUE_BEFORE_USAGE := $(BASELIBS) + # Linker rule $(ELFFILE): FORCE ifeq ($(BUILDOSXNATIVE),1) @@ -644,4 +647,12 @@ ifneq (all, $(.DEFAULT_GOAL)) $(error .DEFAULT_GOAL := $(.DEFAULT_GOAL)) endif + +# Detect if BASELIBS changed since its first use +ifneq ($(_BASELIBS_VALUE_BEFORE_USAGE),$(BASELIBS)) + $(warning $(sort $(filter-out $(_BASELIBS_VALUE_BEFORE_USAGE), $(BASELIBS)) \ + $(filter-out $(BASELIBS), $(_BASELIBS_VALUE_BEFORE_USAGE)))) + $(error BASELIBS value changed) +endif + endif # BOARD=none