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
directory/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.
This patch only addresses the top level makefile and build rules; it
does not clean up the subdirectories - these will be addressed by a
followup patch. It also does not touch the dmapi section of the
xfstests build system.
The old style verbose builds can still be run via "make V=1 ..."
Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
# Copyright (c) 2000-2008 Silicon Graphics, Inc. All Rights Reserved.
#
# Copyright (c) 2000-2008 Silicon Graphics, Inc. All Rights Reserved.
#
+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 = .
HAVE_BUILDDEFS = $(shell test -f $(TOPDIR)/include/builddefs && echo yes || echo no)
TOPDIR = .
HAVE_BUILDDEFS = $(shell test -f $(TOPDIR)/include/builddefs && echo yes || echo no)
TESTS = $(shell sed -n -e '/^[0-9][0-9][0-9]*/s/ .*//p' group)
CONFIGURE = configure include/builddefs include/config.h
TESTS = $(shell sed -n -e '/^[0-9][0-9][0-9]*/s/ .*//p' group)
CONFIGURE = configure include/builddefs include/config.h
-DMAPI_MAKEFILE = dmapi/Makefile
LSRCFILES = configure configure.in aclocal.m4 README VERSION
LDIRT = config.log .dep config.status config.cache confdefs.h conftest* \
check.log check.time
LSRCFILES = configure configure.in aclocal.m4 README VERSION
LDIRT = config.log .dep config.status config.cache confdefs.h conftest* \
check.log check.time
+ifeq ($(HAVE_DMAPI), true)
+DMAPI_MAKEFILE = dmapi/Makefile
+endif
+
LIB_SUBDIRS = include lib
TOOL_SUBDIRS = ltp src m4
LIB_SUBDIRS = include lib
TOOL_SUBDIRS = ltp src m4
default: include/builddefs include/config.h $(DMAPI_MAKEFILE) new remake check $(TESTS)
ifeq ($(HAVE_BUILDDEFS), no)
default: include/builddefs include/config.h $(DMAPI_MAKEFILE) new remake check $(TESTS)
ifeq ($(HAVE_BUILDDEFS), no)
+ $(Q)$(MAKE) $(MAKEOPTS) $@
+ $(Q)$(MAKE) $(MAKEOPTS) $(SUBDIRS)
# automake doesn't always support "default" target
# so do dmapi make explicitly with "all"
ifeq ($(HAVE_DMAPI), true)
# automake doesn't always support "default" target
# so do dmapi make explicitly with "all"
ifeq ($(HAVE_DMAPI), true)
- $(MAKE) -C $(TOPDIR)/dmapi all
+ $(Q)$(MAKE) $(MAKEOPTS) -C $(TOPDIR)/dmapi all
install-dev install-lib:
%-install:
install-dev install-lib:
%-install:
+ $(MAKE) $(MAKEOPTS) -C $* install
realclean distclean: clean
rm -f $(LDIRT) $(CONFIGURE)
realclean distclean: clean
rm -f $(LDIRT) $(CONFIGURE)
LDFLAGS += $(LOADERFLAGS) $(LLDFLAGS)
LDLIBS = $(LLDLIBS) $(PLDLIBS) $(MALLOCLIB)
LDFLAGS += $(LOADERFLAGS) $(LLDFLAGS)
LDLIBS = $(LLDLIBS) $(PLDLIBS) $(MALLOCLIB)
-MAKEOPTS = --no-print-directory
+MAKEOPTS = --no-print-directory Q=$(Q)
SRCFILES = Makefile $(HFILES) $(CFILES) $(LSRCFILES) $(LFILES) $(YFILES)
DEPDIRT = dep dep.bak
SRCFILES = Makefile $(HFILES) $(CFILES) $(LSRCFILES) $(LFILES) $(YFILES)
DEPDIRT = dep dep.bak
LTOBJECTS = $(OBJECTS:.o=.lo)
LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
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_LIB_DIR)
ifeq ($(ENABLE_SHARED),yes)
LTLDFLAGS += -rpath $(PKG_LIB_DIR)
include $(TOPDIR)/include/builddefs
clean clobber : $(addsuffix -clean,$(SUBDIRS))
include $(TOPDIR)/include/builddefs
clean clobber : $(addsuffix -clean,$(SUBDIRS))
- rm -f $(DIRT)
- @rm -fr .libs
+ $(Q)rm -f $(DIRT)
+ $(Q)rm -fr .libs
+ @echo "Cleaning $*"
+ $(Q)$(MAKE) $(MAKEOPTS) -q -C $* clean || $(MAKE) $(MAKEOPTS) -C $* clean
# Never blow away subdirs
ifdef SUBDIRS
# Never blow away subdirs
ifdef SUBDIRS
.PHONY: $(SUBDIRS)
$(SUBDIRS):
.PHONY: $(SUBDIRS)
$(SUBDIRS):
+ @echo "Building $@"
+ $(Q)$(MAKE) $(MAKEOPTS) -q -C $@ || $(MAKE) $(MAKEOPTS) -C $@
ifdef LTCOMMAND
$(LTCOMMAND) : $(SUBDIRS) $(OBJECTS) $(LTDEPENDENCIES)
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)
endif
ifdef LTLIBRARY
$(LTLIBRARY) : $(SUBDIRS) $(LTOBJECTS)
- $(LTLINK) $(LTLDFLAGS) -o $(LTLIBRARY) $(LTOBJECTS) $(LTLIBS)
+ @echo " [LD] $*"
+ $(Q)$(LTLINK) $(LTLDFLAGS) -o $(LTLIBRARY) $(LTOBJECTS) $(LTLIBS)
+ @echo " [CC] $@"
+ $(Q)$(LTCOMPILE) -c $<
+else
+%.o: %.c
+ @echo " [CC] $@"
+ $(Q)$(CC) $(CFLAGS) -c $<
+