summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/buildsystem.mk2
-rw-r--r--mk/toolchain.mk13
2 files changed, 12 insertions, 3 deletions
diff --git a/mk/buildsystem.mk b/mk/buildsystem.mk
index 39341ec..9c7d96e 100644
--- a/mk/buildsystem.mk
+++ b/mk/buildsystem.mk
@@ -65,7 +65,7 @@ randconfig: basic
basic:
$(Q)$(MAKE) -f scripts/Makefile.build obj=scripts/basic
-clean: rmallpath
+clean: toolchain_clean rmallpath
$(Q)$(MAKE) -f scripts/Makefile.clean obj=scripts/kconfig
$(Q)$(MAKE) -f scripts/Makefile.clean obj=scripts/basic
$(Q)rm -rf .config kbuild.log .fakeroot*
diff --git a/mk/toolchain.mk b/mk/toolchain.mk
index b9f8543..2d7999e 100644
--- a/mk/toolchain.mk
+++ b/mk/toolchain.mk
@@ -142,8 +142,10 @@ define ___embtk_toolchain_decompress
endef
define __embtk_toolchain_decompress
- $(call embtk_pinfo,"Decompressing $(GNU_TARGET)/$(EMBTK_MCU_FLAG) toolchain - please wait...")
- $(___embtk_toolchain_decompress)
+ $(if $(call __embtk_mk_pathnotexist,$(TOOLCHAIN_DIR)/.decompressed),
+ $(call embtk_pinfo,"Decompressing $(GNU_TARGET)/$(EMBTK_MCU_FLAG) toolchain - please wait...")
+ $(___embtk_toolchain_decompress)
+ touch $(TOOLCHAIN_DIR)/.decompressed)
endef
__embtk_toolchain_addons-y = $(patsubst %_install,%,$(TOOLCHAIN_ADDONS-y))
@@ -187,6 +189,13 @@ __embtk_toolchain_buildargs += $(__embtk_toolchain_addons_inst)
buildtoolchain:
$(Q)$(call __embtk_toolchain_build,$(__embtk_toolchain_buildargs))
+define __embtk_toolchain_clean
+ rm -rf $(TOOLCHAIN_DIR)/.decompressed
+endef
+
+toolchain_clean:
+ $(Q)$(__embtk_toolchain_clean)
+
# Download target for offline build
TOOLCHAIN_ALL_DEPS := $(TOOLCHAIN_PRE_DEPS) $(TOOLCHAIN_DEPS)
TOOLCHAIN_ALL_DEPS += $(TOOLCHAIN_ADDONS_DEPS)