summaryrefslogtreecommitdiff
path: root/mk/toolchain.mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk/toolchain.mk')
-rw-r--r--mk/toolchain.mk13
1 files changed, 11 insertions, 2 deletions
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)