48 GNU make
completed. Additionally, if there are multiple recursive make invocations running in parallel,
they will communicate so that only one of them is generating output at a time.
If working directory printing is enabled (see Section 5.7.4 [The ‘--print-directory’
Option], page 55), the enter/leave messages are printed around each output grouping. If
you prefer not to see these messages add the ‘--no-print-directory’ option to MAKEFLAGS.
There are four levels of granularity when synchronizing output, specified by giving an
argument to the option (e.g., ‘-Oline’ or ‘--output-sync=recurse’).
none This is the default: all output is sent directly as it is generated and no synchro-
nization is performed.
line Output from each individual line of the recipe is grouped and printed as soon
as that line is complete. If a recipe consists of multiple lines, they may be
interspersed with lines from other recipes.
target Output from the entire recipe for each target is grouped and printed once the
target is complete. This is the default if the --output-sync or -O option is
given with no argument.
recurse Output from each recursive invocation of make is grouped and printed once the
recursive invocation is complete.
Regardless of the mode chosen, the total build time will be the same. The only difference
is in how the output appears.
The ‘target’ and ‘recurse’ modes both collect the output of the entire recipe of a target
and display it uninterrupted when the recipe completes. The difference between them is in
how recipes that contain recursive invocations of make are treated (see Section 5.7 [Recursive
Use of make], page 50). For all recipes which have no recursive lines, the ‘target’ and
‘recurse’ modes behave identically.
If the ‘recurse’ mode is chosen, recipes that contain recursive make invocations are
treated the same as other targets: the output from the recipe, including the output from
the recursive make, is saved and printed after the entire recipe is complete. This ensures
output from all the targets built by a given recursive make instance are grouped together,
which may make the output easier to understand. However it also leads to long periods of
time during the build where no output is seen, followed by large bursts of output. If you
are not watching the build as it proceeds, but instead viewing a log of the build after the
fact, this may be the best option for you.
If you are watching the output, the long gaps of quiet during the build can be frustrat-
ing. The ‘target’ output synchronization mode detects when make is going to be invoked
recursively, using the standard methods, and it will not synchronize the output of those
lines. The recursive make will perform the synchronization for its targets and the output
from each will be displayed immediately when it completes. Be aware that output from
recursive lines of the recipe are not synchronized (for example if the recursive line prints a
message before running make, that message will not be synchronized).
The ‘line’ mode can be useful for front-ends that are watching the output of make to
track when recipes are started and completed.
Some programs invoked by make may behave differently if they determine they’re writing
output to a terminal versus a file (often described as “interactive” vs. “non-interactive”
Kommentare zu diesen Handbüchern