thoni56
thoni56

Reputation: 3335

How to make Make *not* print "recipe for target failed?

I'm building a Makefile for a sequence of compiles to show progressive output differences to be used to synchronize with the examples in a tutorial. Some of those runs generates error codes, but since that is part of the definition of the "problem" the message output by make ("Makefile:15: recipe for target `run3' failed") when a target fails kind of gets in the way.

I know about ignoring the error code, but is it possible to suppress that output? Preferable from within the Makefile.

On a similar note, is it possible to suppress the message of entering and leaving subdirectories from within the Makefile (equivalent to '--no-print-directory')?

And, yes, I'm satisfied with a GNU Make answer.

Upvotes: 4

Views: 5989

Answers (2)

thoni56
thoni56

Reputation: 3335

Of course, after some googling the answer is in the GNU Make manual. The special targets .SILENT and .IGNORE did exactly what I wanted.

Upvotes: 7

Stephane Rouberol
Stephane Rouberol

Reputation: 4384

To achieve what you want I would use --silent --ignore-errors --no-print-directory GNU make switches and redirect stderr to /dev/null (2>/dev/null) commands in the makefile

Upvotes: 2

Related Questions