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>
This commit is contained in:
Felix Fietkau 2017-01-23 21:53:47 +01:00
parent fa66900eeb
commit 053dc3b77a
1 changed files with 5 additions and 2 deletions

View File

@ -216,6 +216,7 @@ define Build/CoreTargets
ifneq ($(CONFIG_AUTOREMOVE),) ifneq ($(CONFIG_AUTOREMOVE),)
compile: 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' | \ $(FIND) $(PKG_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' -and -not -name '.pkgdir' | \
$(XARGS) rm -rf $(XARGS) rm -rf
endif endif
@ -300,10 +301,12 @@ compile: prepare-package-install
.install: .compile .install: .compile
install: compile install: compile
clean-build: FORCE force-clean-build: FORCE
rm -rf $(PKG_BUILD_DIR) rm -rf $(PKG_BUILD_DIR)
clean: clean-build clean-build: $(if $(wildcard $(PKG_BUILD_DIR)/.autoremove),force-clean-build)
clean: force-clean-build
$(CleanStaging) $(CleanStaging)
$(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR_HOST)) $(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR_HOST))
$(Build/Clean) $(Build/Clean)