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.
This simply causes
make not to print any rule before
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
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.
make two times in a row might hide errors
(especially intermittent ones), or subtly change the expected semantic
make calls — things these which can clearly make
debugging and error assessment very difficult.
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-
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
As an aside, notice that the --no-print-directory option is automatically activated if the -s flag is used.