Skip to content

Commit e572d08

Browse files
jpoimboeacmel
authored andcommitted
tools build: Add tools tree support for 'make -s'
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 <[email protected]> Signed-off-by: Josh Poimboeuf <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Michal Marek <[email protected]> Link: http://lkml.kernel.org/r/e8967562ef640c3ae9a76da4ae0f4e47df737c34.1484799200.git.jpoimboe@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent bf062bd commit e572d08

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,12 @@ endif
8787
ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
8888
ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
8989
quiet=silent_
90+
tools_silent=s
9091
endif
9192
else # make-3.8x
9293
ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
9394
quiet=silent_
95+
tools_silent=-s
9496
endif
9597
endif
9698

@@ -1607,11 +1609,11 @@ image_name:
16071609
# Clear a bunch of variables before executing the submake
16081610
tools/: FORCE
16091611
$(Q)mkdir -p $(objtree)/tools
1610-
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/
1612+
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/
16111613

16121614
tools/%: FORCE
16131615
$(Q)mkdir -p $(objtree)/tools
1614-
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/ $*
1616+
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(shell cd $(objtree) && /bin/pwd) subdir=tools -C $(src)/tools/ $*
16151617

16161618
# Single targets
16171619
# ---------------------------------------------------------------------------

tools/build/Makefile.build

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ else
1919
Q=@
2020
endif
2121

22+
ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
23+
ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
24+
quiet=silent_
25+
endif
26+
else # make-3.8x
27+
ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
28+
quiet=silent_
29+
endif
30+
endif
31+
2232
build-dir := $(srctree)/tools/build
2333

2434
# Define $(fixdep) for dep-cmd function

tools/scripts/Makefile.include

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ else
4646
NO_SUBDIR = :
4747
endif
4848

49+
ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
50+
ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
51+
silent=1
52+
endif
53+
else # make-3.8x
54+
ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
55+
silent=1
56+
endif
57+
endif
58+
4959
#
5060
# Define a callable command for descending to a new directory
5161
#
@@ -58,7 +68,7 @@ descend = \
5868
QUIET_SUBDIR0 = +$(MAKE) $(COMMAND_O) -C # space to separate -C and subdir
5969
QUIET_SUBDIR1 =
6070

61-
ifneq ($(findstring $(MAKEFLAGS),s),s)
71+
ifneq ($(silent),1)
6272
ifneq ($(V),1)
6373
QUIET_CC = @echo ' CC '$@;
6474
QUIET_CC_FPIC = @echo ' CC FPIC '$@;

0 commit comments

Comments
 (0)