[PATCH iproute2] Make builds default to quiet mode

2016-05-24 Thread David Ahern
Similar to the Linux kernel and perf add infrastructure to reduce the
amount of output tossed to a user during a build. Full build output
can be obtained with 'make V=1'

Builds go from:

make[1]: Leaving directory `/home/dsa/iproute2.git/lib'
make[1]: Entering directory `/home/dsa/iproute2.git/ip'
gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations 
-Wold-style-definition -Wformat=2 -O2 -I../include -DRESOLVE_HOSTNAMES 
-DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE-c -o ip.o 
ip.c
gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations 
-Wold-style-definition -Wformat=2 -O2 -I../include -DRESOLVE_HOSTNAMES 
-DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE-c -o 
ipaddress.o ipaddress.c

to:

...
AR   libutil.a

ip
CC   ip.o
CC   ipaddress.o
...

Signed-off-by: David Ahern 
---
 Makefile |  6 +-
 bridge/Makefile  |  1 +
 configure| 32 
 devlink/Makefile |  1 +
 genl/Makefile|  1 +
 ip/Makefile  |  2 ++
 lib/Makefile |  4 ++--
 misc/Makefile| 12 +++-
 tc/Makefile  | 15 ---
 tipc/Makefile|  1 +
 10 files changed, 60 insertions(+), 15 deletions(-)

diff --git a/Makefile b/Makefile
index 7f79cdd67f2d..99a1a6f31c0d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,7 @@
+ifndef VERBOSE
+MAKEFLAGS += --no-print-directory
+endif
+
 PREFIX?=/usr
 LIBDIR?=$(PREFIX)/lib
 SBINDIR?=/sbin
@@ -50,7 +54,7 @@ LDLIBS += $(LIBNETLINK)
 all: Config
@set -e; \
for i in $(SUBDIRS); \
-   do $(MAKE) $(MFLAGS) -C $$i; done
+   do echo "\n$$i"; $(MAKE) $(MFLAGS) -C $$i; done
 
 Config:
sh configure $(KERNEL_INCLUDE)
diff --git a/bridge/Makefile b/bridge/Makefile
index 98007530240a..7203f70bc510 100644
--- a/bridge/Makefile
+++ b/bridge/Makefile
@@ -9,6 +9,7 @@ endif
 all: bridge
 
 bridge: $(BROBJ) $(LIBNETLINK) 
+   $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
 
 install: all
install -m 0755 bridge $(DESTDIR)$(SBINDIR)
diff --git a/configure b/configure
index d2540b0d3219..60eb6b51a571 100755
--- a/configure
+++ b/configure
@@ -317,7 +317,35 @@ EOF
 rm -f $TMPDIR/dbtest.c $TMPDIR/dbtest
 }
 
+quiet_config()
+{
+   cat > Config
+
 check_toolchain
 
 echo "TC schedulers"
@@ -357,3 +385,7 @@ echo
 echo -n "docs:"
 check_docs
 echo
+
+echo >> Config
+echo "%.o: %.c" >> Config
+echo ' $(QUIET_CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<' >> Config
diff --git a/devlink/Makefile b/devlink/Makefile
index 3fdaa6904ee1..7256c28708eb 100644
--- a/devlink/Makefile
+++ b/devlink/Makefile
@@ -12,6 +12,7 @@ endif
 all: $(TARGETS) $(LIBS)
 
 devlink: $(DEVLINKOBJ)
+   $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
 
 install: all
install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR)
diff --git a/genl/Makefile b/genl/Makefile
index 03d1f26a1cee..f5a0bfe42aff 100644
--- a/genl/Makefile
+++ b/genl/Makefile
@@ -20,6 +20,7 @@ endif
 all: genl
 
 genl: $(GENLOBJ) $(LIBNETLINK) $(LIBUTIL) $(GENLLIB)
+   $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
 
 install: all
install -m 0755 genl $(DESTDIR)$(SBINDIR)
diff --git a/ip/Makefile b/ip/Makefile
index 2194ed9642eb..bb85fe3e6610 100644
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -24,8 +24,10 @@ TARGETS=ip rtmon
 all: $(TARGETS) $(SCRIPTS)
 
 ip: $(IPOBJ) $(LIBNETLINK)
+   $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
 
 rtmon: $(RTMONOBJ)
+   $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
 
 install: all
install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR)
diff --git a/lib/Makefile b/lib/Makefile
index 9d1307dd4df2..52e016db50b6 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -15,10 +15,10 @@ NLOBJ=libgenl.o ll_map.o libnetlink.o
 all: libnetlink.a libutil.a
 
 libnetlink.a: $(NLOBJ)
-   $(AR) rcs $@ $(NLOBJ)
+   $(QUIET_AR)$(AR) rcs $@ $^
 
 libutil.a: $(UTILOBJ) $(ADDLIB)
-   $(AR) rcs $@ $(UTILOBJ) $(ADDLIB)
+   $(QUIET_AR)$(AR) rcs $@ $^
 
 install:
 
diff --git a/misc/Makefile b/misc/Makefile
index f50e7403a33b..72807678054b 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -21,23 +21,25 @@ endif
 all: $(TARGETS)
 
 ss: $(SSOBJ)
+   $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
 
 nstat: nstat.c
-   $(CC) $(CFLAGS) $(LDFLAGS) -o nstat nstat.c $(LIBNETLINK) -lm
+   $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o nstat nstat.c $(LIBNETLINK) -lm
 
 ifstat: ifstat.c
-   $(CC) $(CFLAGS) $(LDFLAGS) -o ifstat ifstat.c $(LIBNETLINK) -lm
+   $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o ifstat ifstat.c $(LIBNETLINK) 
-lm
 
 rtacct: rtacct.c
-   $(CC) $(CFLAGS) $(LDFLAGS) -o rtacct rtacct.c $(LIBNETLINK) -lm
+   $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o rtacct rtacct.c $(LIBNETLINK) 
-lm
 
 arpd: arpd.c
-   

Re: [PATCH iproute2] Make builds default to quiet mode

2016-05-24 Thread Andreas Schwab
David Ahern  writes:

> @@ -50,7 +54,7 @@ LDLIBS += $(LIBNETLINK)
>  all: Config
>   @set -e; \
>   for i in $(SUBDIRS); \
> - do $(MAKE) $(MFLAGS) -C $$i; done
> + do echo "\n$$i"; $(MAKE) $(MFLAGS) -C $$i; done

echo "\n" is not portable.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."