diff mbox series

build: add $(STAGING_DIR) and $(BIN_DIR) preparation to target and package subdir compile dependencies

Message ID dbafdfbdcad3e61673838cca7cdbef0eca0e3354.1706830790.git.mschiffer@universe-factory.net
State Accepted, archived
Delegated to: Matthias Schiffer
Headers show
Series build: add $(STAGING_DIR) and $(BIN_DIR) preparation to target and package subdir compile dependencies | expand

Commit Message

Matthias Schiffer Feb. 1, 2024, 11:46 p.m. UTC
In a pristine build, these directories are created as dependencies of
the tools subdir compile, however this step never runs when the tools
compile stamp already exists. Since commit ed6ba2801c0a ("tools: keep
stamp file in $(STAGING_DIR_HOST)"), this will happen after `make clean`:
$(STAGING_DIR) has been deleted, but the tools stamp still exists, so
the next build will fail because $(STAGING_DIR) has not been set up
correctly.

Fix builds after `make clean` by adding the preparation as dependencies
for the target and package directories as well.

Fixes: ed6ba2801c0a ("tools: keep stamp file in $(STAGING_DIR_HOST)")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
---
 package/Makefile | 2 ++
 target/Makefile  | 2 ++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/package/Makefile b/package/Makefile
index 8e72d4ec726d..4663b41de4ae 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -117,6 +117,8 @@  endif
 
 $(curdir)/flags-install:= -j1
 
+$(curdir)//compile = $(STAGING_DIR)/.prepared $(BIN_DIR)
+
 $(eval $(call stampfile,$(curdir),package,prereq,.config))
 $(eval $(call stampfile,$(curdir),package,cleanup,$(TMP_DIR)/.build))
 $(eval $(call stampfile,$(curdir),package,compile,$(TMP_DIR)/.build))
diff --git a/target/Makefile b/target/Makefile
index 83f9c4b0934a..3bbb9f413133 100644
--- a/target/Makefile
+++ b/target/Makefile
@@ -19,6 +19,8 @@  $(curdir)/builddirs-install:=\
 $(curdir)/sdk/install:=$(curdir)/linux/install
 $(curdir)/imagebuilder/install:=$(curdir)/linux/install
 
+$(curdir)//compile = $(STAGING_DIR)/.prepared $(BIN_DIR)
+
 $(eval $(call stampfile,$(curdir),target,prereq,.config))
 $(eval $(call stampfile,$(curdir),target,compile,$(TMP_DIR)/.build))
 $(eval $(call stampfile,$(curdir),target,install,$(TMP_DIR)/.build))