-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make: Simplify compiler echo string during make #507
Conversation
This makes the output beautiful but sometimes I would like to see the arguments passed to compiler.
or
? |
BTW, "make" prefix in the subject of this issue implies "make.c" parser. |
Excellent suggestions! |
Sure. |
FWIW Automake's silent feature is implemented with the non-standard yet quite portable (at least GNU and BSD makes support it) variable macro names, something like this: # quiet by default
V ?= 0
V_CC_0 = @echo ' CC $@';
#V_CC_1 =
V_CC = $(V_CC_$(V))
V_GEN_0 = @echo ' GEN $@';
#V_GEN_1 =
V_GEN = $(V_GEN_$(V))
all: foo bar
$(V_CC) echo "warning: Input files are empty" >&2
foo bar:
$(V_GEN) touch $@
clean:
rm -f foo bar
.PHONY: all clean And then depending on the value of |
@b4n In that case, can't we include that code automatically through the configure script? |
@vhda, in my understanding, this is not about autoconf. |
cfd3e7d
to
bd091fe
Compare
I've updated the implementation of this feature as suggested by @b4n. After understanding how it works, it is a really nice idea. Thanks a lot! :) Two doubts:
|
@vhda, thank you. About 1. I don't care. I will modify (and make a PR) when I need. About units/fuzz/noise/tmain/tinst, I will write them. What I need is a stab. The stub is important. With it we can work together. |
V ?= 0 | ||
V_CC = $(V_CC_$(V)) | ||
V_CC_0 = @echo [CC] $@; $(CC) | ||
V_CC_1 = $(CC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather have V_CC
only expand to empty or an @echo
command -- e.g. not including $(CC)
.
Yes, this will mean slight duplication, but it is more robust (e.g. would still work if the user sets V=2
) and allows to have preliminary commands hidden by it, like your mkdir
below.
bd091fe
to
ada156f
Compare
Could you guys check if the new implementation fills all requirements you mentioned in your comments before? |
The technique to silent LGTM. Whether all what you silenced should be silenced I don't know, but why not. |
@b4n you proposed the approach in the second commit, do you still prefer that when compared with the first commit? |
yes |
My question was whether it was a good idea to silent some things, i.e. This doesn't mean you shouldn't keep silencing them, just that I'm not sure it's very important. And remember that while it gives a more readable output, it also gives less info: a bug report with silenced output is less useful than one with all the verbose details. |
We can still close this PR if you feel that this does not bring any advantages. |
I think it does at least for the compilation phase, as it makes it a lot easier to see what is being built, and removes clutter around messages from the compiler -- and most of the time a developer is working on the code, not debugging the build phase. But I also think silencing everything might not make sense, if it doesn't provide a specific advantage. However, I don't mind much and one can always change the value of |
I'm fine with any solution, so let's see what's @masatake 's opinion and we'll move on from there. |
If you provide "help" target where |
My idea was to create a separate PR for this change, but there's no harm in including it here. |
After automake 1.11.3, nested make variables are not used directly. [1][2][3] [1] http://git.savannah.gnu.org/cgit/automake.git/tree/bin/automake.in?id=6357a630dc3cac6682a0f17b255104b4dd78f89a#n1034 Before using nested variable, automake check whether make supports nested variables. [4] In current automake, AM_V_GEN* vars are defind in Makefile.in as:
(A) when make supports nested variable, replaced as:
(B-1) when make does not supports nested variable, and '--enable-silent-rules' specified:
this case, (B-2) when make does not supports nested variable, and '--disable-silent-rules' specified:
this case, |
87c3a71
to
4b8fb3c
Compare
This was only implemented in the main Makefile and mk_mingw. The normal verbose output can be enabled by calling make as following: make V=1
4b8fb3c
to
42008d0
Compare
@p-montanus nice, thanks for the details :) |
Should this patch be merged? |
@vhda, yes, please, merge them. |
make: Simplify compiler echo string during make
I'm looking new output. Really nice. |
Thanks for the positive feedback! |
This was only implemented in the main Makefile and mk_mingw.