gnu make - determine if stdout is terminal

view story

http://stackoverflow.com – Trying to do : help: @echo "you must $(call red_text,clean)" where red is defined as red_text = $(shell tput setaf 1; echo -n "$1"; tput sgr0) This prints "you must clean", where word "clean" is printed in red. The problem is when output of make is piped (e.g. to less). In this case I should not use colors, but rather print the $1. I need to update red_text to handle the case. For that I thought I can use something like $(shell [ -t 1 ] ..), but the peroblem is that stdout of $(shell) is always not terminal. How can I changed red to handle case stdout is not terminal? (HowTos)