Merge pull request #9730 from miri64/make/enh/toolchain-supported-list
make: provide support for listing supported and blacklisting toolchains
This commit is contained in:
commit
623e3e156d
@ -241,6 +241,9 @@ include $(RIOTBOARD)/$(BOARD)/Makefile.include
|
|||||||
INCLUDES += -I$(RIOTCPU)/$(CPU)/include
|
INCLUDES += -I$(RIOTCPU)/$(CPU)/include
|
||||||
include $(RIOTCPU)/$(CPU)/Makefile.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
|
# Import all toolchain settings
|
||||||
include $(RIOTMAKE)/toolchain/$(TOOLCHAIN).inc.mk
|
include $(RIOTMAKE)/toolchain/$(TOOLCHAIN).inc.mk
|
||||||
|
|
||||||
@ -598,6 +601,20 @@ ifneq (, $(filter all, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all)))
|
|||||||
endif
|
endif
|
||||||
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))
|
ifneq (, $(EXPECT_CONFLICT))
|
||||||
$(shell $(COLOR_ECHO) "\n$(COLOR_YELLOW)EXPECT undesired behaviour!$(COLOR_RESET)" 1>&2)
|
$(shell $(COLOR_ECHO) "\n$(COLOR_YELLOW)EXPECT undesired behaviour!$(COLOR_RESET)" 1>&2)
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -15,6 +15,7 @@ ifneq (,$(ROM_START_ADDR)$(RAM_START_ADDR)$(ROM_LEN)$(RAM_LEN))
|
|||||||
LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_ram_length=$(RAM_LEN)
|
LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_ram_length=$(RAM_LEN)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
TOOLCHAINS_SUPPORTED = gnu llvm
|
||||||
|
|
||||||
# Only define the linker symbol if the variable is set
|
# Only define the linker symbol if the variable is set
|
||||||
# The variable can be set using target specific variable thanks to lazy evaluation
|
# The variable can be set using target specific variable thanks to lazy evaluation
|
||||||
|
|||||||
@ -10,3 +10,5 @@ USEMODULE += periph_uart
|
|||||||
|
|
||||||
# include common peripheral initialization
|
# include common peripheral initialization
|
||||||
USEMODULE += periph_common
|
USEMODULE += periph_common
|
||||||
|
|
||||||
|
TOOLCHAINS_SUPPORTED = gnu llvm
|
||||||
|
|||||||
@ -9,17 +9,19 @@ buildtest:
|
|||||||
@ \
|
@ \
|
||||||
RESULT=true ; \
|
RESULT=true ; \
|
||||||
for board in $(BOARDS); do \
|
for board in $(BOARDS); do \
|
||||||
$(COLOR_ECHO) -n "Building for $$board ... " ; \
|
if BOARD=$${board} $(MAKE) check-toolchain-supported > /dev/null 2>&1; then \
|
||||||
BOARD=$${board} RIOT_CI_BUILD=1 RIOT_VERSION_OVERRIDE=buildtest \
|
$(COLOR_ECHO) -n "Building for $$board ... " ; \
|
||||||
$(MAKE) clean all -j $(NPROC) $(BUILDTEST_MAKE_REDIRECT); \
|
BOARD=$${board} RIOT_CI_BUILD=1 RIOT_VERSION_OVERRIDE=buildtest \
|
||||||
RES=$$? ; \
|
$(MAKE) clean all -j $(NPROC) $(BUILDTEST_MAKE_REDIRECT); \
|
||||||
if [ $$RES -eq 0 ]; then \
|
RES=$$? ; \
|
||||||
$(COLOR_ECHO) "$(COLOR_GREEN)success.$(COLOR_RESET)" ; \
|
if [ $$RES -eq 0 ]; then \
|
||||||
else \
|
$(COLOR_ECHO) "$(COLOR_GREEN)success.$(COLOR_RESET)" ; \
|
||||||
$(COLOR_ECHO) "$(COLOR_RED)failed!$(COLOR_RESET)" ; \
|
else \
|
||||||
RESULT=false ; \
|
$(COLOR_ECHO) "$(COLOR_RED)failed!$(COLOR_RESET)" ; \
|
||||||
fi ; \
|
RESULT=false ; \
|
||||||
$(MAKE) clean-intermediates >/dev/null 2>&1 || true; \
|
fi ; \
|
||||||
|
$(MAKE) clean-intermediates >/dev/null 2>&1 || true; \
|
||||||
|
fi; \
|
||||||
done ; \
|
done ; \
|
||||||
$${RESULT}
|
$${RESULT}
|
||||||
endif # BUILD_IN_DOCKER
|
endif # BUILD_IN_DOCKER
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
.PHONY: info-objsize info-buildsizes info-build info-boards-supported \
|
.PHONY: info-objsize info-buildsizes info-build info-boards-supported \
|
||||||
info-features-missing info-modules info-cpu \
|
info-features-missing info-modules info-cpu \
|
||||||
info-features-provided info-features-required \
|
info-features-provided info-features-required \
|
||||||
info-debug-variable-%
|
info-debug-variable-% info-toolchains-supported \
|
||||||
|
check-toolchain-supported
|
||||||
|
|
||||||
info-objsize:
|
info-objsize:
|
||||||
@case "$(SORTROW)" in \
|
@case "$(SORTROW)" in \
|
||||||
@ -130,3 +131,9 @@ info-features-missing:
|
|||||||
|
|
||||||
info-debug-variable-%:
|
info-debug-variable-%:
|
||||||
@echo $($*)
|
@echo $($*)
|
||||||
|
|
||||||
|
info-toolchains-supported:
|
||||||
|
@echo $(filter-out $(TOOLCHAINS_BLACKLIST),$(TOOLCHAINS_SUPPORTED))
|
||||||
|
|
||||||
|
check-toolchain-supported:
|
||||||
|
@exit $(if $(filter $(TOOLCHAIN),$(filter-out $(TOOLCHAINS_BLACKLIST),$(TOOLCHAINS_SUPPORTED))),0,1)
|
||||||
|
|||||||
@ -36,6 +36,8 @@ export PYTHONPATH # Python default search path for module filesi, wit
|
|||||||
export FEATURES_REQUIRED # List of required features by the application
|
export FEATURES_REQUIRED # List of required features by the application
|
||||||
export FEATURES_PROVIDED # List of provided features by the board
|
export FEATURES_PROVIDED # List of provided features by the board
|
||||||
export FEATURES_OPTIONAL # List of nice to have features
|
export FEATURES_OPTIONAL # List of nice to have features
|
||||||
|
# TOOLCHAINS_SUPPORTED # List of supported toolchains by an MCU (gnu/llvm/...).
|
||||||
|
# TOOLCHAINS_BLACKLISTED # List of unspported toolchains for a module or an application.
|
||||||
|
|
||||||
export TARGET_ARCH # The target platform name, in GCC triple notation, e.g. "arm-none-eabi", "i686-elf", "avr"
|
export TARGET_ARCH # The target platform name, in GCC triple notation, e.g. "arm-none-eabi", "i686-elf", "avr"
|
||||||
export PREFIX # The prefix of the toolchain commands, usually "$(TARGET_ARCH)-", e.g. "arm-none-eabi-" or "msp430-".
|
export PREFIX # The prefix of the toolchain commands, usually "$(TARGET_ARCH)-", e.g. "arm-none-eabi-" or "msp430-".
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user