Next: Automake Silent Rules, Previous: Make is verbose by default, Up: Verbosity [Contents][Index]
Here we describe some common idioms/tricks to obtain a quieter make output, with their relative advantages and drawbacks. In the next section (Automake Silent Rules) we’ll see how Automake can help in this respect, providing more elaborate and flexible idioms.
make -s
This simply causes make
not to print any rule before
executing it.
The -s flag is mandated by POSIX, universally supported, and its purpose and function are easy to understand.
But it also has its serious limitations too. First of all, it embodies
an “all or nothing” strategy, i.e., either everything is silenced, or
nothing is; this lack of granularity can sometimes be a fatal flaw.
Moreover, when the -s flag is used, the make
output
might turn out to be too much terse; in case of errors, the user won’t
be able to easily see what rule or command have caused them, or even,
in case of tools with poor error reporting, what the errors were!
make >/dev/null || make
Apparently, this perfectly obeys the “silence is golden” rule: warnings from stderr are passed through, output reporting is done only in case of error, and in that case it should provide a verbose-enough report to allow an easy determination of the error location and causes.
However, calling make
two times in a row might hide errors
(especially intermittent ones), or subtly change the expected semantic
of the make
calls — things these which can clearly make
debugging and error assessment very difficult.
make --no-print-directory
This is GNU make
specific. When called with the
--no-print-directory option, GNU make
will disable
printing of the working directory by invoked sub-make
s (the
well-known “Entering/Leaving directory ...” messages). This helps
to decrease the verbosity of the output, but experience has shown that
it can also often render debugging considerably harder in projects using
deeply-nested make
recursion.
As an aside, notice that the --no-print-directory option is automatically activated if the -s flag is used.
Next: Automake Silent Rules, Previous: Make is verbose by default, Up: Verbosity [Contents][Index]