2017-11-29 14:46:01 +00:00
|
|
|
CONTIKI_ARM_DIRS += cortex-m/cm4
|
|
|
|
|
|
|
|
CFLAGS += -mcpu=cortex-m4
|
2018-02-05 16:18:08 +00:00
|
|
|
|
|
|
|
LDFLAGS += -mcpu=cortex-m4 -nostartfiles
|
|
|
|
LDFLAGS += -T $(LDSCRIPT)
|
|
|
|
LDFLAGS += -Wl,--gc-sections,--sort-section=alignment
|
|
|
|
LDFLAGS += -Wl,-Map=$(@:.elf=-$(TARGET).map),--cref,--no-warn-mismatch
|
|
|
|
|
2018-05-28 11:17:01 +00:00
|
|
|
TARGET_LIBFLAGS := -Wl,--start-group $(TARGET_LIBFILES) -lc -lgcc -lm -lnosys -Wl,--end-group
|
2018-02-06 15:22:02 +00:00
|
|
|
|
2018-02-05 16:18:08 +00:00
|
|
|
OBJCOPY_FLAGS += --gap-fill 0xff
|
|
|
|
|
|
|
|
### Build syscalls for newlib
|
|
|
|
MODULES += os/lib/newlib
|
|
|
|
|
|
|
|
CPU_STARTFILES := ${addprefix $(OBJECTDIR)/,${call oname, $(CPU_START_SOURCEFILES)}}
|
2017-11-29 14:46:01 +00:00
|
|
|
|
|
|
|
### Compilation rules
|
2018-02-05 16:18:08 +00:00
|
|
|
CUSTOM_RULE_LINK = 1
|
|
|
|
|
|
|
|
.SECONDEXPANSION:
|
2017-11-29 14:46:01 +00:00
|
|
|
|
2018-02-06 15:46:25 +00:00
|
|
|
%.elf: $(CPU_STARTFILES) $$(CONTIKI_OBJECTFILES) %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(TARGET_LIBS)
|
2017-11-29 14:46:01 +00:00
|
|
|
$(TRACE_LD)
|
2018-05-28 11:17:01 +00:00
|
|
|
$(Q)$(LD) $(LDFLAGS) ${filter %.o %.a,$^} $(TARGET_LIBFLAGS) -o $@
|
2017-11-29 14:46:01 +00:00
|
|
|
|
|
|
|
include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m
|