* [PATCH] xfsprogs: Make the compile output cleaner
@ 2010-01-13 2:33 Dave Chinner
2010-01-13 3:51 ` Eric Sandeen
0 siblings, 1 reply; 3+ messages in thread
From: Dave Chinner @ 2010-01-13 2:33 UTC (permalink / raw)
To: xfs
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
Building libxcmd
[CC] command.c
[CC] input.c
[CC] paths.c
[CC] projects.c
[CC] help.c
[CC] quit.c
[LD] libxcmd.la
....
Sample output from cleaning:
$ make clean
Cleaning include
Cleaning libxfs
Cleaning libxlog
Cleaning libxcmd
Cleaning libhandle
Cleaning libdisk
Cleaning copy
Cleaning db
....
If you want to see a noisy build (i.e. every command), use:
$ make Q=
and that will output all the commands that are now suppressed by
default.
Signed-off-by: Dave Chinner <david@fromorbit.com>
---
Makefile | 24 +++++++++++++-----------
include/buildmacros | 10 +++++-----
include/buildrules | 24 +++++++++++++++++-------
mkfs/Makefile | 3 ++-
4 files changed, 37 insertions(+), 24 deletions(-)
diff --git a/Makefile b/Makefile
index 2d394e4..2fbfb51 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,8 @@
#
# Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
#
+Q ?= @
+MAKEOPTS = --no-print-directory Q=$(Q)
TOPDIR = .
HAVE_BUILDDEFS = $(shell test -f $(TOPDIR)/include/builddefs && echo yes || echo no)
@@ -36,9 +38,9 @@ SUBDIRS = include $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
default: include/builddefs include/platform_defs.h
ifeq ($(HAVE_BUILDDEFS), no)
- $(MAKE) -C . $@
+ $(Q)$(MAKE) $(MAKEOPTS) -C . $@
else
- $(MAKE) $(SUBDIRS)
+ $(Q)$(MAKE) $(MAKEOPTS) $(SUBDIRS)
endif
# tool/lib dependencies
@@ -80,7 +82,7 @@ include/platform_defs.h: include/builddefs
## Recover from the removal of $@
@if test -f $@; then :; else \
rm -f include/builddefs; \
- $(MAKE) $(AM_MAKEFLAGS) include/builddefs; \
+ $(MAKE) $(MAKEOPTS) $(AM_MAKEFLAGS) include/builddefs; \
fi
install: default $(addsuffix -install,$(SUBDIRS))
@@ -111,19 +113,19 @@ realclean: distclean
#
dist: include/builddefs include/platform_defs.h default
ifeq ($(HAVE_BUILDDEFS), no)
- $(MAKE) -C . $@
+ $(Q)$(MAKE) $(MAKEOPTS) -C . $@
else
- $(MAKE) $(SRCTAR)
+ $(Q)$(MAKE) $(MAKEOPTS) $(SRCTAR)
endif
deb: include/builddefs include/platform_defs.h
ifeq ($(HAVE_BUILDDEFS), no)
- $(MAKE) -C . $@
+ $(Q)$(MAKE) $(MAKEOPTS) -C . $@
else
- $(MAKE) $(SRCDIR)
- $(MAKE) -C po
- $(MAKE) source-link
- cd $(SRCDIR) && dpkg-buildpackage
+ $(Q)$(MAKE) $(MAKEOPTS) $(SRCDIR)
+ $(Q)$(MAKE) $(MAKEOPTS) -C po
+ $(Q)$(MAKE) $(MAKEOPTS) source-link
+ $(Q)cd $(SRCDIR) && dpkg-buildpackage
endif
$(SRCDIR) : $(_FORCE)
@@ -131,6 +133,6 @@ $(SRCDIR) : $(_FORCE)
mkdir -p $@
$(SRCTAR) : default $(SRCDIR)
- $(MAKE) source-link
+ $(Q)$(MAKE) $(MAKEOPTS) source-link
unset TAPE; $(TAR) -cf - $(SRCDIR) | $(ZIP) --best > $@ && \
echo Wrote: $@
diff --git a/include/buildmacros b/include/buildmacros
index 099570f..62babca 100644
--- a/include/buildmacros
+++ b/include/buildmacros
@@ -13,7 +13,7 @@ LDFLAGS += $(LOADERFLAGS) $(LLDFLAGS)
LTLDFLAGS += $(LOADERFLAGS)
LDLIBS = $(LLDLIBS) $(PLDLIBS) $(MALLOCLIB)
-MAKEOPTS = --no-print-directory
+MAKEOPTS = --no-print-directory Q=$(Q)
SRCFILES = Makefile $(HFILES) $(CFILES) $(LSRCFILES) $(LFILES) $(YFILES)
SRCFILES += $(QAHFILES)
@@ -45,10 +45,10 @@ LIBNAME = $(basename $(LTLIBRARY))
LTOBJECTS = $(OBJECTS:.o=.lo)
LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-LTLINK = $(LIBTOOL) --tag=CC --mode=link $(CC)
-LTEXEC = $(LIBTOOL) --mode=execute
-LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CCF)
+LTLINK = $(LIBTOOL) --quiet --tag=CC --mode=link $(CC)
+LTEXEC = $(LIBTOOL) --quiet --mode=execute
+LTINSTALL = $(LIBTOOL) --quiet --mode=install $(INSTALL)
+LTCOMPILE = $(LIBTOOL) --quiet --tag=CC --mode=compile $(CCF)
ifeq ($(ENABLE_SHARED),yes)
LTLDFLAGS += -rpath $(PKG_ROOT_LIB_DIR)
diff --git a/include/buildrules b/include/buildrules
index a06d480..a0c77a9 100644
--- a/include/buildrules
+++ b/include/buildrules
@@ -7,10 +7,11 @@ _BUILDRULES_INCLUDED_ = 1
include $(TOPDIR)/include/builddefs
clean clobber : $(addsuffix -clean,$(SUBDIRS))
- rm -f $(DIRT)
- rm -fr $(DIRDIRT)
+ $(Q)rm -f $(DIRT)
+ $(Q)rm -fr $(DIRDIRT)
%-clean:
- $(MAKE) -C $* clean
+ @echo "Cleaning $*"
+ $(Q)$(MAKE) $(MAKEOPTS) -C $* clean
# Never blow away subdirs
ifdef SUBDIRS
@@ -18,7 +19,8 @@ ifdef SUBDIRS
.PHONY: $(SUBDIRS)
$(SUBDIRS):
- $(MAKE) -C $@
+ @echo "Building $@"
+ $(Q)$(MAKE) $(MAKEOPTS) -C $@
endif
source-link:
@@ -38,15 +40,23 @@ source-link:
ifdef LTCOMMAND
$(LTCOMMAND) : $(SUBDIRS) $(OBJECTS) $(LTDEPENDENCIES)
- $(LTLINK) -o $@ $(LDFLAGS) $(OBJECTS) $(LDLIBS)
+ @echo " [LD] $@"
+ $(Q)$(LTLINK) -o $@ $(LDFLAGS) $(OBJECTS) $(LDLIBS)
endif
ifdef LTLIBRARY
$(LTLIBRARY) : $(SUBDIRS) $(LTOBJECTS)
- $(LTLINK) $(LTLDFLAGS) -o $(LTLIBRARY) $(LTOBJECTS) $(LTLIBS)
+ @echo " [LD] $@"
+ $(Q)$(LTLINK) $(LTLDFLAGS) -o $(LTLIBRARY) $(LTOBJECTS) $(LTLIBS)
%.lo: %.c
- $(LTCOMPILE) -c $<
+ @echo " [CC] $<"
+ $(Q)$(LTCOMPILE) -c $<
+else
+%.o: %.c
+ @echo " [CC] $<"
+ $(Q)$(CC) $(CFLAGS) -c $<
+
endif
ifdef POTHEAD
diff --git a/mkfs/Makefile b/mkfs/Makefile
index 9fcadf2..7065f24 100644
--- a/mkfs/Makefile
+++ b/mkfs/Makefile
@@ -36,7 +36,8 @@ endif
include $(BUILDRULES)
$(FSTYP):
- $(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS) $(LIBDISK) $(PLDLIBS)
+ @echo " [CC] $@"
+ $(Q)$(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS) $(LIBDISK) $(PLDLIBS)
install: default
$(INSTALL) -m 755 -d $(PKG_ROOT_SBIN_DIR)
--
1.6.5
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfsprogs: Make the compile output cleaner
2010-01-13 2:33 [PATCH] xfsprogs: Make the compile output cleaner Dave Chinner
@ 2010-01-13 3:51 ` Eric Sandeen
2010-01-13 4:29 ` Eric Sandeen
0 siblings, 1 reply; 3+ messages in thread
From: Eric Sandeen @ 2010-01-13 3:51 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs
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
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfsprogs: Make the compile output cleaner
2010-01-13 3:51 ` Eric Sandeen
@ 2010-01-13 4:29 ` Eric Sandeen
0 siblings, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2010-01-13 4:29 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs
Eric Sandeen wrote:
> 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
>
>
ok now I'm being a make junkie, but a couple more things are "noisy"
Building include
[LN] xfs
[LN] disk
...
Building doc
[ZIP] CHANGES.gz
Building po
[GETTXT] xfsprogs.pot
-Eric
diff --git a/include/Makefile b/include/Makefile
index d89480e..42e7233 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -43,7 +43,8 @@ LDIRT = xfs disk
default install: xfs disk
xfs disk:
- $(LN_S) . $@
+ @echo " [LN]" $@
+ $(Q)$(LN_S) . $@
include $(BUILDRULES)
diff --git a/doc/Makefile b/doc/Makefile
index 8f65b66..0a6de15 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -13,7 +13,8 @@ default: CHANGES.gz
include $(BUILDRULES)
CHANGES.gz:
- $(ZIP) --best -c < CHANGES > $@
+ @echo " [ZIP] $@"
+ $(Q)$(ZIP) --best -c < CHANGES > $@
install: default
$(INSTALL) -m 755 -d $(PKG_DOC_DIR)
diff --git a/include/buildrules b/include/buildrules
index 72edc69..ba004e6 100644
--- a/include/buildrules
+++ b/include/buildrules
@@ -61,7 +61,8 @@ endif
ifdef POTHEAD
$(POTHEAD): $(XGETTEXTFILES)
- $(XGETTEXT) --language=C --keyword=_ --keyword=N_ -o $@ $(XGETTEXTFILES)
+ @echo "[GETTXT] $@"
+ $(Q)$(XGETTEXT) --language=C --keyword=_ --keyword=N_ -o $@ $(XGETTEXTFILES)
# Update translations
update-po: $(POTHEAD) $(wildcard $(TOPDIR)/po/*.po)
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-01-13 4:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-13 2:33 [PATCH] xfsprogs: Make the compile output cleaner Dave Chinner
2010-01-13 3:51 ` Eric Sandeen
2010-01-13 4:29 ` Eric Sandeen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox