Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile.include: creation of CACHEDIR.TAG as a dependency of pkg-prepare #20689

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 $< $@

Expand Down
9 changes: 8 additions & 1 deletion pkg/pkg.mk
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,15 @@ PKG_CUSTOM_PREPARED ?=
# Declare 'all' first to have it being the default target
all: prepare

BUILD_DIR ?= $(RIOTBASE)/build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this recipe should be placed outside of this file, as it is at a broader scope than building packages. Perhaps as an include-able makefile in ./makefiles. However, I will approve as-is.


$(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`.
Expand Down
Loading