[U-Boot] [PATCH] make make quiet

Only print out the target name during make. For old style set V=1
Signed-off-by: kenneth johansson kenneth@southpole.se --- actual patch at http://www.4shared.com/file/78174399/3496e05d/0001-make-make-quiet.html

Dear kenneth johansson,
In message 1230636057.17914.5.camel@duo you wrote:
Only print out the target name during make. For old style set V=1
What is the rationale for this patch? I can see no real advantage with it.
If you find the make output annoying, you can silence make by passing the "-s" flag.
On the other hand, your patch braks building with "-s" - I get:
$ make -s all grep: writing output: Broken pipe a - ppc_longjmp.o a - ppc_setjmp.o a - stubs.o a - bzlib.o a - bzlib_crctable.o a - bzlib_decompress.o a - bzlib_randtable.o a - bzlib_huffman.o a - crc16.o a - crc32.o a - ctype.o a - display_options.o a - div64.o a - gunzip.o a - lmb.o a - ldiv.o a - sha1.o a - string.o a - strmhz.o a - vsprintf.o a - zlib.o a - io.o a - firmware_sc_task_bestcomm.impl.o a - firmware_sc_task.impl.o a - i2c.o a - traps.o a - cpu.o a - cpu_init.o a - ide.o a - interrupts.o a - loadtask.o a - pci_mpc5200.o ...
etc.
Even without "-s" there are some errors for example when I try to build the "TQM5200" configuration.
But most of all, your patch costs a lot of additional processes. Running "make all" for above configuration takes 2150 processes without your patch, and 2410 with it. And this does not even count the additional calls to shell builtins.
Unless you have a really good reason why this patch should be applied, I tend to reject it.
Best regards,
Wolfgang Denk

Wolfgang Denk wrote:
Dear kenneth johansson,
In message 1230636057.17914.5.camel@duo you wrote:
Only print out the target name during make. For old style set V=1
What is the rationale for this patch? I can see no real advantage with it.
If you find the make output annoying, you can silence make by passing the "-s" flag.
FWIW, I like the Linux-style non-verbose but not completely silent output. It shows what is being built without too much noise. It's useful for sanity checking that edits got saved, dependencies are working, etc.
But most of all, your patch costs a lot of additional processes. Running "make all" for above configuration takes 2150 processes without your patch, and 2410 with it. And this does not even count the additional calls to shell builtins.
Unix scripting is inefficient, news at 11. What's the actual time difference?
-Scott

Dear Scott Wood,
In message 495AA094.7030708@freescale.com you wrote:
Unix scripting is inefficient, news at 11. What's the actual time difference?
What's the actual advantage?
Best regards,
Wolfgang Denk

On Tue, 2008-12-30 at 23:14 +0100, Wolfgang Denk wrote:
Dear kenneth johansson,
In message 1230636057.17914.5.camel@duo you wrote:
Only print out the target name during make. For old style set V=1
What is the rationale for this patch? I can see no real advantage with it.
To highlight warnings during build. It's just a way to make the default output less noise.
If you find the make output annoying, you can silence make by passing the "-s" flag.
-s is a bit to much you get no feedback at all.
On the other hand, your patch braks building with "-s" - I get:
oops that was not intended.
Even without "-s" there are some errors for example when I try to build the "TQM5200" configuration.
with errors I guess you mean non optimal output. the patch really should not have any impact on the binaries built. If it really breaks the build that is a real problem and one I do not see in my test.
Unless you have a really good reason why this patch should be applied, I tend to reject it.
No it's only a way to remove most of the noise as mentioned it has no effect on u-boot itself.
while it's a large patch it's mostly trivial search/replace so it's easy to remove should people object to it.
But please try it out for a while and see what people think. My guess is that the amount of warnings showing up during build will be reduced over time with this type of feedback during build.
here is a small addition to the patch fixing the issues with -s you found. --------------------------- diff --git a/board/tqc/tqm5200/Makefile b/board/tqc/tqm5200/Makefile index de0934b..b233e93 100644 --- a/board/tqc/tqm5200/Makefile +++ b/board/tqc/tqm5200/Makefile @@ -41,7 +41,7 @@ distclean: clean rm -f $(LIB) core *.bak $(obj).depend
cam5200_flash.o: cam5200_flash.c - $(CC) $(CFLAGS) -fno-strict-aliasing -c -o $@ $< + $(QUIET_CC)$(CC) $(CFLAGS) -fno-strict-aliasing -c -o $@ $<
#########################################################################
diff --git a/config.mk b/config.mk index 51a08e4..bab6ebb 100644 --- a/config.mk +++ b/config.mk @@ -214,10 +214,13 @@ ifndef V ARFLAGS = cr
export V -endif -else #($(findstring $(MAKEFLAGS),s),s) -ARFLAGS = crv -endif +else + ARFLAGS = crv +endif # V + +else + ARFLAGS = cr +endif # ($(findstring $(MAKEFLAGS),s),s)
ifndef REMOTE_BUILD diff --git a/post/Makefile b/post/Makefile index 74a0672..a7085ef 100644 --- a/post/Makefile +++ b/post/Makefile @@ -58,7 +58,7 @@ $(GPLIB): $(obj).depend $(OBJS)
# specific POST libraries $(SPLIB): $(obj).depend postdeps - $(MAKE) -C $(dir $(subst $(obj),,$@)) + @$(MAKE) -C $(dir $(subst $(obj),,$@))
# the POST lib archive $(LIB): $(GPLIB) $(SPLIB) diff --git a/post/rules.mk b/post/rules.mk index 1efc9c7..5fcb2d2 100644 --- a/post/rules.mk +++ b/post/rules.mk @@ -34,7 +34,7 @@ CPPFLAGS += -I$(TOPDIR) all: $(LIB)
$(LIB): $(obj).depend $(OBJS) - $(AR) $(ARFLAGS) $@ $(OBJS) + $(QUIET_AR)$(AR) $(ARFLAGS) $@ $(OBJS)
#########################################################################

On Wednesday 31 December 2008 04:23:53 kenneth johansson wrote:
On Tue, 2008-12-30 at 23:14 +0100, Wolfgang Denk wrote:
Dear kenneth johansson,
In message 1230636057.17914.5.camel@duo you wrote:
Only print out the target name during make. For old style set V=1
What is the rationale for this patch? I can see no real advantage with it.
To highlight warnings during build. It's just a way to make the default output less noise.
If you find the make output annoying, you can silence make by passing the "-s" flag.
-s is a bit to much you get no feedback at all.
you may want to include this kind of "usage" in the changelog
with errors I guess you mean non optimal output. the patch really should not have any impact on the binaries built. If it really breaks the build that is a real problem and one I do not see in my test.
i dont really like how the changes are integrated. it'll require constant maintenance to add these QUIET prefix vars. is there a reason we cant go the opposite direction and set CC/etc... directly ? or try unifying things with patterns ?
i.e. drop all of the $(AR) calls in board/*/Makefile and replace it with a toplevel pattern kind of like: %.a: %.o $(AR) $(ARFLAGS) $^ -o $@ -mike

On Wed, 2008-12-31 at 04:46 -0500, Mike Frysinger wrote:
i dont really like how the changes are integrated. it'll require constant maintenance to add these QUIET prefix vars. is there a reason we cant go the opposite direction and set CC/etc... directly ? or try unifying things with patterns ?
You really do not want CC AR and friends expand to anything else than the program name. It will only lead to confusion. except the AR stuff that has been copied all over the place there really is not that many places that has been changed and as far as maintenance goes there is none. People doing changes to makefiles simply cut & past from whats already there so this "style" will propagate by itself.
i.e. drop all of the $(AR) calls in board/*/Makefile and replace it with a toplevel pattern kind of like: %.a: %.o $(AR) $(ARFLAGS) $^ -o $@ -mike
sure but that would be a separate changeset. I was trying to keep the change as small as possible.

On Wednesday 31 December 2008 05:06:51 kenneth johansson wrote:
On Wed, 2008-12-31 at 04:46 -0500, Mike Frysinger wrote:
i.e. drop all of the $(AR) calls in board/*/Makefile and replace it with a toplevel pattern kind of like: %.a: %.o $(AR) $(ARFLAGS) $^ -o $@
sure but that would be a separate changeset. I was trying to keep the change as small as possible.
those two statements dont make sense together ... if you unify the boards first, then the resulting "quiet" patch is a lot smaller. -mike

On Wed, 2008-12-31 at 06:15 -0500, Mike Frysinger wrote:
On Wednesday 31 December 2008 05:06:51 kenneth johansson wrote:
On Wed, 2008-12-31 at 04:46 -0500, Mike Frysinger wrote:
i.e. drop all of the $(AR) calls in board/*/Makefile and replace it with a toplevel pattern kind of like: %.a: %.o $(AR) $(ARFLAGS) $^ -o $@
sure but that would be a separate changeset. I was trying to keep the change as small as possible.
those two statements dont make sense together ... if you unify the boards first, then the resulting "quiet" patch is a lot smaller. -mike
:) I did not mean the size of the patch I meant the impact of the change how easy it is to follow what has happened.
But if you do a rule for the library consolidation that works I'm happy to rebase my changes on top of that. I'm not going to do the lib stuff myself though.

Dear kenneth johansson,
In message 1230715433.19628.12.camel@duo you wrote:
If you find the make output annoying, you can silence make by passing the "-s" flag.
-s is a bit to much you get no feedback at all.
But that's the preferred way of doing things, at least according to Unix Philosophy.
No news is good news. Running a "./MAKEALL <boardname>" on a somewhat decent machine takes no more than 10...20 seconds. Either you get warnings / error messages, or not. What else is needed?
On the other hand, your patch braks building with "-s" - I get:
oops that was not intended.
Even without "-s" there are some errors for example when I try to build the "TQM5200" configuration.
with errors I guess you mean non optimal output. the patch really should
No, with errors I mean things like "grep: writing output: Broken pipe".
Unless you have a really good reason why this patch should be applied, I tend to reject it.
No it's only a way to remove most of the noise as mentioned it has no effect on u-boot itself.
If you want to have a silent build (which I do almost always, too), then either use "./MAKEALL <boardname>" or "make -s".
while it's a large patch it's mostly trivial search/replace so it's easy to remove should people object to it.
I diasgree. The changes are far from trivial.
here is a small addition to the patch fixing the issues with -s you found.
I think your appraoch (and that of kbuild, too) is fundamentally broken. Fixing this on the Makefile level is at least one level to far up. If you really want a verbosity level of make that is between no options (normal case) and no output (except warnings/errors, as with -s), then this should be implemnted within make itself, as a new make option.Then you have the changes in one place only, and each and every software package can benefit from it. Modifying hundrets of Makefiles here and there and then again for each new software package makes absolutely no sense to me.
U-Boot is the wrong place to fix this. Please fix this in make, for the benefit of others, too.
Best regards,
Wolfgang Denk

On Wed, Dec 31, 2008 at 08:47:54PM +0100, Wolfgang Denk wrote:
Dear kenneth johansson,
In message 1230715433.19628.12.camel@duo you wrote:
If you find the make output annoying, you can silence make by passing the "-s" flag.
-s is a bit to much you get no feedback at all.
But that's the preferred way of doing things, at least according to Unix Philosophy.
Let's not get so bogged down in following some overgeneralized philosophy that we ignore the preferences of users.
Besides, if you really wanted the build to be like a typical Unix tool, shouldn't -s be default, and verbose an option? Patches of this sort get closer to that.
Most people don't use -s, and this will make more people see warnings.
Unless you have a really good reason why this patch should be applied, I tend to reject it.
No it's only a way to remove most of the noise as mentioned it has no effect on u-boot itself.
If you want to have a silent build (which I do almost always, too), then either use "./MAKEALL <boardname>" or "make -s".
I don't want a silent build, I want a non-excessively-verbose build.
U-Boot is the wrong place to fix this. Please fix this in make, for the benefit of others, too.
Hmm, the best make could reasonably do on its own would be to print the name of each target, but that could get cluttered with intermediate and fake targets. While such an option would be very nice, I don't think it should preclude makefile support for nicer output.
-Scott

