From d1922af0ddc6e42462f1dc0105caf42d5c71b5c7 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Sat, 12 May 2012 16:22:15 +0300 Subject: [PATCH] initial frontend support --- Makefile | 2 +- lib/clean.mk | 2 +- lib/help.mk | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 700565b0..28198c37 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ endif # recursive make considered useful for m-p MAKE += -r --no-print-directory -DIRECT_TARGETS := clean distclean check help +DIRECT_TARGETS := clean distclean check help help/distro help/ve .PHONY: $(DIRECT_TARGETS) $(DIRECT_TARGETS): @$(MAKE) -f main.mk $@ diff --git a/lib/clean.mk b/lib/clean.mk index 05d779e0..3c5b4ba5 100644 --- a/lib/clean.mk +++ b/lib/clean.mk @@ -53,7 +53,7 @@ distclean: clean # than BUILDDIR is -- usually it's unneeded afterwards so just zap it postclean: build-image @{ \ - if [ "$(NUM_TARGETS)" -gt 1 -a -z "$(DEBUG)" ] || \ + if [ "$(NUM_TARGETS)" -gt 1 -a -z "$(DEBUG)" -a -z "$(__frontend)" ] ||\ [ ! -L "$(SYMLINK)" -a "0$(DEBUG)" -lt 2 ]; then \ echo "$(TIME) cleaning up after build"; \ $(MAKE) -C "$(BUILDDIR)" distclean \ diff --git a/lib/help.mk b/lib/help.mk index 82a55b33..832c87d1 100644 --- a/lib/help.mk +++ b/lib/help.mk @@ -1,8 +1,20 @@ # 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 + @echo '** available $(1) targets:'; \ + columnize $(2) +endef +endif + +help = $(and $(2),$(help_body)) + help/distro: - @echo '** available distribution targets:'; \ - columnize $(sort $(DISTROS:distro/%=%)) + $(call help,distribution,$(sort $(DISTROS:distro/%=%))) help/ve: @echo '** available virtual environment targets:'; \