make: Terminal Output
1
1 13.2 Synchronized Terminal Output
1 =================================
1
1 Normally GNU 'make' will invoke all commands with access to the same
1 standard and error outputs that 'make' itself was started with. A
1 number of tools will detect whether the output is a terminal or
1 not-a-terminal, and use this information to change the output style.
1 For example if the output goes to a terminal the tool may add control
1 characters that set color, or even change the location of the cursor.
1 If the output is not going to a terminal then these special control
1 characters are not emitted so that they don't corrupt log files, etc.
1
11 The '--output-sync' (⇒Output During Parallel Output Parallel
Output.) option will defeat the terminal detection. When output
1 synchronization is enabled GNU 'make' arranges for all command output to
1 be written to a file, so that its output can be written as a block
1 without interference from other commands. This means that all tools
1 invoked by 'make' will believe that their output is not going to be
1 displayed on a terminal, even when it will be (because 'make' will
1 display it there after the command is completed).
1
1 In order to facilitate tools which would like to determine whether or
1 not their output will be displayed on a terminal, GNU 'make' will set
1 the 'MAKE_TERMOUT' and 'MAKE_TERMERR' environment variables before
1 invoking any commands. Tools which would like to determine whether
1 standard or error output (respectively) will be displayed on a terminal
1 can check these environment variables to determine if they exist and
1 contain a non-empty value. If so the tool can assume that the output
1 will (eventually) be displayed on a terminal. If the variables are not
1 set or have an empty value, then the tool should fall back to its normal
1 methods of detecting whether output is going to a terminal or not.
1
1 The content of the variables can be parsed to determine the type of
1 terminal which will be used to display the output.
1
1 Similarly, environments which invoke 'make' and would like to capture
1 the output and eventually display it on a terminal (or some display
1 which can interpret terminal control characters) can set these variables
1 before invoking 'make'. GNU 'make' will not modify these environment
1 variables if they already exist when it starts.
1