correct gcc version major comparison

This commit is contained in:
hathach 2023-11-23 12:07:59 +07:00
parent e54a2c4f3c
commit 1a98f5389c
No known key found for this signature in database
GPG Key ID: F5D50C6D51D17CBA
2 changed files with 4 additions and 4 deletions

View File

@ -10,6 +10,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy
SIZE = $(CROSS_COMPILE)size
CC_VERSION := $(shell $(CC) -dumpversion)
CC_VERSION_MAJOR = $(firstword $(subst ., ,$(CC_VERSION)))
# ---------------------------------------
# Compiler Flags
@ -73,6 +74,6 @@ LDFLAGS += -Wl,--print-memory-usage
endif
# from version 12
ifeq (12,$(firstword $(sort 12 $(CC_VERSION))))
ifeq ($(shell expr $(CC_VERSION_MAJOR) \>= 12),1)
LDFLAGS += -Wl,--no-warn-rwx-segment
endif

View File

@ -40,6 +40,5 @@ INC += \
SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_$(MCU_VARIANT).s
SRC_S_IAR += $(ST_CMSIS)/Source/Templates/iar/startup_$(MCU_VARIANT).s
# flash target ROM bootloader
flash-dfu-util: $(BUILD)/$(PROJECT).bin
dfu-util -R -a 0 --dfuse-address 0x08000000 -D $<
# flash target ROM bootloader: flash-dfu-util
DFU_UTIL_OPTION = -a 0 --dfuse-address 0x08000000