summaryrefslogtreecommitdiff
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)
downloadmtk-20170518-7a523569f7f403cdd7c2074cc49920f1dd7ecc70.zip
mtk-20170518-7a523569f7f403cdd7c2074cc49920f1dd7ecc70.tar.gz
mtk-20170518-7a523569f7f403cdd7c2074cc49920f1dd7ecc70.tar.bz2
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 37cea14..b88f2c5 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