1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

makefiles/color.inc.mk: don't set CC_NOCOLOR

If CC_NOCOLOR was not set by the user it was set according to the
terminal support of colored output.

But since CC_NOCOLOR is also used to set `-fdiagnostics-color` flags
this means changing `CFLAGS` according to terminal support of colored
output.

This is not needed for `-fdiagnostics-color` since this option is by
default `auto` if the compiler supports colored output, and `auto`
means it will only use color when standard error is a terminal.
This commit is contained in:
Francisco Molina 2020-01-10 08:40:00 +01:00
parent 4dc67679a4
commit b1ca4597ef

View File

@ -7,25 +7,22 @@ COLOR_PURPLE :=
COLOR_RESET :=
COLOR_ECHO := /bin/echo
ifeq ($(CC_NOCOLOR),)
# Check if colored output is not disabled by user, i.e: CC_NOCOLOR unset
# or 0
ifneq ($(CC_NOCOLOR),1)
IS_TERMINAL = $(if $(MAKE_TERMOUT),$(MAKE_TERMERR),)
ifeq ($(IS_TERMINAL),)
CC_NOCOLOR = 1
else
CC_NOCOLOR = 0
endif
endif
ifeq ($(CC_NOCOLOR),0)
COLOR_GREEN := \033[1;32m
COLOR_RED := \033[1;31m
COLOR_YELLOW := \033[1;33m
COLOR_PURPLE := \033[1;35m
COLOR_RESET := \033[0m
ifeq ($(OS),Darwin)
COLOR_ECHO := echo -e
SHELL=bash
else
COLOR_ECHO := /bin/echo -e
# Check if terminal support colored output
ifneq ($(IS_TERMINAL),)
COLOR_GREEN := \033[1;32m
COLOR_RED := \033[1;31m
COLOR_YELLOW := \033[1;33m
COLOR_PURPLE := \033[1;35m
COLOR_RESET := \033[0m
ifeq ($(OS),Darwin)
COLOR_ECHO := echo -e
SHELL=bash
else
COLOR_ECHO := /bin/echo -e
endif
endif
endif