diff --git a/Makefile b/Makefile index ebf45b515..f0e7e9720 100644 --- a/Makefile +++ b/Makefile @@ -267,6 +267,7 @@ $(1): fw_$(1)_opfw fw_$(1): fw_$(1)_opfw fw_$(1)_%: uavobjects_flight + $(V1) $$(ARM_GCC_VERSION_CHECK_TEMPLATE) $(V1) $(MKDIR) -p $(BUILD_DIR)/fw_$(1)/dep $(V1) cd $(ROOT_DIR)/flight/targets/$(2) && \ $$(MAKE) -r --no-print-directory \ @@ -294,6 +295,7 @@ bl_$(1): bl_$(1)_bin bl_$(1)_bino: bl_$(1)_bin bl_$(1)_%: + $(V1) $$(ARM_GCC_VERSION_CHECK_TEMPLATE) $(V1) $(MKDIR) -p $(BUILD_DIR)/bl_$(1)/dep $(V1) cd $(ROOT_DIR)/flight/targets/Bootloaders/$(2) && \ $$(MAKE) -r --no-print-directory \ diff --git a/make/tools.mk b/make/tools.mk index c1d97e741..a483531a8 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -239,6 +239,15 @@ endif arm_sdk_version: $(V1) $(ARM_SDK_PREFIX)gcc --version | head -n1 +# Template to check ARM toolchain version before building targets +define ARM_GCC_VERSION_CHECK_TEMPLATE + if ! $(ARM_SDK_PREFIX)gcc --version --specs=nano.specs >/dev/null 2>&1; then \ + $(ECHO) $(MSG_NOTICE) Please install ARM toolchain 4.7+ using \'make arm_sdk_install\' && \ + $(ECHO) $(MSG_NOTICE) Older ARM SDKs do not support new \'--specs=nano.specs\' option && \ + exit 1; \ + fi +endef + ############################## # # Qt SDK