Dear Scott,
In message 20090105195311.GA24702@ld0162-tx32.am.freescale.net you wrote:
But that's the preferred way of doing things, at least according to Unix Philosophy.
Let's not get so bogged down in following some overgeneralized philosophy that we ignore the preferences of users.
Well, users are often in dire need to learn about the philosophical background of a design.
Besides, if you really wanted the build to be like a typical Unix tool, shouldn't -s be default, and verbose an option? Patches of this sort get closer to that.
I have to admit that I almost always just run "./MAKEALL boardname", which actually is as silent as "-s" (but it stores the *full* log in case anything goes wrong).
Most people don't use -s, and this will make more people see warnings.
Most people don;t use out of tree building either, and most people never run MAKEALL, not even before submitting patches.
That's the line of "a billion flies can't be wrong, you know.
U-Boot is the wrong place to fix this. Please fix this in make, for the benefit of others, too.
Hmm, the best make could reasonably do on its own would be to print the name of each target, but that could get cluttered with intermediate and fake targets. While such an option would be very nice, I don't think it should preclude makefile support for nicer output.
"make" knows exactly when it is running $(CC) or $(AS) or $(AR) or $(LD) etc., so it can do automatically what now everybody is adding to a zillion of innocent Makefiles.
Sorry, but the make process is complicated enough without this fancy stuff. Every now and then it shows funny behaviour. Just searcht he archives for obscure build errors on ext3 but not on NFS or vice versa. If ther eis a real "make" expert here, there are many better places to invest efforts for improvement. A semi-silent build is far, far down on th list.
Best regards,
Wolfgang Denk

Hello All,
My 2 cents: (I am NOT trying to start a flame war, although I understand how sensitive this subject is)
I think your appraoch (and that of kbuild, too) is fundamentally broken.
Maybe the configure structure, like u-boot has, that is so complex, so hard to customise, so error prone, and were relations between options is so unclear from the users perspective, is fundamentally broken ;-)))
I thought of it before to integrate Kconfig/kbuild and friends in U-boot, but I got the impression back then that it would have a very small chance of being ever accepted, so I did not invest much time in it...
So, I really like the kbuild/kconfig method to handle such a large amount of ifdefs options included the method of documenting the options. Hmm, that sounds like what u-boot-v2 is doing, and I wonder sometimes if it would exist at all if u-boot was using a different make structure? I think it is a pity that it separated in the first place, but that is a different discussion...
Fixing this on the Makefile level is at least one level to far up. If you really want a verbosity level of make that is between no options (normal case) and no output (except warnings/errors, as with -s), then this should be implemnted within make itself, as a new make option.Then you have the changes in one place only, and each and every software package can benefit from it. Modifying hundrets of Makefiles here and there and then again for each new software package makes absolutely no sense to me.
Maybe the linux makefile structure is a much better approach :-))) (in that case even weak-linking could work properly)
BTW: Kenneth is silent already for 5 days on this discussion, is he being scared off?
Kind Regards,
Remy

Dear Remy,
In message 3efb10970901051230w654dc1d0w2fbf878ca853cdcb@mail.gmail.com you wrote:
I think your appraoch (and that of kbuild, too) is fundamentally broken.
Maybe the configure structure, like u-boot has, that is so complex, so hard to customise, so error prone, and were relations between options is so unclear from the users perspective, is fundamentally broken ;-)))
It may be broken (or at least in need of imprevement), too. But that doesn't contradict my statement.
I thought of it before to integrate Kconfig/kbuild and friends in U-boot, but I got the impression back then that it would have a very small chance of being ever accepted, so I did not invest much time in it...
You know that Jean-Christophe is working on this, don't you?
Fixing this on the Makefile level is at least one level to far up. If you really want a verbosity level of make that is between no options (normal case) and no output (except warnings/errors, as with -s), then this should be implemnted within make itself, as a new make option.Then you have the changes in one place only, and each and every software package can benefit from it. Modifying hundrets of Makefiles here and there and then again for each new software package makes absolutely no sense to me.
Maybe the linux makefile structure is a much better approach :-))) (in that case even weak-linking could work properly)
No, please don't mix things up here. There are already quite a lot of tools out there which use such a "silencing" in their Makefiles. And more and more do it. So it cannot ba a bad thing, he?
But wait - it is a very basic principle of software design *not* to do the same thing again and again and from scratch in every new project. It is good design to do this just *once*, at the right place where it provides the required function for all those looking for that feature.
If semi-silent output from a Makefile is wanted, then the "make" tool itself is the correct place to add this feature. Adding it to a zillion Makefiles in many different projects is very fundamentally broken.
Best regards,
Wolfgang Denk

On Tue, Dec 30, 2008 at 12:20:57PM +0100, kenneth johansson wrote:
Only print out the target name during make. For old style set V=1
Signed-off-by: kenneth johansson kenneth@southpole.se
Sidenote: u-boot-v2 uses the standard Linux build system and has quiet operation as the default case.
rsc
participants (6)
-
kenneth johansson
-
Mike Frysinger
-
Remy Bohmer
-
Robert Schwebel
-
Scott Wood
-
Wolfgang Denk