Commit 674f7db2 authored by Michael Shigorin's avatar Michael Shigorin

clean.mk: allow to forbid cleanup explicitly

The behaviour that sort of settled didn't actually follow the principle of the least surprise when one really wanted to have BUILDDIR available for inspection; DEBUG=2 would be effective to achieve that but CLEAN=0 would not. Thanks led@ for spotting and reporting this.
parent 891f982e
......@@ -47,7 +47,7 @@
** экономия RAM+swap при сборке в tmpfs, иначе места на диске
** очистка рабочего каталога после успешной сборки очередной стадии
** может помешать использовать некоторые варианты отладки
** значение: любая строка; по умолчанию пусто при DEBUG, иначе 1
** значение: пусто, 0, 1, 2; по умолчанию пусто при DEBUG, иначе 1
** см. ../lib/clean.mk
* DEBUG
......
......@@ -53,10 +53,14 @@ distclean: clean
# than BUILDDIR variable is -- usually it's unneeded afterwards
postclean: build-image
@{ \
if [ "0$(DEBUG)" -lt 2 -a -z "$(CHECK)$(REPORT)" ] && \
[ "$(NUM_TARGETS)" -gt 1 \
if [ "$(CLEAN)" != 0 ] && \
[ "0$(DEBUG)" -lt 2 ] && \
[ -z "$(CHECK)" ] && \
[ -z "$(REPORT)" ] && \
[ "$(NUM_TARGETS)" -gt 1 \
-o -n "$(__frontend)" \
-o ! -L "$(SYMLINK)" ]; then \
-o ! -L "$(SYMLINK)" ]; \
then \
echo "$(TIME) cleaning up after build"; \
$(MAKE) -C "$(BUILDDIR)" distclean \
GLOBAL_BUILDDIR="$(BUILDDIR)" $(LOG) ||:; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment