aboutsummaryrefslogtreecommitdiffstats
path: root/include/package.mk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-01-23 21:53:47 +0100
committerFelix Fietkau <nbd@nbd.name>2017-01-23 22:04:17 +0100
commit053dc3b77ad1fa15e281f70447706fe62780e47b (patch)
treee6bba71f271b1fdc26c47f4431349672f89007c7 /include/package.mk
parentfa66900eeb213186a7478737ae54e1e6e9bff3cd (diff)
downloadupstream-053dc3b77ad1fa15e281f70447706fe62780e47b.tar.gz
upstream-053dc3b77ad1fa15e281f70447706fe62780e47b.tar.bz2
upstream-053dc3b77ad1fa15e281f70447706fe62780e47b.zip
build: do not auto-clean packages where the autoremove step has not run
This avoids repeatedly unpacking and rebuilding packages that are failing the build. Re-running the failing step should be much faster. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'include/package.mk')
-rw-r--r--include/package.mk7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/package.mk b/include/package.mk
index fc2733907e..01c0333b06 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -216,6 +216,7 @@ define Build/CoreTargets
ifneq ($(CONFIG_AUTOREMOVE),)
compile:
+ touch $(PKG_BUILD_DIR)/.autoremove
$(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' | \
$(XARGS) rm -rf
endif
@@ -300,10 +301,12 @@ compile: prepare-package-install
.install: .compile
install: compile
-clean-build: FORCE
+force-clean-build: FORCE
rm -rf $(PKG_BUILD_DIR)
-clean: clean-build
+clean-build: $(if $(wildcard $(PKG_BUILD_DIR)/.autoremove),force-clean-build)
+
+clean: force-clean-build
$(CleanStaging)
$(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR_HOST))
$(Build/Clean)