Amumu
Amumu

Reputation: 18572

How to hide compiling message in Makefile?

The linux kernel I compile only prints message like:

CC  .....
LD [M] ....

How can I hide the compiling message printed out by make and output what I want? Where can I find the portion of code which does this in kernel Makefile?

Upvotes: 20

Views: 16822

Answers (1)

Kristof Provost
Kristof Provost

Reputation: 26332

In short, prepend '@'.

What the kernel makefiles do is rather more complicated, but it boils down to something like this:

%.o: %.c
    @echo [CC] $@
    @gcc -o $@ -c $<

Look at the GNU Make manual. GNU Make really is quite well documented, and if you're doing a lot of work with it it's worth the effort to read it through.

Upvotes: 39

Related Questions