diff --git a/make/tools.mk b/make/tools.mk index 7a889ec3a7..c3f251404d 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -14,7 +14,7 @@ ############################## # Set up ARM (STM32) SDK -ARM_SDK_DIR := $(TOOLS_DIR)/gcc-arm-none-eabi-6-2017-q1-update +ARM_SDK_DIR ?= $(TOOLS_DIR)/gcc-arm-none-eabi-6-2017-q1-update # Checked below, Should match the output of $(shell arm-none-eabi-gcc -dumpversion) GCC_REQUIRED_VERSION ?= 6.3.1 @@ -286,16 +286,17 @@ zip_clean: # ############################## -GCC_VERSION=$(shell arm-none-eabi-gcc -dumpversion) ifeq ($(shell [ -d "$(ARM_SDK_DIR)" ] && echo "exists"), exists) ARM_SDK_PREFIX := $(ARM_SDK_DIR)/bin/arm-none-eabi- else ifeq (,$(findstring _install,$(MAKECMDGOALS))) + GCC_VERSION = $(shell arm-none-eabi-gcc -dumpversion) ifeq ($(GCC_VERSION),) $(error **ERROR** arm-none-eabi-gcc not in the PATH. Run 'make arm_sdk_install' to install automatically in the tools folder of this repo) else ifneq ($(GCC_VERSION), $(GCC_REQUIRED_VERSION)) $(error **ERROR** your arm-none-eabi-gcc is '$(GCC_VERSION)', but '$(GCC_REQUIRED_VERSION)' is expected. Override with 'GCC_REQUIRED_VERSION' in make/local.mk or run 'make arm_sdk_install' to install the right version automatically in the tools folder of this repo) endif - # not installed, hope it's in the path... + + # ARM tookchain is in the path, and the version is what's required. ARM_SDK_PREFIX ?= arm-none-eabi- endif