1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/arm7_common/Makefile.include
Marian Buschsieweke 7c1949341e
build system: Overwrite TARGET_ARCH per arch
Add `TARGET_ARCH_<ARCH>` for each architecture (e.g. `TARGET_ARCH_CORTEX` for
Cortex M) to allow users to overwrite the target triple for a specific arch
from ~/.profile or ~/.bashrc (or the like) without overwriting it for all others
as well.
2020-09-08 22:28:41 +02:00

23 lines
818 B
Makefile

# Target architecture for the build. Use arm-none-eabi if you are unsure.
TARGET_ARCH_ARM7 ?= arm-none-eabi
TARGET_ARCH ?= $(TARGET_ARCH_ARM7)
INCLUDES += -I$(RIOTBASE)/cpu/arm7_common/include/
# currently only arm7tdmi-s is supported by RIOT, but allow overriding MCPU
# if someone wants to add support for other ARM7 CPUs
MCPU ?= arm7tdmi-s
CFLAGS_CPU = -mcpu=$(MCPU)
CFLAGS_LINK = -ffunction-sections -fdata-sections -fno-builtin -fshort-enums
CFLAGS_DBG ?= -ggdb -g3
CFLAGS_OPT ?= -Os
CFLAGS += $(CFLAGS_CPU) $(CFLAGS_LINK) $(CFLAGS_DBG) $(CFLAGS_OPT)
ASFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG)
LINKFLAGS += -T$(RIOTCPU)/$(CPU)/ldscripts/$(CPU).ld
LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT) -static -lgcc -nostartfiles
LINKFLAGS += -Wl,--gc-sections
UNDEF += $(BINDIR)/cpu/startup.o