diff --git a/Makefile.include b/Makefile.include index 137ad480bc..a03d563252 100644 --- a/Makefile.include +++ b/Makefile.include @@ -245,6 +245,9 @@ include $(RIOTBOARD)/$(BOARD)/Makefile.include INCLUDES += -I$(RIOTCPU)/$(CPU)/include include $(RIOTCPU)/$(CPU)/Makefile.include +# Assume GCC/GNU as supported toolchain if CPU's Makefile.include doesn't +# provide this macro +TOOLCHAINS_SUPPORTED ?= gnu # Import all toolchain settings include $(RIOTMAKE)/toolchain/$(TOOLCHAIN).inc.mk @@ -592,6 +595,20 @@ ifneq (, $(filter all, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all))) endif endif + # test if toolchain is supported. + ifeq (,$(filter $(TOOLCHAIN),$(TOOLCHAINS_SUPPORTED))) + $(shell $(COLOR_ECHO) "$(COLOR_RED)The selected TOOLCHAIN=$(TOOLCHAIN) is not supported.$(COLOR_RESET)\nSupported toolchains: $(TOOLCHAINS_SUPPORTED)" 1>&2) + EXPECT_ERRORS := 1 + endif + + # If there is a blacklist, then test if the board is blacklisted. + ifneq (,$(TOOLCHAINS_BLACKLIST)) + ifneq (,$(filter $(TOOLCHAIN),$(TOOLCHAINS_BLACKLIST))) + $(shell $(COLOR_ECHO) "$(COLOR_RED)The selected TOOLCHAIN=$(TOOLCHAIN) is blacklisted:$(COLOR_RESET) $(TOOLCHAINS_BLACKLIST)" 1>&2) + EXPECT_ERRORS := 1 + endif + endif + ifneq (, $(EXPECT_CONFLICT)) $(shell $(COLOR_ECHO) "\n$(COLOR_YELLOW)EXPECT undesired behaviour!$(COLOR_RESET)" 1>&2) endif