diff options
-rw-r--r-- | toolchain.inc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/toolchain.inc b/toolchain.inc index eb1f0876bd..640c793901 100644 --- a/toolchain.inc +++ b/toolchain.inc @@ -152,13 +152,14 @@ $(call init_stages) # Test for coreboot toolchain (except when explicitly not requested) ifneq ($(NOCOMPILE),1) -# only run if we're doing a build (not for tests, kconfig, ...) +# Only run if we're doing a build (not for tests, kconfig, ...) # rationale: gcc versions by Linux distributions tend to be quite messed up # llvm/clang also needs patches supplied by the coreboot build COMPILERFAIL:=0 IASLFAIL:=0 ifneq ($(CONFIG_ANY_TOOLCHAIN),y) +# Verify that the coreboot toolchain is being used. $(foreach arch,$(sort $(foreach stage,\ $(COREBOOT_STANDARD_STAGES),$(ARCH-$(stage)-y))), \ $(if $(shell if [ -n "$(CC_$(arch))" ]; then \ @@ -167,8 +168,8 @@ $(foreach arch,$(sort $(foreach stage,\ $(eval COMPILERFAIL:=1)\ $(warning The coreboot toolchain for '$(arch)'\ architecture was not found.))) -#if iasl doesn't match the current coreboot version, fail the test -#TODO: Figure out if iasl is even needed for the build. +# If iasl doesn't match the current coreboot version, fail the test +# TODO: Figure out if iasl is even needed for the build. $(if $(shell if [ -n "$(IASL)" ]; then \ $(IASL) -v 2>&1 | grep -q "$(shell util/crossgcc/buildgcc -s iasl)" || \ echo not-coreboot; else echo not-coreboot; fi), \ @@ -176,17 +177,20 @@ $(if $(shell if [ -n "$(IASL)" ]; then \ $(warning The coreboot toolchain version of iasl \ '$(shell util/crossgcc/buildgcc -s iasl)' was not found)) else #$(CONFIG_ANY_TOOLCHAIN) +# If the coreboot toolchain isn't being used, verify that there is A toolchain $(foreach arch,$(sort \ $(foreach stage,$(COREBOOT_STANDARD_STAGES),$(ARCH-$(stage)-y))), \ $(if $(CC_$(arch)),, $(eval COMPILERFAIL:=1) \ $(warning No compiler found for '$(arch)' architecture. \ Install one or use the coreboot toolchain?)) ) -#if iasl isn't present, fail -#TODO: Figure out if iasl is even needed for the build. +# If iasl isn't present, fail +# TODO: Figure out if iasl is even needed for the build. $(if $(IASL),, $(eval COMPILERFAIL:=1)$(eval IASLFAIL:=1) \ $(warning iasl not found. \ Please install it or use the coreboot toolchain.)) endif + +# If the compiler check failed, print out warnings ifeq ($(COMPILERFAIL),1) ifneq ($(XGCCPATH),) $(warning ) @@ -213,6 +217,8 @@ endif #($(COMPILERFAIL),1) endif #($(NOCOMPILE),1) +# Run the toolchain version checks if the requested target is 'test-toolchain' +# Checks the versions of GCC, binutils, clang, and IASL ifneq ($(MAKECMDGOALS),) ifneq ($(filter test-toolchain,$(MAKECMDGOALS)),) $(foreach arch, $(ARCH_SUPPORTED), \ @@ -244,5 +250,5 @@ $(if $(shell if [ -n "$(IASL)" ]; then $(IASL) -v 2>&1 | \ $(eval COMPILER_OUT_OF_DATE:=1)\ $(warning The coreboot toolchain version of iasl \ is not the current version)) -endif # ifneq ($(filter crossgcc_check%,$(MAKECMDGOALS)),) -endif # ifneq ($(MAKECMDGOALS),) +endif #($(filter crossgcc_check%,$(MAKECMDGOALS)),) +endif #($(MAKECMDGOALS),) |