diff --git a/Makefile.include b/Makefile.include index 66eef4c65ccd9..879525b53980b 100644 --- a/Makefile.include +++ b/Makefile.include @@ -688,7 +688,6 @@ BUILDDEPS += $(RIOTBUILD_CONFIG_HEADER_C) BUILDDEPS += pkg-prepare BUILDDEPS += $(APPDEPS) BUILDDEPS += $(MODULE_LIST_DIR) -BUILDDEPS += $(BUILD_DIR)/CACHEDIR.TAG # Build dependencies depend on clean (if a make goal), as clean may wipe them. # Without them depending on clean parallel builds occasionally fail due to @@ -755,11 +754,6 @@ $(_SUBMAKE_LIBS): $(APPLICATION_MODULE).module pkg-build $(GENSRC) print-size: $(ELFFILE) $(Q)$(SIZE) $(SIZEFLAGS) $< -$(BUILD_DIR)/CACHEDIR.TAG: - $(Q)mkdir -p "$(BUILD_DIR)" - $(Q)echo "Signature: 8a477f597d28d172789f06886806bc55" > "$@" - $(Q)echo "# This folder contains RIOT's build cache" >> "$@" - %.hex: %.elf $(Q)$(OBJCOPY) $(OFLAGS) -Oihex $< $@ diff --git a/pkg/pkg.mk b/pkg/pkg.mk index 7a21f9006d963..fd32957ad898c 100644 --- a/pkg/pkg.mk +++ b/pkg/pkg.mk @@ -82,8 +82,14 @@ PKG_CUSTOM_PREPARED ?= # Declare 'all' first to have it being the default target all: prepare + +$(BUILD_DIR)/CACHEDIR.TAG: + $(Q)mkdir -p "$(BUILD_DIR)" + $(Q)echo "Signature: 8a477f597d28d172789f06886806bc55" > "$@" + $(Q)echo "# This folder contains RIOT's build cache" >> "$@" + # Add noop builtin to avoid "Nothing to be done for prepare" message -prepare: $(PKG_PREPARED) +prepare: $(PKG_PREPARED) | $(BUILD_DIR)/CACHEDIR.TAG @: # Allow packages to add a custom step to be `prepared`.