Merge pull request #12127 from jcarrano/color-detect-terminal
makefiles/color: detect if writing to terminal.
This commit is contained in:
commit
e2c91639ea
@ -8,12 +8,8 @@ COLOR_RESET :=
|
|||||||
COLOR_ECHO := /bin/echo
|
COLOR_ECHO := /bin/echo
|
||||||
|
|
||||||
ifeq ($(CC_NOCOLOR),)
|
ifeq ($(CC_NOCOLOR),)
|
||||||
available_colors:=$(shell tput colors 2> /dev/null)
|
IS_TERMINAL = $(if $(MAKE_TERMOUT),$(MAKE_TERMERR),)
|
||||||
ifeq ($(available_colors),)
|
ifeq ($(IS_TERMINAL),)
|
||||||
CC_NOCOLOR = 1
|
|
||||||
else ifeq ($(available_colors),-1)
|
|
||||||
CC_NOCOLOR = 1
|
|
||||||
else ifeq ($(available_colors),0)
|
|
||||||
CC_NOCOLOR = 1
|
CC_NOCOLOR = 1
|
||||||
else
|
else
|
||||||
CC_NOCOLOR = 0
|
CC_NOCOLOR = 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user