Skip to content
Snippets Groups Projects
Commit 1841aadf authored by George Oikonomou's avatar George Oikonomou
Browse files

Reduce makefile code duplication

parent 9280046c
Branches
No related tags found
No related merge requests found
...@@ -3,6 +3,18 @@ CONTIKI_ARM_DIRS += cortex-m cortex-m/CMSIS ...@@ -3,6 +3,18 @@ CONTIKI_ARM_DIRS += cortex-m cortex-m/CMSIS
### Build syscalls for newlib ### Build syscalls for newlib
MODULES += os/lib/newlib MODULES += os/lib/newlib
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
CUSTOM_RULE_LINK = 1 CUSTOM_RULE_LINK = 1
.SECONDEXPANSION: .SECONDEXPANSION:
......
...@@ -3,16 +3,7 @@ CONTIKI_ARM_DIRS += cortex-m/cm3 ...@@ -3,16 +3,7 @@ CONTIKI_ARM_DIRS += cortex-m/cm3
CFLAGS += -mcpu=cortex-m3 CFLAGS += -mcpu=cortex-m3
LDFLAGS += -mcpu=cortex-m3 -nostartfiles LDFLAGS += -mcpu=cortex-m3 -nostartfiles
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 TARGET_LIBFILES += -lm
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) -lm -Wl,--end-group
include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m
...@@ -3,16 +3,5 @@ CONTIKI_ARM_DIRS += cortex-m/cm4 ...@@ -3,16 +3,5 @@ CONTIKI_ARM_DIRS += cortex-m/cm4
CFLAGS += -mcpu=cortex-m4 CFLAGS += -mcpu=cortex-m4
LDFLAGS += -mcpu=cortex-m4 LDFLAGS += -mcpu=cortex-m4
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
include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment