nes-proj/arch/cpu/arm/cortex-m/cm3/Makefile.cm3

27 lines
775 B
Makefile
Raw Normal View History

2017-11-29 14:46:26 +00:00
CONTIKI_ARM_DIRS += cortex-m/cm3
CFLAGS += -mcpu=cortex-m3
LDFLAGS += -mcpu=cortex-m3 -nostartfiles
LDFLAGS += -T $(LDSCRIPT)
LDFLAGS += -Wl,--gc-sections,--sort-section=alignment
LDFLAGS += -Wl,-Map=$(@:.elf=-$(TARGET).map),--cref,--no-warn-mismatch
OBJCOPY_FLAGS += --gap-fill 0xff
### Build syscalls for newlib
MODULES += os/lib/newlib
CPU_STARTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CPU_START_SOURCEFILES)}}
### Compilation rules
CUSTOM_RULE_LINK = 1
.SECONDEXPANSION:
%.elf: $(CPU_STARTFILES) $$(CONTIKI_OBJECTFILES) %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(LDSCRIPT)
2017-11-29 14:46:26 +00:00
$(TRACE_LD)
$(Q)$(LD) $(LDFLAGS) ${filter-out $(LDSCRIPT) %.a,$^} ${filter %.a,$^} $(TARGET_LIBFILES) -lm -o $@
include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m