Commit 0ff35771fc7a96a2244f38573b6d56199ec75056
Committed by
Michal Marek
1 parent
e78e8f2d83
Exists in
master
and in
20 other branches
kbuild: silence generated makefile message
This patch silences the "make -C /usr/src/git O=/usr/src/git/build/." message shown when using the generated makefile in KBUILD_OUTDIR. Signed-off-by: Peter Foley <pefoley2@verizon.net> Signed-off-by: Michal Marek <mmarek@suse.cz>
Showing 1 changed file with 8 additions and 1 deletions Inline Diff
scripts/mkmakefile
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # Generates a small Makefile used in the root of the output | 2 | # Generates a small Makefile used in the root of the output |
3 | # directory, to allow make to be started from there. | 3 | # directory, to allow make to be started from there. |
4 | # The Makefile also allow for more convinient build of external modules | 4 | # The Makefile also allow for more convinient build of external modules |
5 | 5 | ||
6 | # Usage | 6 | # Usage |
7 | # $1 - Kernel src directory | 7 | # $1 - Kernel src directory |
8 | # $2 - Output directory | 8 | # $2 - Output directory |
9 | # $3 - version | 9 | # $3 - version |
10 | # $4 - patchlevel | 10 | # $4 - patchlevel |
11 | 11 | ||
12 | 12 | ||
13 | test ! -r $2/Makefile -o -O $2/Makefile || exit 0 | 13 | test ! -r $2/Makefile -o -O $2/Makefile || exit 0 |
14 | # Only overwrite automatically generated Makefiles | 14 | # Only overwrite automatically generated Makefiles |
15 | # (so we do not overwrite kernel Makefile) | 15 | # (so we do not overwrite kernel Makefile) |
16 | if test -e $2/Makefile && ! grep -q Automatically $2/Makefile | 16 | if test -e $2/Makefile && ! grep -q Automatically $2/Makefile |
17 | then | 17 | then |
18 | exit 0 | 18 | exit 0 |
19 | fi | 19 | fi |
20 | if [ "${quiet}" != "silent_" ]; then | 20 | if [ "${quiet}" != "silent_" ]; then |
21 | echo " GEN $2/Makefile" | 21 | echo " GEN $2/Makefile" |
22 | fi | 22 | fi |
23 | 23 | ||
24 | cat << EOF > $2/Makefile | 24 | cat << EOF > $2/Makefile |
25 | # Automatically generated by $0: don't edit | 25 | # Automatically generated by $0: don't edit |
26 | 26 | ||
27 | VERSION = $3 | 27 | VERSION = $3 |
28 | PATCHLEVEL = $4 | 28 | PATCHLEVEL = $4 |
29 | 29 | ||
30 | lastword = \$(word \$(words \$(1)),\$(1)) | 30 | lastword = \$(word \$(words \$(1)),\$(1)) |
31 | makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST))) | 31 | makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST))) |
32 | 32 | ||
33 | ifeq ("\$(origin V)", "command line") | ||
34 | VERBOSE := \$(V) | ||
35 | endif | ||
36 | ifneq (\$(VERBOSE),1) | ||
37 | Q := @ | ||
38 | endif | ||
39 | |||
33 | MAKEARGS := -C $1 | 40 | MAKEARGS := -C $1 |
34 | MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$(makedir)) | 41 | MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$(makedir)) |
35 | 42 | ||
36 | MAKEFLAGS += --no-print-directory | 43 | MAKEFLAGS += --no-print-directory |
37 | 44 | ||
38 | .PHONY: all \$(MAKECMDGOALS) | 45 | .PHONY: all \$(MAKECMDGOALS) |
39 | 46 | ||
40 | all := \$(filter-out all Makefile,\$(MAKECMDGOALS)) | 47 | all := \$(filter-out all Makefile,\$(MAKECMDGOALS)) |
41 | 48 | ||
42 | all: | 49 | all: |
43 | \$(MAKE) \$(MAKEARGS) \$(all) | 50 | \$(Q)\$(MAKE) \$(MAKEARGS) \$(all) |
44 | 51 | ||
45 | Makefile:; | 52 | Makefile:; |
46 | 53 | ||
47 | \$(all): all | 54 | \$(all): all |
48 | @: | 55 | @: |
49 | 56 | ||
50 | %/: all | 57 | %/: all |
51 | @: | 58 | @: |
52 | EOF | 59 | EOF |
53 | 60 |