diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-07-10 21:40:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-07-10 21:40:47 -0400 |
commit | fe5aa8a65bab2548aa7282d331edc690dd7da1af (patch) | |
tree | 73ad6e96b95cefd3af26fbcc93638a00fbd0e343 | |
parent | b67db9d5e1294ddcd7f9bea43736a897132f4df7 (diff) | |
parent | dd5a6752ae7df4e0ba6ce3bcd0c3b4489bb3537f (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-- | Makefile | 99 | ||||
-rw-r--r-- | firmware/Makefile | 6 |
2 files changed, 57 insertions, 48 deletions
@@ -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 |
52 | endif | 75 | endif |
53 | 76 | ||
77 | ifeq ($(KBUILD_VERBOSE),1) | ||
78 | quiet = | ||
79 | Q = | ||
80 | else | ||
81 | quiet=quiet_ | ||
82 | Q = @ | ||
83 | endif | ||
84 | |||
85 | # If the user is running make -s (silent mode), suppress echoing of | ||
86 | # commands | ||
87 | |||
88 | ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4 | ||
89 | ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),) | ||
90 | quiet=silent_ | ||
91 | endif | ||
92 | else # make-3.8x | ||
93 | ifneq ($(filter s% -s%,$(MAKEFLAGS)),) | ||
94 | quiet=silent_ | ||
95 | endif | ||
96 | endif | ||
97 | |||
98 | export 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 | ||
179 | silent_echodir := @: | ||
131 | sub-make: FORCE | 180 | sub-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 | |||
292 | export KBUILD_MODULES KBUILD_BUILTIN | 341 | export KBUILD_MODULES KBUILD_BUILTIN |
293 | export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD | 342 | export 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 | |||
318 | ifeq ($(KBUILD_VERBOSE),1) | ||
319 | quiet = | ||
320 | Q = | ||
321 | else | ||
322 | quiet=quiet_ | ||
323 | Q = @ | ||
324 | endif | ||
325 | |||
326 | # If the user is running make -s (silent mode), suppress echoing of | ||
327 | # commands | ||
328 | |||
329 | ifneq ($(filter 4.%,$(MAKE_VERSION)),) # make-4 | ||
330 | ifneq ($(filter %s ,$(firstword x$(MAKEFLAGS))),) | ||
331 | quiet=silent_ | ||
332 | endif | ||
333 | else # make-3.8x | ||
334 | ifneq ($(filter s% -s%,$(MAKEFLAGS)),) | ||
335 | quiet=silent_ | ||
336 | endif | ||
337 | endif | ||
338 | |||
339 | export quiet Q KBUILD_VERBOSE | ||
340 | |||
341 | ifneq ($(CC),) | 344 | ifneq ($(CC),) |
342 | ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1) | 345 | ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1) |
343 | COMPILER := clang | 346 | COMPILER := 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 |
1176 | package-dir := $(srctree)/scripts/package | 1179 | package-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) | |||
219 | obj-y += $(patsubst %,%.gen.o, $(fw-external-y)) | 219 | obj-y += $(patsubst %,%.gen.o, $(fw-external-y)) |
220 | obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o, $(fw-shipped-y)) | 220 | obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o, $(fw-shipped-y)) |
221 | 221 | ||
222 | ifeq ($(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))) | ||
226 | endif | ||
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-)) |
224 | targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \ | 230 | targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \ |