diff --git a/.gitignore b/.gitignore index 054f2748e..b984b1e5d 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ README.pdf /downloads /tools /build +# local changes only +make/local.mk diff --git a/Makefile b/Makefile index add849a2b..9f3ee3456 100644 --- a/Makefile +++ b/Makefile @@ -70,6 +70,8 @@ LINKER_DIR = $(ROOT)/src/main/target ## Build tools, so we all share the same versions # import macros common to all supported build systems include $(ROOT)/make/system-id.mk +# developer preferences, edit these at will, they'll be gitignored +include $(ROOT)/make/local.mk # configure some directories that are relative to wherever ROOT_DIR is located TOOLS_DIR := $(ROOT)/tools @@ -591,10 +593,10 @@ CCACHE := endif # Tool names -CC := $(CCACHE) $(ARM_SDK_DIR)/bin/arm-none-eabi-gcc -CPP := $(CCACHE) $(ARM_SDK_DIR)/bin/arm-none-eabi-g++ -OBJCOPY := $(ARM_SDK_DIR)/bin/arm-none-eabi-objcopy -SIZE := $(ARM_SDK_DIR)/bin/arm-none-eabi-size +CC := $(CCACHE) $(ARM_SDK_PREFIX)gcc +CPP := $(CCACHE) $(ARM_SDK_PREFIX)g++ +OBJCOPY := $(ARM_SDK_PREFIX)objcopy +SIZE := $(ARM_SDK_PREFIX)size # # Tool options. diff --git a/make/local.mk b/make/local.mk new file mode 100644 index 000000000..1b66457a5 --- /dev/null +++ b/make/local.mk @@ -0,0 +1,2 @@ +# override the toolchain version, should match the output from of your version of the toolchain: $(arm-none-eabi-gcc -dumpversion) +#GCC_REQUIRED_VERSION=5.4.1 diff --git a/make/tools.mk b/make/tools.mk index 77aa88a6c..299086b1b 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -15,6 +15,8 @@ # Set up ARM (STM32) SDK ARM_SDK_DIR := $(TOOLS_DIR)/gcc-arm-none-eabi-5_4-2016q2 +# Checked below, Should match the output of $(shell arm-none-eabi-gcc -dumpversion) +GCC_REQUIRED_VERSION := 5.4.1 .PHONY: arm_sdk_install @@ -271,13 +273,14 @@ 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 - ifndef IGNORE_MISSING_TOOLCHAIN - ifeq (,$(findstring _install,$(MAKECMDGOALS))) - $(error **WARNING** ARM-SDK not in $(ARM_SDK_DIR) Please run 'make arm_sdk_install') - endif +else ifeq (,$(findstring _install,$(MAKECMDGOALS))) + 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 **WARNING** your arm-none-eabi-gcc is '$(GCC_VERSION)', but '$(GCC_REQUIRED_VERSION)' is expected. Run 'make arm_sdk_install' to install automatically in the tools folder of this repo) endif # not installed, hope it's in the path... ARM_SDK_PREFIX ?= arm-none-eabi-