Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1571528

[PATCH 02/14] tools build: Add tools tree support for 'make -s'

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 02/14] tools build: Add tools tree support for 'make -s'
Date 2017-02-01 13:30 +0100
Message-ID <t62cX-5Vf-49@gated-at.bofh.it> (permalink)
References <t62cV-5Vf-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Josh Poimboeuf <jpoimboe@redhat.com>

When doing a kernel build with 'make -s', everything is silenced except
the objtool build.  That's because the tools tree support for silent
builds is some combination of missing and broken.

Three changes are needed to fix it:

- Makefile: propagate '-s' to the sub-make's MAKEFLAGS variable so the
  tools Makefiles can see it.

- tools/scripts/Makefile.include: fix the tools Makefiles' ability to
  recognize '-s'.  The MAKE_VERSION and MAKEFLAGS checks are copied from
  the top-level Makefile.  This silences the "DESCEND objtool" message.

- tools/build/Makefile.build: add support to the tools Build files for
  recognizing '-s'.  Again the MAKE_VERSION and MAKEFLAGS checks are
  copied from the top-level Makefile.  This silences all the object
  compile/link messages.

Reported-and-Tested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Michal Marek <mmarek@suse.com>
Link: http://lkml.kernel.org/r/e8967562ef640c3ae9a76da4ae0f4e47df737c34.1484799200.git.jpoimboe@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 Makefile                       |  6 ++++--
 tools/build/Makefile.build     | 10 ++++++++++
 tools/scripts/Makefile.include | 12 +++++++++++-
 3 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 098840012b9b..80341dfb2c50 100644
--- a/Makefile
+++ b/Makefile
@@ -87,10 +87,12 @@ endif
 ifneq ($(filter 4.%,$(MAKE_VERSION)),)	# make-4
 ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
   quiet=silent_
+  tools_silent=s
 endif
 else					# make-3.8x
 ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
   quiet=silent_
+  tools_silent=-s
 endif
 endif
 
@@ -1607,11 +1609,11 @@ image_name:
 # Clear a bunch of variables before executing the submake
 tools/: FORCE
 	$(Q)mkdir -p $(objtree)/tools
-	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/
+	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/
 
 tools/%: FORCE
 	$(Q)mkdir -p $(objtree)/tools
-	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/ $*
+	$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/ $*
 
 # Single targets
 # ---------------------------------------------------------------------------
diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index 99c0ccd2f176..e279a71c650d 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -19,6 +19,16 @@ else
   Q=@
 endif
 
+ifneq ($(filter 4.%,$(MAKE_VERSION)),)	# make-4
+ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
+  quiet=silent_
+endif
+else					# make-3.8x
+ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
+  quiet=silent_
+endif
+endif
+
 build-dir := $(srctree)/tools/build
 
 # Define $(fixdep) for dep-cmd function
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index 8abbef164b4e..19edc1a7a232 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -46,6 +46,16 @@ else
 NO_SUBDIR = :
 endif
 
+ifneq ($(filter 4.%,$(MAKE_VERSION)),)  # make-4
+ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
+  silent=1
+endif
+else					# make-3.8x
+ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
+  silent=1
+endif
+endif
+
 #
 # Define a callable command for descending to a new directory
 #
@@ -58,7 +68,7 @@ descend = \
 QUIET_SUBDIR0  = +$(MAKE) $(COMMAND_O) -C # space to separate -C and subdir
 QUIET_SUBDIR1  =
 
-ifneq ($(findstring $(MAKEFLAGS),s),s)
+ifneq ($(silent),1)
   ifneq ($(V),1)
 	QUIET_CC       = @echo '  CC       '$@;
 	QUIET_CC_FPIC  = @echo '  CC FPIC  '$@;
-- 
2.9.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-01 13:30 +0100
  [PATCH 07/14] tools lib bpf: Add BPF program pinning APIs Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-01 13:30 +0100
  [PATCH 01/14] perf ftrace: Remove needless code setting default tracer Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-01 13:30 +0100
  [PATCH 10/14] tools perf util: Make rm_rf(path) argument const Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-01 13:30 +0100
  [PATCH 04/14] perf tools: Propagate perf_config() errors Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-01 13:30 +0100
  [PATCH 12/14] perf test: Add libbpf pinning test Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-01 13:30 +0100
  [PATCH 13/14] perf tools: Create for_each_event macro for tracepoints iteration Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-01 13:30 +0100
  [PATCH 02/14] tools build: Add tools tree support for 'make -s' Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-01 13:30 +0100
  [PATCH 09/14] tools lib bpf: Add bpf_object__pin() Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-01 13:30 +0100
  Re: [GIT PULL 00/14] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2017-02-01 15:40 +0100

csiph-web