mkimage-profiles/lib/help.mk
Michael Shigorin ec3d40cc1b 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'.
2015-04-02 20:46:35 +03:00

27 lines
535 B
Makefile

# this makefile holds the most helpful bits for the toplevel one
define help_body
if [ -t 1 ]; then \
echo '** available $(1) targets:'; \
columnize $(2); \
else \
printf '%s\n' $(2); \
fi
endef
help = $(and $(2),$(help_body))
help/distro:
@$(call help,distribution,$(sort $(DISTROS:distro/%=%)))
help/ve:
@[ -n "$(SPACE)" ] && echo; \
$(call help,virtual environment,$(sort $(VES)))
help/vm:
@[ -n "$(SPACE)" ] && echo; \
$(call help,virtual machine,$(sort $(VMS)))
help: SPACE = 1
help: help/distro help/ve help/vm; @: