]> granicus.if.org Git - esp-idf/commitdiff
build system: Add dependencies to component clean steps
authorAngus Gratton <angus@espressif.com>
Fri, 1 Sep 2017 07:28:13 +0000 (17:28 +1000)
committerAngus Gratton <gus@projectgus.com>
Mon, 4 Sep 2017 07:40:15 +0000 (17:40 +1000)
Build directory must exist, component_project_vars.mk must be generated if it is going to be.

components/bootloader/Makefile.projbuild
make/project.mk

index a8c10067b59939702ef0257a5337f196e3643947..7a35dc8ad172181a3259597eb95943ebd8225d45 100644 (file)
@@ -118,6 +118,6 @@ ifndef CONFIG_SECURE_BOOT_ENABLED
 all_binaries: $(BOOTLOADER_BIN)
 endif
 
-bootloader-clean:
+bootloader-clean: $(SDKCONFIG_MAKEFILE)
        $(BOOTLOADER_MAKE) app-clean
        rm -f $(SECURE_BOOTLOADER_KEY) $(BOOTLOADER_DIGEST_BIN)
index d2f3cfcd5af6dce3b2199f4e92b42764440513fd..195147bd861a55fbfcd4e5f470b33be742436aed 100644 (file)
@@ -361,10 +361,10 @@ endef
 define GenerateComponentTargets
 .PHONY: component-$(2)-build component-$(2)-clean
 
-component-$(2)-build: check-submodules
+component-$(2)-build: check-submodules $(call prereq_if_explicit, component-$(2)-clean) | $(BUILD_DIR_BASE)/$(2)
        $(call ComponentMake,$(1),$(2)) build
 
-component-$(2)-clean:
+component-$(2)-clean: | $(BUILD_DIR_BASE)/$(2) $(BUILD_DIR_BASE)/$(2)/component_project_vars.mk
        $(call ComponentMake,$(1),$(2)) clean
 
 $(BUILD_DIR_BASE)/$(2):
@@ -406,7 +406,7 @@ size-components: $(APP_ELF)
 
 # NB: this ordering is deliberate (app-clean before config-clean),
 # so config remains valid during all component clean targets
-config-clean: app-clean
+config-clean: app-clean $(call prereq_if_explicit,bootloader-clean)
 clean: config-clean
 
 # phony target to check if any git submodule listed in COMPONENT_SUBMODULES are missing