Commit ec3d40cc authored by Michael Shigorin's avatar Michael Shigorin

help.mk, clean.mk: drop __frontend for tty test

The __frontend variable was introduced to address the needs of alterator-mkimage module: list the images available in one column, purge the builddir. Looks like we should consider other cases with redirected stdout (cron builds, piped calls, etc) like fundamentally non-interactive and behave the same. So commit 3a8af6b5's description is wrong now; the current cleanup rules are: - if CLEAN=0 or DEBUG>1, don't do it; - if CHECK or REPORT 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; + stdout was redirected (cronjob, alterator-mkimage...); + metaprofile directory is read-only ...then do a distclean. If that doesn't suit your needs, describe the particular situation please. Thanks cas@ for wondering aloud whether greppable output is unsupported with `make help'.
parent 51cb7825
...@@ -58,7 +58,7 @@ postclean: build-image ...@@ -58,7 +58,7 @@ postclean: build-image
[ -z "$(CHECK)" ] && \ [ -z "$(CHECK)" ] && \
[ -z "$(REPORT)" ] && \ [ -z "$(REPORT)" ] && \
[ "$(NUM_TARGETS)" -gt 1 \ [ "$(NUM_TARGETS)" -gt 1 \
-o -n "$(__frontend)" \ -o ! -t 1 \
-o ! -L "$(SYMLINK)" ]; \ -o ! -L "$(SYMLINK)" ]; \
then \ then \
echo "$(TIME) cleaning up after build"; \ echo "$(TIME) cleaning up after build"; \
......
# this makefile holds the most helpful bits for the toplevel one # this makefile holds the most helpful bits for the toplevel one
ifdef __frontend
define help_body
@for i in $(2); do echo $$i; done
endef
else
define help_body define help_body
if [ -t 1 ]; then \
echo '** available $(1) targets:'; \ echo '** available $(1) targets:'; \
columnize $(2) columnize $(2); \
else \
printf '%s\n' $(2); \
fi
endef endef
endif
help = $(and $(2),$(help_body)) help = $(and $(2),$(help_body))
......
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