• Michael Shigorin's avatar
    help.mk, clean.mk: drop __frontend for tty test · ec3d40cc
    Michael Shigorin authored
    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'.
    ec3d40cc
help.mk 535 Bytes
# 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; @: