diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2010-12-20 06:19:24 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2011-01-10 21:35:26 -0600 |
commit | 5fa2ae2f43bba4d1bab42c4ffe279fef38ccfa50 (patch) | |
tree | 71daa7fc1d11b2bc8f16ee98d0d28397c024c06e /solenv/gbuild/Helper.mk | |
parent | 0a24c0d480d76cc6b1e788dda028237bab17562e (diff) |
enabled kbuild-like build output
Diffstat (limited to 'solenv/gbuild/Helper.mk')
-rw-r--r-- | solenv/gbuild/Helper.mk | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk index 61802022e4de..3f49afc651d5 100644 --- a/solenv/gbuild/Helper.mk +++ b/solenv/gbuild/Helper.mk @@ -31,6 +31,10 @@ define NEWLINE endef +define WHITESPACE + +endef + COMMA :=, gb_Helper_NULLFILE := /dev/null @@ -60,8 +64,50 @@ define gb_Helper__format_target $(1) endef +ifeq ($(TERM),xterm) +ifeq ($(strip $(gb_NOCOLOR)),) +gb_Helper_ESCAPE := $(shell echo -e '\033') +gb_Helper_COLOR_RESET := $(gb_Helper_ESCAPE)[0m +gb_Helper_COLOR_RESETANDESCAPE := $(gb_Helper_COLOR_RESET)$(gb_Helper_ESCAPE) +gb_Helper_COLOR_OUTBUILD_LEVEL1 := $(gb_Helper_COLOR_RESETANDESCAPE)[37;40m +gb_Helper_COLOR_OUTBUILD_LEVEL2 := $(gb_Helper_COLOR_RESETANDESCAPE)[37;40m +gb_Helper_COLOR_OUTBUILD_LEVEL3 := $(gb_Helper_COLOR_RESETANDESCAPE)[37;40m +gb_Helper_COLOR_OUTBUILD_LEVEL4 := $(gb_Helper_COLOR_RESETANDESCAPE)[37;40m +gb_Helper_COLOR_OUTBUILD_LEVEL5 := $(gb_Helper_COLOR_RESETANDESCAPE)[37;1;46m +gb_Helper_COLOR_OUTBUILD_LEVEL6 := $(gb_Helper_COLOR_RESETANDESCAPE)[37;1;44m + +gb_Helper_COLOR_INBUILD_LEVEL1 := $(gb_Helper_COLOR_RESETANDESCAPE)[36;40m +gb_Helper_COLOR_INBUILD_LEVEL2 := $(gb_Helper_COLOR_RESETANDESCAPE)[36;1;40m +gb_Helper_COLOR_INBUILD_LEVEL3 := $(gb_Helper_COLOR_RESETANDESCAPE)[32;40m +gb_Helper_COLOR_INBUILD_LEVEL4 := $(gb_Helper_COLOR_RESETANDESCAPE)[32;1;40m +gb_Helper_COLOR_INBUILD_LEVEL5 := $(gb_Helper_COLOR_RESETANDESCAPE)[37;1;46m +gb_Helper_COLOR_INBUILD_LEVEL6 := $(gb_Helper_COLOR_RESETANDESCAPE)[37;1;44m + +gb_Helper_COLOR_OUTCLEAN_LEVEL1 := $(gb_Helper_COLOR_RESETANDESCAPE)[37;40m +gb_Helper_COLOR_OUTCLEAN_LEVEL2 := $(gb_Helper_COLOR_RESETANDESCAPE)[37;40m +gb_Helper_COLOR_OUTCLEAN_LEVEL3 := $(gb_Helper_COLOR_RESETANDESCAPE)[37;40m +gb_Helper_COLOR_OUTCLEAN_LEVEL4 := $(gb_Helper_COLOR_RESETANDESCAPE)[37;40m +gb_Helper_COLOR_OUTCLEAN_LEVEL5 := $(gb_Helper_COLOR_RESETANDESCAPE)[33;1;41m +gb_Helper_COLOR_OUTCLEAN_LEVEL6 := $(gb_Helper_COLOR_RESETANDESCAPE)[37;1;41m + +gb_Helper_COLOR_INCLEAN_LEVEL1 := $(gb_Helper_COLOR_RESETANDESCAPE)[33;40m +gb_Helper_COLOR_INCLEAN_LEVEL2 := $(gb_Helper_COLOR_RESETANDESCAPE)[33;1;40m +gb_Helper_COLOR_INCLEAN_LEVEL3 := $(gb_Helper_COLOR_RESETANDESCAPE)[31;40m +gb_Helper_COLOR_INCLEAN_LEVEL4 := $(gb_Helper_COLOR_RESETANDESCAPE)[31;1;40m +gb_Helper_COLOR_INCLEAN_LEVEL5 := $(gb_Helper_COLOR_RESETANDESCAPE)[33;1;41m +gb_Helper_COLOR_INCLEAN_LEVEL6 := $(gb_Helper_COLOR_RESETANDESCAPE)[37;1;41m + +define gb_Helper__format_type +$(subst :, ,$(word 2,$(1) \ + $(gb_Helper_COLOR_OUTBUILD_LEVEL$(3))[:$(gb_Helper_COLOR_INBUILD_LEVEL$(3))$(subst $(WHITESPACE),:,$(2)):>==>$(gb_Helper_COLOR_OUTBUILD_LEVEL$(3)):] \ + $(gb_Helper_COLOR_OUTCLEAN_LEVEL$(3))[:$(gb_Helper_COLOR_INCLEAN_LEVEL$(3))$(subst $(WHITESPACE),:,$(2)):Oo._$(gb_Helper_COLOR_OUTCLEAN_LEVEL$(3)):]))$(gb_Helper_COLOR_RESET) +endef + +endif +endif + define gb_Helper_announce -$(info $(call gb_Helper__format_type,$(2),$(3)) $(call gb_Helper__format_target,$(1))) +$(info $(call gb_Helper__format_type,$(2),$(3),$(4)) $(call gb_Helper__format_target,$(1))) endef define gb_Helper_abbreviate_dirs |