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)
|
2018-06-07 08:29:47 +00:00
|
|
|
LDFLAGS += -Wl,--gc-sections
|
|
|
|
LDFLAGS += -Wl,--sort-section=alignment
|
|
|
|
LDFLAGS += -Wl,-Map=$(@:.elf=-$(TARGET).map)
|
|
|
|
LDFLAGS += -Wl,--cref
|
|
|
|
LDFLAGS += -Wl,--no-warn-mismatch
|
|
|
|
|
|
|
|
TARGET_LIBFLAGS := -Wl,--start-group $(TARGET_LIBFILES) -lc -lgcc -lm -lnosys -Wl,--end-group
|
2017-11-29 14:46:26 +00:00
|
|
|
|
|
|
|
OBJCOPY_FLAGS += --gap-fill 0xff
|
|
|
|
|
|
|
|
### Build syscalls for newlib
|
|
|
|
MODULES += os/lib/newlib
|
|
|
|
|
2018-06-07 08:29:47 +00:00
|
|
|
CPU_STARTFILES := ${addprefix $(OBJECTDIR)/,${call oname, $(CPU_START_SOURCEFILES)}}
|
2017-11-29 14:46:26 +00:00
|
|
|
|
|
|
|
### Compilation rules
|
|
|
|
CUSTOM_RULE_LINK = 1
|
|
|
|
|
2017-12-17 21:31:39 +00:00
|
|
|
.SECONDEXPANSION:
|
|
|
|
|
2018-06-07 08:29:47 +00:00
|
|
|
%.elf: $(CPU_STARTFILES) $$(CONTIKI_OBJECTFILES) $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES)
|
2017-11-29 14:46:26 +00:00
|
|
|
$(TRACE_LD)
|
2018-06-07 08:29:47 +00:00
|
|
|
$(Q)$(LD) $(LDFLAGS) ${filter %.o %.a,$^} $(TARGET_LIBFLAGS) -o $@
|
2017-11-29 14:46:26 +00:00
|
|
|
|
|
|
|
include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m
|