hi
how can i print compiling result in makefiles? (for example "Compiling 'test.c': [ok]" )
print compile results in makefile
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: print compile results in makefile
I really hate this trend of silencing compilation output, it's stupid.. almost as stupid as colourizing it, so don't do it.
Re: print compile results in makefile
Apart from your opinion, why do you say that?Brynet-Inc wrote:I really hate this trend of silencing compilation output, it's stupid.. almost as stupid as colourizing it, so don't do it.
Re: print compile results in makefile
This is not "silencing compilation output". To the contrary - it is silencing the stupid default behaviour of make, echoing every command it executes before doing so. The effect is that you actually see the only compilation output that counts: Warnings and errors, which get drowned out in line noise with your average "I print everything I do" makefiles.Brynet-Inc wrote:I really hate this trend of silencing compilation output, it's stupid.. almost as stupid as colourizing it, so don't do it.
Every good solution is obvious once you've found it.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: print compile results in makefile
Errors don't get drowned out. It's usually the last thing make does (And the recommended -Werror fixes the warnings too)Solar wrote:Warnings and errors, which get drowned out in line noise with your average "I print everything I do" makefiles.
That said, I'd like to see my previous entries on the command line instead of having my screen filled with pages of compiler flags. So I replace the bloat with echo $(CC) $@ (or any other echo $(TOOL) $@)
Re: print compile results in makefile
I wish it were so. Do you know how often I had someone ask me something along the lines of "your makefile failed, I get an error message 'make: *** [all] error 2'"...?Combuster wrote:Errors don't get drowned out. It's usually the last thing make does
What you need when 'make' fails is the first error message. This can be difficult to identify between GCC echos (especially for unskilled people, which are the ones calling you or writing you emails demanding you fix things).
Doing the "echo CC" thing has the advantage that "usual" output is clearly distinguishable from warnings, errors et al. even by those ignorant of what is actually going on.
Every good solution is obvious once you've found it.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: print compile results in makefile
Ah I see where you got that from. (I don't have a habit of letting the incompetent do compilation work, you have binaries for that)Solar wrote:I wish it were so. Do you know how often I had someone ask me something along the lines of "your makefile failed, I get an error message 'make: *** [all] error 2'"...?
Er, wait, did I just sense recursive make? from you? *ducks and runs*
Last edited by Combuster on Mon Sep 12, 2011 6:04 am, edited 1 time in total.
Re: print compile results in makefile
As any makefile generated by autoconf / automake. Unfortunately these two "great" tools are as unable of creating non-recursive makefiles as they are able to generate silent makefiles - not at all.Combuster wrote:Wait, did I just sense recursive make from you? *ducks and runs*
(Actually, they are able to generate silent makefiles, but only in the latest versions and with quite some non-compatible changes to the config files.)
Every good solution is obvious once you've found it.