From 2990a21058243b067bb56fed36ee69205595993e Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Sun, 22 Jan 2017 13:30:39 +0100
Subject: [PATCH] build: always run package/cleanup before package/compile

Remove unnecessary stampfile indirection
Fixes an issue with the command sequence used by buildbot

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 Makefile         | 2 +-
 package/Makefile | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index a26eeee0a8..648fef5b86 100644
--- a/Makefile
+++ b/Makefile
@@ -41,7 +41,7 @@ else
 
 $(toolchain/stamp-compile): $(tools/stamp-compile)
 $(target/stamp-compile): $(toolchain/stamp-compile) $(tools/stamp-compile) $(BUILD_DIR)/.prepared
-$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
+$(package/stamp-compile): $(target/stamp-compile)
 $(package/stamp-install): $(package/stamp-compile)
 $(target/stamp-install): $(package/stamp-compile) $(package/stamp-install)
 check: $(tools/stamp-check) $(toolchain/stamp-check) $(package/stamp-check)
diff --git a/package/Makefile b/package/Makefile
index 6929c479a2..b5e4bfa12b 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -49,6 +49,8 @@ PACKAGE_INSTALL_FILES:= \
 $(curdir)/cleanup: $(TMP_DIR)/.build
 	rm -rf $(STAGING_DIR_ROOT)
 
+$(curdir)/compile: $(curdir)/cleanup
+
 $(curdir)/merge:
 	rm -rf $(PACKAGE_DIR_ALL)
 	mkdir -p $(PACKAGE_DIR_ALL)
@@ -98,7 +100,6 @@ $(curdir)/preconfig:
 $(curdir)/flags-install:= -j1
 
 $(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))
 $(eval $(call stampfile,$(curdir),package,install,$(TMP_DIR)/.build))
 $(eval $(call stampfile,$(curdir),package,check,$(TMP_DIR)/.build))
-- 
2.30.2