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

Always create example.$(TARGET) under build/ and then copy to .

parent d89cca83
No related branches found
No related tags found
No related merge requests found
...@@ -395,12 +395,16 @@ ifndef LD ...@@ -395,12 +395,16 @@ ifndef LD
endif endif
ifndef CUSTOM_RULE_LINK ifndef CUSTOM_RULE_LINK
%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(CONTIKI_NG_TARGET_LIB) $(BUILD_DIR_BOARD)/%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(CONTIKI_NG_TARGET_LIB)
$(TRACE_LD) $(TRACE_LD)
$(Q)$(LD) $(LDFLAGS) $(TARGET_STARTFILES) ${filter-out %.a,$^} \ $(Q)$(LD) $(LDFLAGS) $(TARGET_STARTFILES) ${filter-out %.a,$^} \
${filter %.a,$^} $(TARGET_LIBFILES) -o $@ ${filter %.a,$^} $(TARGET_LIBFILES) -o $@
endif endif
%.$(TARGET): $(BUILD_DIR_BOARD)/%.$(TARGET)
$(TRACE_CP)
$(Q)cp $< $@
%.ramprof: %.$(TARGET) %.ramprof: %.$(TARGET)
$(NM) -S -td --size-sort $< | grep -i " [abdrw] " | cut -d' ' -f2,4 $(NM) -S -td --size-sort $< | grep -i " [abdrw] " | cut -d' ' -f2,4
...@@ -458,9 +462,9 @@ ifeq ($(findstring $(TARGET),native cooja),) ...@@ -458,9 +462,9 @@ ifeq ($(findstring $(TARGET),native cooja),)
include $(CONTIKI)/Makefile.embedded include $(CONTIKI)/Makefile.embedded
endif endif
# Don't treat %.$(TARGET) as an intermediate file because it is # Don't treat $(BUILD_DIR_BOARD)/%.$(TARGET) and $(TARGET) as intermediate
# in fact the primary target. # files because for many platforms they are in fact the primary target.
.PRECIOUS: %.$(TARGET) .PRECIOUS: $(BUILD_DIR_BOARD)/%.$(TARGET) %.$(TARGET)
# Cancel the predefined implict rule for compiling and linking # Cancel the predefined implict rule for compiling and linking
# a single C source into a binary to force GNU make to consider # a single C source into a binary to force GNU make to consider
......
...@@ -77,6 +77,6 @@ $(OUT_LST): $(OUT_ELF) ...@@ -77,6 +77,6 @@ $(OUT_LST): $(OUT_ELF)
### We don't really need the .hex and .bin for the .$(TARGET) but let's make ### We don't really need the .hex and .bin for the .$(TARGET) but let's make
### sure they get built ### sure they get built
%.$(TARGET): $(OUT_ELF) $(OUT_HEX) $(OUT_BIN) $(BUILD_DIR_BOARD)/%.$(TARGET): $(OUT_ELF) $(OUT_HEX) $(OUT_BIN)
$(TRACE_CP) $(TRACE_CP)
$(Q)cp $< $@ $(Q)cp $< $@
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment