aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-07-10 21:40:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-07-10 21:40:47 -0400
commitfe5aa8a65bab2548aa7282d331edc690dd7da1af (patch)
tree73ad6e96b95cefd3af26fbcc93638a00fbd0e343
parentb67db9d5e1294ddcd7f9bea43736a897132f4df7 (diff)
parentdd5a6752ae7df4e0ba6ce3bcd0c3b4489bb3537f (diff)
Merge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kbuild fixes from Michal Marek: "Three more fixes for the relative build dir feature: - Shut up make -s again - Fix for rpm/deb/tar-pkg with O=<subdir> - Fix for CONFIG_EXTRA_FIRMWARE" * 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: firmware: Create directories for external firmware kbuild: Fix packaging targets with relative $(srctree) kbuild: Do not print the build directory with make -s
-rw-r--r--Makefile99
-rw-r--r--firmware/Makefile6
2 files changed, 57 insertions, 48 deletions
diff --git a/Makefile b/Makefile
index 4d75b4bceedd..216708499c38 100644
--- a/Makefile
+++ b/Makefile
@@ -41,6 +41,29 @@ unexport GREP_OPTIONS
41# descending is started. They are now explicitly listed as the 41# descending is started. They are now explicitly listed as the
42# prepare rule. 42# prepare rule.
43 43
44# Beautify output
45# ---------------------------------------------------------------------------
46#
47# Normally, we echo the whole command before executing it. By making
48# that echo $($(quiet)$(cmd)), we now have the possibility to set
49# $(quiet) to choose other forms of output instead, e.g.
50#
51# quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@
52# cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
53#
54# If $(quiet) is empty, the whole command will be printed.
55# If it is set to "quiet_", only the short version will be printed.
56# If it is set to "silent_", nothing will be printed at all, since
57# the variable $(silent_cmd_cc_o_c) doesn't exist.
58#
59# A simple variant is to prefix commands with $(Q) - that's useful
60# for commands that shall be hidden in non-verbose mode.
61#
62# $(Q)ln $@ :<
63#
64# If KBUILD_VERBOSE equals 0 then the above command will be hidden.
65# If KBUILD_VERBOSE equals 1 then the above command is displayed.
66#
44# To put more focus on warnings, be less verbose as default 67# To put more focus on warnings, be less verbose as default
45# Use 'make V=1' to see the full commands 68# Use 'make V=1' to see the full commands
46 69
@@ -51,6 +74,29 @@ ifndef KBUILD_VERBOSE
51 KBUILD_VERBOSE = 0 74 KBUILD_VERBOSE = 0
52endif 75endif
53 76
77ifeq ($(KBUILD_VERBOSE),1)
78 quiet =
79 Q =
80else
81 quiet=quiet_
82 Q = @
83endif
84
85# If the user is running make -s (silent mode), suppress echoing of
86# commands
87
88ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
89ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
90 quiet=silent_
91endif
92else # make-3.8x
93ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
94 quiet=silent_
95endif
96endif
97
98export quiet Q KBUILD_VERBOSE
99
54# Call a source code checker (by default, "sparse") as part of the 100# Call a source code checker (by default, "sparse") as part of the
55# C compilation. 101# C compilation.
56# 102#
@@ -128,8 +174,11 @@ $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
128 174
129# Fake the "Entering directory" message once, so that IDEs/editors are 175# Fake the "Entering directory" message once, so that IDEs/editors are
130# able to understand relative filenames. 176# able to understand relative filenames.
177 echodir := @echo
178 quiet_echodir := @echo
179silent_echodir := @:
131sub-make: FORCE 180sub-make: FORCE
132 @echo "make[1]: Entering directory \`$(KBUILD_OUTPUT)'" 181 $($(quiet)echodir) "make[1]: Entering directory \`$(KBUILD_OUTPUT)'"
133 $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ 182 $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
134 KBUILD_SRC=$(CURDIR) \ 183 KBUILD_SRC=$(CURDIR) \
135 KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \ 184 KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \
@@ -292,52 +341,6 @@ endif
292export KBUILD_MODULES KBUILD_BUILTIN 341export KBUILD_MODULES KBUILD_BUILTIN
293export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD 342export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD
294 343
295# Beautify output
296# ---------------------------------------------------------------------------
297#
298# Normally, we echo the whole command before executing it. By making
299# that echo $($(quiet)$(cmd)), we now have the possibility to set
300# $(quiet) to choose other forms of output instead, e.g.
301#
302# quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@
303# cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
304#
305# If $(quiet) is empty, the whole command will be printed.
306# If it is set to "quiet_", only the short version will be printed.
307# If it is set to "silent_", nothing will be printed at all, since
308# the variable $(silent_cmd_cc_o_c) doesn't exist.
309#
310# A simple variant is to prefix commands with $(Q) - that's useful
311# for commands that shall be hidden in non-verbose mode.
312#
313# $(Q)ln $@ :<
314#
315# If KBUILD_VERBOSE equals 0 then the above command will be hidden.
316# If KBUILD_VERBOSE equals 1 then the above command is displayed.
317
318ifeq ($(KBUILD_VERBOSE),1)
319 quiet =
320 Q =
321else
322 quiet=quiet_
323 Q = @
324endif
325
326# If the user is running make -s (silent mode), suppress echoing of
327# commands
328
329ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4
330ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),)
331 quiet=silent_
332endif
333else # make-3.8x
334ifneq ($(filter s% -s%,$(MAKEFLAGS)),)
335 quiet=silent_
336endif
337endif
338
339export quiet Q KBUILD_VERBOSE
340
341ifneq ($(CC),) 344ifneq ($(CC),)
342ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1) 345ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
343COMPILER := clang 346COMPILER := clang
@@ -1173,7 +1176,7 @@ distclean: mrproper
1173# Packaging of the kernel to various formats 1176# Packaging of the kernel to various formats
1174# --------------------------------------------------------------------------- 1177# ---------------------------------------------------------------------------
1175# rpm target kept for backward compatibility 1178# rpm target kept for backward compatibility
1176package-dir := $(srctree)/scripts/package 1179package-dir := scripts/package
1177 1180
1178%src-pkg: FORCE 1181%src-pkg: FORCE
1179 $(Q)$(MAKE) $(build)=$(package-dir) $@ 1182 $(Q)$(MAKE) $(build)=$(package-dir) $@
diff --git a/firmware/Makefile b/firmware/Makefile
index 5747417069ca..0862d34cf7d1 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -219,6 +219,12 @@ $(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep)
219obj-y += $(patsubst %,%.gen.o, $(fw-external-y)) 219obj-y += $(patsubst %,%.gen.o, $(fw-external-y))
220obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o, $(fw-shipped-y)) 220obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o, $(fw-shipped-y))
221 221
222ifeq ($(KBUILD_SRC),)
223# Makefile.build only creates subdirectories for O= builds, but external
224# firmware might live outside the kernel source tree
225_dummy := $(foreach d,$(addprefix $(obj)/,$(dir $(fw-external-y))), $(shell [ -d $(d) ] || mkdir -p $(d)))
226endif
227
222# Remove .S files and binaries created from ihex 228# Remove .S files and binaries created from ihex
223# (during 'make clean' .config isn't included so they're all in $(fw-shipped-)) 229# (during 'make clean' .config isn't included so they're all in $(fw-shipped-))
224targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \ 230targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \