Enabled setting of explicit ARM toolchain path in 'ARM_SDK_DIR'.

This commit is contained in:
mikeller 2017-03-20 23:13:13 +13:00
parent adbd448c0d
commit 55c0b622a4
1 changed files with 4 additions and 3 deletions

View File

@ -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