Paul Smith via austin-group-l at The Open Group wrote in
<[email protected]>:
|On Wed, 2024-10-30 at 11:07 -0400, David A. Wheeler wrote:
|> However, I *do* think having a standard way to *request* output
|> interleaving in make would make sense in POSIX. I would suggest using
|> the GNU Make one-letter option "-O" (aka "--output-sync"). Make it
|> clear that adding "-O" to MAKEFLAGS would give output interleaving,
|> and you have the capability.
|
|That's fine with me, although implementing this is not completely
|trivial since the "I own stdout" token needs to be shared between
|recursive instances of make.
|
|Note that GNU Make supports multiple styles of output sync. It may be
|interesting to read:
|https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
|because there are some subtleties to consider.
|
|Also note that GNU Make exports two environment variables: MAKE_TERMOUT
|and MAKE_TERMERR. These values allow commands that test whether
|stdout/stderr is a terminal, to work properly in the face of
|synchronized output. For example, if your compiler generates colorized
|error/warning messages when printing to stdout but not when printing to
|a file, then enabling synchronized output will disable all colorized
|output. Tools that generate colorized output can be enhanced to check
|for these variables in addition to isatty() (or whatever) to be
|notified that the output generated will ultimately appear on a
|terminal, even if stdout is not currently connected to one.
|
|Info here:
|https://www.gnu.org/software/make/manual/html_node/Special-Variables.htm\
|l#index-MAKE_005fTERMOUT-_0028whether-stdout-is-a-terminal_0029
|
|Obviously this requires changes to the tools GNU Make invokes, few of
|which have adopted this behavior so far.
I want to add that BSD make aka bmake documents
.MAKE.JOB.PREFIX
If bmake is run with -j, the output for each target is prefixed
with a token
--- target ---
the first part of which can be controlled via .MAKE.JOB.PREFIX.
If .MAKE.JOB.PREFIX is empty, no token is printed. For example,
setting .MAKE.JOB.PREFIX to
‘${.newline}---${.MAKE:T}[${.MAKE.PID}]’ would produce tokens like
---make[1234] target ---
making it easier to track the degree of parallelism being
achieved.
Ie it synchronizes "forever" in that i cannot recall ever having
seen it in any other way.
The distributed make mode of Solaris's make (dmake) i think also
does this data-collection automatically?
So my question would be indeed whether this is a GNU make specific
problem, with GNu make specific solutions?
--End of <[email protected]>
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)
|
|And in Fall, feel "The Dropbear Bard"s ball(s).
|
|The banded bear
|without a care,
|Banged on himself fore'er and e'er
|
|Farewell, dear collar bear