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 3a8af6b55d888d25c1d97561ed2ecf37ff28ad71'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'.
This commit is contained in:
Michael Shigorin 2015-04-02 16:13:07 +03:00
parent 51cb7825dc
commit ec3d40cc1b
2 changed files with 6 additions and 8 deletions

View File

@ -58,7 +58,7 @@ postclean: build-image
[ -z "$(CHECK)" ] && \
[ -z "$(REPORT)" ] && \
[ "$(NUM_TARGETS)" -gt 1 \
-o -n "$(__frontend)" \
-o ! -t 1 \
-o ! -L "$(SYMLINK)" ]; \
then \
echo "$(TIME) cleaning up after build"; \

View File

@ -1,15 +1,13 @@
# 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
if [ -t 1 ]; then \
echo '** available $(1) targets:'; \
columnize $(2)
columnize $(2); \
else \
printf '%s\n' $(2); \
fi
endef
endif
help = $(and $(2),$(help_body))