From 3a8af6b55d888d25c1d97561ed2ecf37ff28ad71 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Mon, 30 Jul 2012 19:24:45 +0400 Subject: [PATCH] lib/clean.mk: post-build cleanup revisited The prerequisites for a cleanup after a successful build were somewhat weird at this point; now the rules are: - if DEBUG level is more than 1 or CHECK is set, don't do it; - otherwise if at least one of the following conditions is true: + there's more than one target being built in a row; + the build was run by e.g. alterator-mkimage; + metaprofile directory is read only ...then do a distclean. If these are still weird or feel unsuitable for profile hacking, drop me a note (or a patch). --- doc/params.txt | 6 +++--- lib/clean.mk | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/doc/params.txt b/doc/params.txt index 3a0f6c7e..06b0858c 100644 --- a/doc/params.txt +++ b/doc/params.txt @@ -41,7 +41,7 @@ - CHECK + включает режим проверки сборки конфигурации (без сборки образа) + значение: пусто (по умолчанию) либо любая строка - + см. ../lib/build.mk + + см. ../lib/build.mk, ../lib/clean.mk - CLEAN + экономия RAM+swap при сборке в tmpfs, иначе места на диске @@ -51,9 +51,9 @@ + см. ../lib/clean.mk - DEBUG - + включает средства отладки + + включает средства отладки, может отключить зачистку после сборки + значение: пусто (по умолчанию), 1 или 2 - + см. ../lib/log.mk + + см. ../lib/log.mk, ../lib/clean.mk - HOMEPAGE, HOMENAME, HOMEWAIT + указывают адрес, название и таймаут перехода для домашней страницы diff --git a/lib/clean.mk b/lib/clean.mk index 3c5b4ba5..0d3a3134 100644 --- a/lib/clean.mk +++ b/lib/clean.mk @@ -50,11 +50,15 @@ distclean: clean } >&2 # builddir existing outside read-only metaprofile is less ephemeral -# than BUILDDIR is -- usually it's unneeded afterwards so just zap it +# than BUILDDIR variable is -- usually it's unneeded afterwards +# so just zap it unless DEBUG has been requested (moreso for multi +# image builds, UI based ones, and readonly metaprofile; or CHECK) postclean: build-image @{ \ - if [ "$(NUM_TARGETS)" -gt 1 -a -z "$(DEBUG)" -a -z "$(__frontend)" ] ||\ - [ ! -L "$(SYMLINK)" -a "0$(DEBUG)" -lt 2 ]; then \ + if [ "0$(DEBUG)" -lt 2 -a -z "$(CHECK)" ] && \ + [ "$(NUM_TARGETS)" -gt 1 \ + -o -n "$(__frontend)" \ + -o ! -L "$(SYMLINK)" ]; then \ echo "$(TIME) cleaning up after build"; \ $(MAKE) -C "$(BUILDDIR)" distclean \ GLOBAL_BUILDDIR="$(BUILDDIR)" $(LOG) ||:; \