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
|
|
|
|
|
2017-12-17 21:31:39 +00:00
|
|
|
.SECONDEXPANSION:
|
|
|
|
|
2017-12-18 14:41:31 +00:00
|
|
|
%.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
|