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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user