summaryrefslogtreecommitdiffstats
path: root/include/package.mk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-01-18 15:37:57 +0100
committerFelix Fietkau <nbd@nbd.name>2017-01-18 23:57:08 +0100
commit7a523569f7f403cdd7c2074cc49920f1dd7ecc70 (patch)
tree1fb09d1838718e062e74c7894a3f65b8523cfa31 /include/package.mk
parentc150a190f59afa3d34924a76bb9306bdb0914533 (diff)
downloadopenwrt-7a523569f7f403cdd7c2074cc49920f1dd7ecc70.tar.gz
openwrt-7a523569f7f403cdd7c2074cc49920f1dd7ecc70.tar.bz2
openwrt-7a523569f7f403cdd7c2074cc49920f1dd7ecc70.zip
build: add support for automatically removing build dir contents during build
This is used to save space on buildbot instances. If any part of a package needs to be rebuild, the whole package is rebuilt from scratch. Stamp files are preserved to allow dependency checks to work Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'include/package.mk')
-rw-r--r--include/package.mk6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/package.mk b/include/package.mk
index 37cea1448d..b88f2c52b0 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -211,6 +211,12 @@ define Build/CoreTargets
.configure: $(STAMP_CONFIGURED)
.dist: $(STAMP_CONFIGURED)
.distcheck: $(STAMP_CONFIGURED)
+
+ ifneq ($(CONFIG_AUTOREMOVE),)
+ compile:
+ $(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' | \
+ $(XARGS) rm -rf
+ endif
endef
define Build/DefaultTargets