2017-12-03 14:59:45 +00:00
|
|
|
CONTIKI_ARM_DIRS += cortex-m cortex-m/CMSIS
|
|
|
|
|
2018-09-23 16:57:47 +00:00
|
|
|
### Build syscalls for newlib
|
|
|
|
MODULES += os/lib/newlib
|
|
|
|
|
2018-10-13 18:59:01 +00:00
|
|
|
LDFLAGS += -T $(LDSCRIPT)
|
|
|
|
LDFLAGS += -Wl,--gc-sections,--sort-section=alignment
|
|
|
|
LDFLAGS += -Wl,-Map=$(CONTIKI_NG_PROJECT_MAP),--cref,--no-warn-mismatch
|
|
|
|
|
|
|
|
OBJCOPY_FLAGS += --gap-fill 0xff
|
|
|
|
|
|
|
|
CPU_STARTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CPU_START_SOURCEFILES)}}
|
|
|
|
|
|
|
|
### Resolve any potential circular dependencies between the linked libraries
|
|
|
|
### See: https://stackoverflow.com/questions/5651869/gcc-what-are-the-start-group-and-end-group-command-line-options/5651895
|
|
|
|
TARGET_LIBFLAGS := -Wl,--start-group $(TARGET_LIBFILES) -Wl,--end-group
|
|
|
|
|
2018-09-23 16:57:47 +00:00
|
|
|
CUSTOM_RULE_LINK = 1
|
|
|
|
|
2018-10-13 22:14:51 +00:00
|
|
|
OUT_ELF = $(BUILD_DIR_BOARD)/%.elf
|
|
|
|
|
2018-09-23 16:57:47 +00:00
|
|
|
.SECONDEXPANSION:
|
|
|
|
|
2018-10-13 22:14:51 +00:00
|
|
|
$(OUT_ELF): $(CPU_STARTFILES) $$(CONTIKI_OBJECTFILES) %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(LDSCRIPT) $(TARGET_LIBS)
|
2018-09-23 16:57:47 +00:00
|
|
|
$(TRACE_LD)
|
|
|
|
$(Q)$(LD) $(LDFLAGS) ${filter-out $(LDSCRIPT) %.a,$^} ${filter %.a,$^} $(TARGET_LIBFLAGS) -o $@
|
|
|
|
|
2018-11-23 09:35:41 +00:00
|
|
|
include $(ARCH_PATH)/cpu/arm/Makefile.arm
|