Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I shut up make when it doesn't need to do anything?

How I stop make from saying make: Nothing to be done for 'all'. or make: 'file' is up to date? I'd like my build to be silent when it's not doing anything - there are other places where echo is called to track build progress, so this message is just cluttering things up. I am currently silencing it like this:

all: dependency1 dependency2
    @:

Something tells me there must be a better way. Any ideas?

Edit:

I would like to keep command echo working when it does need to build something, however. A good example of what I'm hoping for is along the lines of --no-print-directory, but I can't find any other flags to shut up selected messages.

like image 207
Carl Norum Avatar asked Feb 12 '10 00:02

Carl Norum


2 Answers

Maybe make -s?

like image 154
Vinko Vrsalovic Avatar answered Oct 05 '22 13:10

Vinko Vrsalovic


So after a couple days of reading around the web, it looks like there isn't any better way than what I'm doing. Some people recommended something along the lines of:

all: dependency1 dependency2 | silent

silent:
    @:

That is, just depending on the silent target would be enough to quiet things down. Since I didn't come up with any other workable solutions, I'm going with what I have.

like image 21
Carl Norum Avatar answered Oct 05 '22 13:10

Carl Norum