diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-14 03:22:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-14 03:22:26 -0400 |
commit | f33a3faa25c569d2a7640de66bea69e15c12ecd1 (patch) | |
tree | fd76278083896f1b9e9cac0870a15b5a4f5d6655 /Makefile | |
parent | 1b5a5f59e3435337bede67b9255bbb1d39fc4827 (diff) | |
parent | 30142230a730263e9989e0174b74c2429e041c8c (diff) |
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kbuild changes from Michal Marek:
- fix for handling dependencies of *-objs targets by Masahiro Yamada
- lots of cleanups in the kbuild machinery, also by Masahiro
- fixes for the kconfig build to use an UTF-8 capable ncurses library
if possible and to build on not-so-standard installs
- some more minor fixes
* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
kbuild: Do not reference *-n variables in the Makefile
kbuild: simplify build, clean, modbuiltin shorthands
kbuild: arm: Do not define "comma" twice
kbuild: remove obj-n and lib-n handling
kbuild: remove unnecessary variable initializaions
kbuild: remove unnecessary "obj- := dummy.o" trick
kbuild: handle C=... and M=... after entering into build directory
kbuild: use $(Q) for sub-make target
kbuild: fake the "Entering directory ..." message more simply
kconfig/lxdialog: get ncurses CFLAGS with pkg-config
kconfig: nconfig: fix multi-byte UTF handling
kconfig: lxdialog: fix spelling
kbuild: Make scripts executable
kbuild: remove redundant clean-files from scripts/kconfig/Makefile
kbuild: refactor script/kconfig/Makefile
kbuild: handle the dependency of multi-objs hostprogs appropriately
kbuild: handle multi-objs dependency appropriately
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 88 |
1 files changed, 40 insertions, 48 deletions
@@ -10,11 +10,9 @@ NAME = Shuffling Zombie Juror | |||
10 | # Comments in this file are targeted only to the developer, do not | 10 | # Comments in this file are targeted only to the developer, do not |
11 | # expect to learn how to build the kernel reading this file. | 11 | # expect to learn how to build the kernel reading this file. |
12 | 12 | ||
13 | # Do not: | 13 | # Do not use make's built-in rules and variables |
14 | # o use make's built-in rules and variables | 14 | # (this increases performance and avoids hard-to-debug behaviour); |
15 | # (this increases performance and avoids hard-to-debug behaviour); | 15 | MAKEFLAGS += -rR |
16 | # o print "Entering directory ..."; | ||
17 | MAKEFLAGS += -rR --no-print-directory | ||
18 | 16 | ||
19 | # Avoid funny character set dependencies | 17 | # Avoid funny character set dependencies |
20 | unexport LC_ALL | 18 | unexport LC_ALL |
@@ -97,34 +95,6 @@ endif | |||
97 | 95 | ||
98 | export quiet Q KBUILD_VERBOSE | 96 | export quiet Q KBUILD_VERBOSE |
99 | 97 | ||
100 | # Call a source code checker (by default, "sparse") as part of the | ||
101 | # C compilation. | ||
102 | # | ||
103 | # Use 'make C=1' to enable checking of only re-compiled files. | ||
104 | # Use 'make C=2' to enable checking of *all* source files, regardless | ||
105 | # of whether they are re-compiled or not. | ||
106 | # | ||
107 | # See the file "Documentation/sparse.txt" for more details, including | ||
108 | # where to get the "sparse" utility. | ||
109 | |||
110 | ifeq ("$(origin C)", "command line") | ||
111 | KBUILD_CHECKSRC = $(C) | ||
112 | endif | ||
113 | ifndef KBUILD_CHECKSRC | ||
114 | KBUILD_CHECKSRC = 0 | ||
115 | endif | ||
116 | |||
117 | # Use make M=dir to specify directory of external module to build | ||
118 | # Old syntax make ... SUBDIRS=$PWD is still supported | ||
119 | # Setting the environment variable KBUILD_EXTMOD take precedence | ||
120 | ifdef SUBDIRS | ||
121 | KBUILD_EXTMOD ?= $(SUBDIRS) | ||
122 | endif | ||
123 | |||
124 | ifeq ("$(origin M)", "command line") | ||
125 | KBUILD_EXTMOD := $(M) | ||
126 | endif | ||
127 | |||
128 | # kbuild supports saving output files in a separate directory. | 98 | # kbuild supports saving output files in a separate directory. |
129 | # To locate output files in a separate directory two syntaxes are supported. | 99 | # To locate output files in a separate directory two syntaxes are supported. |
130 | # In both cases the working directory must be the root of the kernel src. | 100 | # In both cases the working directory must be the root of the kernel src. |
@@ -140,7 +110,6 @@ endif | |||
140 | # The O= assignment takes precedence over the KBUILD_OUTPUT environment | 110 | # The O= assignment takes precedence over the KBUILD_OUTPUT environment |
141 | # variable. | 111 | # variable. |
142 | 112 | ||
143 | |||
144 | # KBUILD_SRC is set on invocation of make in OBJ directory | 113 | # KBUILD_SRC is set on invocation of make in OBJ directory |
145 | # KBUILD_SRC is not intended to be used by the regular user (for now) | 114 | # KBUILD_SRC is not intended to be used by the regular user (for now) |
146 | ifeq ($(KBUILD_SRC),) | 115 | ifeq ($(KBUILD_SRC),) |
@@ -172,17 +141,9 @@ PHONY += $(MAKECMDGOALS) sub-make | |||
172 | $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make | 141 | $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make |
173 | @: | 142 | @: |
174 | 143 | ||
175 | # Fake the "Entering directory" message once, so that IDEs/editors are | ||
176 | # able to understand relative filenames. | ||
177 | echodir := @echo | ||
178 | quiet_echodir := @echo | ||
179 | silent_echodir := @: | ||
180 | sub-make: FORCE | 144 | sub-make: FORCE |
181 | $($(quiet)echodir) "make[1]: Entering directory \`$(KBUILD_OUTPUT)'" | 145 | $(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \ |
182 | $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ | 146 | -f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS)) |
183 | KBUILD_SRC=$(CURDIR) \ | ||
184 | KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \ | ||
185 | $(filter-out _all sub-make,$(MAKECMDGOALS)) | ||
186 | 147 | ||
187 | # Leave processing to above invocation of make | 148 | # Leave processing to above invocation of make |
188 | skip-makefile := 1 | 149 | skip-makefile := 1 |
@@ -192,6 +153,39 @@ endif # ifeq ($(KBUILD_SRC),) | |||
192 | # We process the rest of the Makefile if this is the final invocation of make | 153 | # We process the rest of the Makefile if this is the final invocation of make |
193 | ifeq ($(skip-makefile),) | 154 | ifeq ($(skip-makefile),) |
194 | 155 | ||
156 | # Do not print "Entering directory ...", | ||
157 | # but we want to display it when entering to the output directory | ||
158 | # so that IDEs/editors are able to understand relative filenames. | ||
159 | MAKEFLAGS += --no-print-directory | ||
160 | |||
161 | # Call a source code checker (by default, "sparse") as part of the | ||
162 | # C compilation. | ||
163 | # | ||
164 | # Use 'make C=1' to enable checking of only re-compiled files. | ||
165 | # Use 'make C=2' to enable checking of *all* source files, regardless | ||
166 | # of whether they are re-compiled or not. | ||
167 | # | ||
168 | # See the file "Documentation/sparse.txt" for more details, including | ||
169 | # where to get the "sparse" utility. | ||
170 | |||
171 | ifeq ("$(origin C)", "command line") | ||
172 | KBUILD_CHECKSRC = $(C) | ||
173 | endif | ||
174 | ifndef KBUILD_CHECKSRC | ||
175 | KBUILD_CHECKSRC = 0 | ||
176 | endif | ||
177 | |||
178 | # Use make M=dir to specify directory of external module to build | ||
179 | # Old syntax make ... SUBDIRS=$PWD is still supported | ||
180 | # Setting the environment variable KBUILD_EXTMOD take precedence | ||
181 | ifdef SUBDIRS | ||
182 | KBUILD_EXTMOD ?= $(SUBDIRS) | ||
183 | endif | ||
184 | |||
185 | ifeq ("$(origin M)", "command line") | ||
186 | KBUILD_EXTMOD := $(M) | ||
187 | endif | ||
188 | |||
195 | # If building an external module we do not care about the all: rule | 189 | # If building an external module we do not care about the all: rule |
196 | # but instead _all depend on modules | 190 | # but instead _all depend on modules |
197 | PHONY += all | 191 | PHONY += all |
@@ -889,9 +883,7 @@ vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ | |||
889 | $(net-y) $(net-m) $(libs-y) $(libs-m))) | 883 | $(net-y) $(net-m) $(libs-y) $(libs-m))) |
890 | 884 | ||
891 | vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \ | 885 | vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \ |
892 | $(init-n) $(init-) \ | 886 | $(init-) $(core-) $(drivers-) $(net-) $(libs-)))) |
893 | $(core-n) $(core-) $(drivers-n) $(drivers-) \ | ||
894 | $(net-n) $(net-) $(libs-n) $(libs-)))) | ||
895 | 887 | ||
896 | init-y := $(patsubst %/, %/built-in.o, $(init-y)) | 888 | init-y := $(patsubst %/, %/built-in.o, $(init-y)) |
897 | core-y := $(patsubst %/, %/built-in.o, $(core-y)) | 889 | core-y := $(patsubst %/, %/built-in.o, $(core-y)) |
@@ -1591,7 +1583,7 @@ endif | |||
1591 | # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir | 1583 | # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir |
1592 | # Usage: | 1584 | # Usage: |
1593 | # $(Q)$(MAKE) $(clean)=dir | 1585 | # $(Q)$(MAKE) $(clean)=dir |
1594 | clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj | 1586 | clean := -f $(srctree)/scripts/Makefile.clean obj |
1595 | 1587 | ||
1596 | endif # skip-makefile | 1588 | endif # skip-makefile |
1597 | 1589 | ||