2019-02-22 23:42:08 +01:00
|
|
|
# Target architecture for the build. Use msp430-elf if you are unsure.
|
2020-09-08 22:28:41 +02:00
|
|
|
TARGET_ARCH_MSP430 ?= msp430-elf
|
|
|
|
TARGET_ARCH ?= $(TARGET_ARCH_MSP430)
|
2019-02-22 23:42:08 +01:00
|
|
|
|
2023-06-13 15:56:24 +02:00
|
|
|
MSP430_SUPPORT_FILES ?= $(RIOTCPU)/msp430/vendor/msp430-gcc-support-files
|
2015-09-16 17:06:08 +02:00
|
|
|
|
|
|
|
# define build specific options
|
2019-02-22 23:42:08 +01:00
|
|
|
CFLAGS_CPU = -mmcu=$(CPU_MODEL) -isystem $(MSP430_SUPPORT_FILES)/include
|
2016-07-31 00:17:55 +02:00
|
|
|
CFLAGS_LINK = -ffunction-sections -fdata-sections
|
2019-02-22 23:42:08 +01:00
|
|
|
CFLAGS_DBG ?= -g -gdwarf-2
|
2015-09-16 17:06:08 +02:00
|
|
|
CFLAGS_OPT ?= -Os
|
2019-02-22 23:42:08 +01:00
|
|
|
|
2019-08-27 16:06:41 +02:00
|
|
|
CFLAGS += $(CFLAGS_CPU) $(CFLAGS_LINK) $(CFLAGS_DBG) $(CFLAGS_OPT)
|
|
|
|
ASFLAGS += $(CFLAGS_CPU) --defsym $(CPU_MODEL)=1 $(CFLAGS_DBG)
|
2019-02-22 23:42:08 +01:00
|
|
|
|
2023-07-01 12:29:19 +02:00
|
|
|
BINUTILS_VERSION := $(shell $(PREFIX)ld --version | grep -Eo '[0-9]\.[0-9]+$$')
|
2023-04-19 17:46:17 +02:00
|
|
|
NEEDS_NEW_LINKER_SCRIPT := $(call version_is_greater_or_equal,$(BINUTILS_VERSION),2.40)
|
|
|
|
|
2019-02-22 23:42:08 +01:00
|
|
|
LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT)
|
2023-04-19 17:46:17 +02:00
|
|
|
LINKFLAGS += -Wl,--gc-sections
|
|
|
|
LINKFLAGS += -Wl,-L$(MSP430_SUPPORT_FILES)/include
|
2023-06-13 15:56:24 +02:00
|
|
|
LINKFLAGS += -Wl,-L$(RIOTCPU)/msp430/ldscripts
|
2023-04-19 17:46:17 +02:00
|
|
|
|
|
|
|
ifeq (1,$(NEEDS_NEW_LINKER_SCRIPT))
|
|
|
|
LINKFLAGS += -T riot-$(CPU_MODEL).ld
|
|
|
|
else
|
|
|
|
LINKFLAGS += -T $(MSP430_SUPPORT_FILES)/include/$(CPU_MODEL).ld
|
2023-06-13 15:56:24 +02:00
|
|
|
LINKFLAGS += -T $(RIOTCPU)/msp430/ldscripts/msp430_common.ld
|
2023-06-14 16:18:15 +02:00
|
|
|
LINKFLAGS += -T $(RIOTCPU)/msp430/ldscripts/$(CPU_FAM).ld
|
2023-06-13 15:56:24 +02:00
|
|
|
LINKFLAGS += $(RIOTCPU)/msp430/ldscripts/xfa.ld
|
2023-04-19 17:46:17 +02:00
|
|
|
endif
|
2019-08-28 19:43:17 +02:00
|
|
|
|
|
|
|
OPTIONAL_CFLAGS_BLACKLIST += -fdiagnostics-color
|
|
|
|
OPTIONAL_CFLAGS_BLACKLIST += -Wformat-overflow
|
|
|
|
OPTIONAL_CFLAGS_BLACKLIST += -Wformat-truncation
|
2019-08-28 18:40:38 +02:00
|
|
|
OPTIONAL_CFLAGS_BLACKLIST += -gz
|