CONTIKI_ARM_DIRS += cortex-m/cm4 CFLAGS += -mcpu=cortex-m4 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 TARGET_LIBFLAGS := $(TARGET_LIBFILES) -gcc -lm -lnosys -lc 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) $(TARGET_LIBS) $(TRACE_LD) $(Q)$(LD) $(LDFLAGS) ${filter %.o %.a,$^} -Wl,--start-group $(TARGET_LIBFLAGS) -Wl,--end-group -o $@ include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m