[riot-notifications] [RIOT-OS/RIOT] makefiles/color: detect if writing to terminal. (#12127)

Francisco notifications at github.com
Wed Sep 4 13:28:34 CEST 2019


fjmolinas commented on this pull request.



> @@ -8,12 +8,8 @@ COLOR_RESET  :=
 COLOR_ECHO   := /bin/echo
 
 ifeq ($(CC_NOCOLOR),)
-  available_colors:=$(shell tput colors 2> /dev/null)
-  ifeq ($(available_colors),)
-    CC_NOCOLOR = 1
-  else ifeq ($(available_colors),-1)
-    CC_NOCOLOR = 1
-  else ifeq ($(available_colors),0)
+  IS_TERMINAL = $(if $(MAKE_TERMOUT),$(MAKE_TERMERR),)

In #8007 the code was introduced to check for those "weird setup". The code was working for that use case, the changes you are applying are not working for that use case, although they do fix your scenario.

If compiling with `TERM=at` in master you don't get color output which does happen with this PR. Could you modify your code so both checks are performed? i.e.:

```
ifeq ($(IS_TERMINAL),)
  CC_NOCOLOR = 1
else ifeq ($(available_colors),)
  CC_NOCOLOR = 1
else ifeq ($(available_colors),-1)
  CC_NOCOLOR = 1
else ifeq ($(available_colors),0)
  CC_NOCOLOR = 1
else
  CC_NOCOLOR = 0
endif
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12127#discussion_r320707087
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190904/07bcd443/attachment-0001.htm>


More information about the notifications mailing list