linux4sam / at91bootstrap

Second level bootloader for Microchip SoC (aka AT91)
https://www.linux4sam.org/linux4sam/bin/view/Linux4SAM/AT91Bootstrap4
114 stars 232 forks source link

Makefile: handle V=1 for CC, AS and OBJCOPY commands #140

Closed clementleger closed 3 years ago

clementleger commented 3 years ago

Replace @ by $(Q) to allow displaying command lines when compiling with V=1.

Signed-off-by: Clément Léger clement.leger@bootlin.com

ehristev commented 3 years ago

Hi, The commit you tagged as Fixes does not seem to introduce what you are saying. It looks like the '@' only was there before the commit you indicated

clementleger commented 3 years ago

Hi, The commit you tagged as Fixes does not seem to introduce what you are saying. It looks like the '@' only was there before the commit you indicated

Oups, Indeed, I removed that, this seems to be present from the start of the git repo.

ehristev commented 3 years ago

So actually when you build at91bootstrap, it always prints the ASFLAGS and the CCFLAGS ? Or what is the problem you are trying to solve ? To make it print them only with make V=1 ?

clementleger commented 3 years ago

So actually when you build at91bootstrap, it always prints the ASFLAGS and the CCFLAGS ?

No, by default, the behavior is unchanged.

Or what is the problem you are trying to solve ? To make it print them only with make V=1 ?

Yes, this was the original goal of $(Q), when V != 1, $(Q) = @ and thus, the command line invoked is silent. When V=1, $(Q) is empty and allows displaying the command line invoked. This a common pattern used in various Makefile system (Linux, Barebox, etc) which allows displaying the full command when using V=1.

ehristev commented 3 years ago

ok, I get it. the command line for setting these flags was never printed (because of the '@' ) It is still not printed after your patch with the usual make However, with your patch, it will be printed if you do make V=1

On the other hand, the flags themselves are being printed when you do make regardless of the V=1 setting or not. Does it make sense to print the command line which sets the flags, if we are printing the flags in all cases anyway ?

clementleger commented 3 years ago

Displaying the command line allows to rebuild a specific object using the exact command line used by the build system which is different than just the compile flags.

ehristev commented 3 years ago

Applied, thanks !