Use a variable for the Contiki-NG archive file
Prevents having to hard-code the filename in multiple cpu/platform makefiles and allows us to easily rename it across the board in the future
This commit is contained in:
parent
ce540a8bca
commit
16d8c5b4f9
@ -10,6 +10,8 @@ WERROR ?= 1
|
||||
|
||||
include $(CONTIKI)/Makefile.identify-target
|
||||
|
||||
CONTIKI_NG_TARGET_LIB = contiki-ng-$(TARGET).a
|
||||
|
||||
ifeq ($(DEFINES),)
|
||||
-include Makefile.$(TARGET).defines
|
||||
ifneq ($(DEFINES),)
|
||||
@ -355,7 +357,7 @@ ifndef AROPTS
|
||||
endif
|
||||
|
||||
ifndef CUSTOM_RULE_ALLOBJS_TO_TARGETLIB
|
||||
contiki-$(TARGET).a: $(CONTIKI_OBJECTFILES)
|
||||
$(CONTIKI_NG_TARGET_LIB): $(CONTIKI_OBJECTFILES)
|
||||
$(TRACE_AR)
|
||||
$(Q)$(AR) $(AROPTS) $@ $^
|
||||
endif
|
||||
@ -365,7 +367,7 @@ ifndef LD
|
||||
endif
|
||||
|
||||
ifndef CUSTOM_RULE_LINK
|
||||
%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a
|
||||
%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(CONTIKI_NG_TARGET_LIB)
|
||||
$(TRACE_LD)
|
||||
$(Q)$(LD) $(LDFLAGS) $(TARGET_STARTFILES) ${filter-out %.a,$^} \
|
||||
${filter %.a,$^} $(TARGET_LIBFILES) -o $@
|
||||
|
@ -6,7 +6,7 @@ LDFLAGS += -mcpu=cortex-m4
|
||||
### Compilation rules
|
||||
CUSTOM_RULE_LINK=1
|
||||
|
||||
%.elf: $(TARGET_STARTFILES) %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a $(TARGET_LIBS)
|
||||
%.elf: $(TARGET_STARTFILES) %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(CONTIKI_NG_TARGET_LIB) $(TARGET_LIBS)
|
||||
$(TRACE_LD)
|
||||
$(Q)$(CC) $(LDFLAGS) ${filter %.o %.a,$^} -o $@
|
||||
|
||||
|
@ -197,7 +197,7 @@ PROJECT_OBJECTFILES += ${addprefix $(OBJECTDIR)/,$(CONTIKI_TARGET_MAIN:.c=.o)}
|
||||
mv $< $@
|
||||
|
||||
ifdef IAR
|
||||
%.ihex: %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a
|
||||
%.ihex: %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(CONTIKI_NG_TARGET_LIB)
|
||||
$(LD) $(LDFLAGSNO) -Fintel-extended $(TARGET_STARTFILES) ${filter-out %.a,$^} ${filter %.a,$^} $(TARGET_LIBFILES) -o $@
|
||||
else
|
||||
%.ihex: %.$(TARGET)
|
||||
|
@ -234,7 +234,7 @@ ABS_APPLIBS = $(addsuffix _$(JENNIC_CHIP_FAMILY).a,$(addprefix $(COMPONENTS_BASE
|
||||
|
||||
ifneq ($(wildcard $(SDK_BASE_DIR)/Components/Library/*),)
|
||||
# The SDK is fully installed, proceed to linking and objcopy to ready-to-upload .jn516x.bin file
|
||||
%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a $(ABS_APPLIBS)
|
||||
%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(CONTIKI_NG_TARGET_LIB) $(ABS_APPLIBS)
|
||||
echo ${filter %.a,$^}
|
||||
$(Q)$(CC) -Wl,--gc-sections $(LDFLAGS) -T$(LINKCMD) -o $@ -Wl,--start-group \
|
||||
$(patsubst /cygdrive/c/%,c:/%,${filter-out %.a,$^}) \
|
||||
@ -243,7 +243,7 @@ ifneq ($(wildcard $(SDK_BASE_DIR)/Components/Library/*),)
|
||||
$(OBJCOPY) -S -O binary $@ $@.bin
|
||||
else
|
||||
# The SDK does not include libraries, only build objects and libraries, skip linking
|
||||
%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a
|
||||
%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(CONTIKI_NG_TARGET_LIB)
|
||||
echo Creating empty $@
|
||||
touch $@
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user