xfs
[Top] [All Lists]

Re: [PATCH] xfsprogs: Make the compile output cleaner

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfsprogs: Make the compile output cleaner
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Tue, 12 Jan 2010 21:51:24 -0600
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1263350021-5733-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1263350021-5733-1-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)
Dave Chinner wrote:
> We don't need to see every compiler command line for every file that
> is compiled. This makes it hard to see warnings and errors during
> compile. For progress notification, we really only need to see the
> diretory/file being operated on.
>
> Turn down the verbosity of output by suppressing various make output
> and provide better overall visibility of which directory is being
> operated on, what the operation is and what is being done to the
> files by the build/clean process.
>
> Sample output from a build:
>
> ....
> Building libxlog
>     [CC] xfs_log_recover.c
>     [CC] util.c
>     [LD] libxlog.la
>   

...

swanky!

What would you think of this on top of it, ripped straight from
kbuild - that way "make V=1" works the same way as kbuild, but
the default is still to be quiet.

Also, just to show my kbuild bias, maybe consider outputting the target
on the quiet line, instead of the source?  :)  But no biggie.

-Eric



diff --git a/Makefile b/Makefile
index 2fbfb51..46e6a3e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,20 @@
 #
 # Copyright (c) 2000-2006 Silicon Graphics, Inc.  All Rights Reserved.
 #
-Q ?= @
+
+ifeq ("$(origin V)", "command line")
+  BUILD_VERBOSE = $(V)
+endif
+ifndef BUILD_VERBOSE
+  BUILD_VERBOSE = 0
+endif
+
+ifeq ($(BUILD_VERBOSE),1)
+  Q =
+else
+  Q = @
+endif
+
 MAKEOPTS = --no-print-directory Q=$(Q)
 
 TOPDIR = .
diff --git a/include/buildrules b/include/buildrules
index a0c77a9..72edc69 100644
--- a/include/buildrules
+++ b/include/buildrules
@@ -50,11 +50,11 @@ $(LTLIBRARY) : $(SUBDIRS) $(LTOBJECTS)
        $(Q)$(LTLINK) $(LTLDFLAGS) -o $(LTLIBRARY) $(LTOBJECTS) $(LTLIBS)
 
 %.lo: %.c
-       @echo "    [CC] $<"
+       @echo "    [CC] $@"
        $(Q)$(LTCOMPILE) -c $<
 else
 %.o: %.c
-       @echo "    [CC] $<"
+       @echo "    [CC] $@"
        $(Q)$(CC) $(CFLAGS) -c $<
 
 endif


<Prev in Thread] Current Thread [Next in Thread>