diff --git a/build.mk b/build.mk index 3246f12..26dc190 100644 --- a/build.mk +++ b/build.mk @@ -124,11 +124,13 @@ @$(MKDIR) -p $(1) endef -.PHONY: all clean user_target user_clean_target +.PHONY: all clean clean_first user_target user_clean_target all: user_target -clean: user_clean_target +clean: clean_first user_clean_target + +clean_first: @$(ECHO) Cleaning application files ... -$(RM) -rf $(OUTDIR) $(OBJDIR) @@ -196,9 +198,4 @@ $(foreach source, $(CSRCS), $(eval $(call COMPILE_C_SOURCE, $(OBJDIR)/$(notdir $(source:%.c=%.o)), $(source), $(CFLAGS)))) $(foreach source, $(CXXSRCS), $(eval $(call COMPILE_CXX_SOURCE, $(OBJDIR)/$(notdir $(source:%.cpp=%.o)), $(source), $(CXXFLAGS)))) -$(eval $(call CONFIG_TARGETS)) -$(eval $(call USER_TARGETS)) - -$(eval $(call USER_DEPENDENCY_RULES)) - -include $(ALLOBJS:%.o=%.d) diff --git a/config_cortex_m0.mk b/config_cortex_m0.mk index 5bb47ca..05e2997 100644 --- a/config_cortex_m0.mk +++ b/config_cortex_m0.mk @@ -22,12 +22,8 @@ PLATFORM_LDFLAGS = -nostdlib -nostartfiles -nodefaultlibs -Wl,-static,-gc-sections -define CONFIG_TARGETS +include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/build.mk $(OUTDIR)/$(TARGET_VER).hex: $(OUTDIR)/$(TARGET_VER).elf | $(OUTDIR)/ $(OBJCOPY) -O ihex $(OUTDIR)/$(TARGET_VER).elf $(OUTDIR)/$(TARGET_VER).hex @echo - -endef - -include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/build.mk diff --git a/config_cortex_m3.mk b/config_cortex_m3.mk index 029dcf8..45bbd84 100644 --- a/config_cortex_m3.mk +++ b/config_cortex_m3.mk @@ -22,12 +22,8 @@ PLATFORM_LDFLAGS = -nostdlib -nostartfiles -nodefaultlibs -Wl,-static,-gc-sections -define CONFIG_TARGETS +include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/build.mk $(OUTDIR)/$(TARGET_VER).hex: $(OUTDIR)/$(TARGET_VER).elf | $(OUTDIR)/ $(OBJCOPY) -O ihex $(OUTDIR)/$(TARGET_VER).elf $(OUTDIR)/$(TARGET_VER).hex @echo - -endef - -include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/build.mk diff --git a/config_cortex_m4.mk b/config_cortex_m4.mk index 9e10343..76ac1ff 100644 --- a/config_cortex_m4.mk +++ b/config_cortex_m4.mk @@ -21,12 +21,8 @@ PLATFORM_LDFLAGS = -nostdlib -nostartfiles -nodefaultlibs -Wl,-static,-gc-sections -define CONFIG_TARGETS +include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/build.mk $(OUTDIR)/$(TARGET_VER).hex: $(OUTDIR)/$(TARGET_VER).elf | $(OUTDIR)/ $(OBJCOPY) -O ihex $(OUTDIR)/$(TARGET_VER).elf $(OUTDIR)/$(TARGET_VER).hex - @echo - -endef - -include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/build.mk + @echo \ No newline at end of file diff --git a/config_cortex_m4f.mk b/config_cortex_m4f.mk index 176b52b..c100639 100644 --- a/config_cortex_m4f.mk +++ b/config_cortex_m4f.mk @@ -22,12 +22,8 @@ PLATFORM_LDFLAGS = -nostdlib -nostartfiles -nodefaultlibs -Wl,-static,-gc-sections -define CONFIG_TARGETS +include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/build.mk $(OUTDIR)/$(TARGET_VER).hex: $(OUTDIR)/$(TARGET_VER).elf | $(OUTDIR)/ $(OBJCOPY) -O ihex $(OUTDIR)/$(TARGET_VER).elf $(OUTDIR)/$(TARGET_VER).hex @echo - -endef - -include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/build.mk diff --git a/config_cortex_m7.mk b/config_cortex_m7.mk index 7b5401a..4da7c92 100644 --- a/config_cortex_m7.mk +++ b/config_cortex_m7.mk @@ -22,12 +22,9 @@ PLATFORM_LDFLAGS = -nostdlib -nostartfiles -nodefaultlibs -Wl,-static,-gc-sections -define CONFIG_TARGETS +include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/build.mk $(OUTDIR)/$(TARGET_VER).hex: $(OUTDIR)/$(TARGET_VER).elf | $(OUTDIR)/ $(OBJCOPY) -O ihex $(OUTDIR)/$(TARGET_VER).elf $(OUTDIR)/$(TARGET_VER).hex @echo - -endef - -include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/build.mk + \ No newline at end of file diff --git a/config_linux.mk b/config_linux.mk index ed992f3..d7c33c0 100644 --- a/config_linux.mk +++ b/config_linux.mk @@ -20,7 +20,8 @@ PLATFORM_LDFLAGS = -define CONFIG_TARGETS +include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/build.mk + $(OUTDIR)/$(TARGET_VER): $(OUTDIR)/$(TARGET_VER).elf | $(OUTDIR)/ @$(CP) -av $(OUTDIR)/$(TARGET_VER).elf $(OUTDIR)/$(TARGET_VER) @@ -28,7 +29,3 @@ $(OUTDIR)/$(TARGET): $(OUTDIR)/$(TARGET_VER).elf | $(OUTDIR)/ @$(CP) -av $(OUTDIR)/$(TARGET_VER).elf $(OUTDIR)/$(TARGET) endif -endef - - -include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/build.mk