aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-07-04 22:48:21 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-07-06 09:04:02 -0400
commit48f6e3cf5bc6dd0ee00405342ff310c3b1fedb35 (patch)
tree9d24b4bd38ed97ec2d7a062b60f2dd87bf113fda
parent00e0793f834cd233240b19532581e3205caaccd9 (diff)
kbuild: do not drop -I without parameter
The comment line for addtree says "skip if -I has no parameter". What it actually does is "drop if -I has no parameter". For example, if you have the compiler flag '-I foo' (a space between), it will be converted to 'foo'. This completely changes the meaning. What we want is, "do nothing" for -I without parameter so that '-I foo' is kept as-is. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r--scripts/Kbuild.include2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index c8156d61678c..86321f06461e 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -214,7 +214,7 @@ hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj
214# Prefix -I with $(srctree) if it is not an absolute path. 214# Prefix -I with $(srctree) if it is not an absolute path.
215# skip if -I has no parameter 215# skip if -I has no parameter
216addtree = $(if $(patsubst -I%,%,$(1)), \ 216addtree = $(if $(patsubst -I%,%,$(1)), \
217$(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1))) 217$(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1)),$(1))
218 218
219# Find all -I options and call addtree 219# Find all -I options and call addtree
220flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) 220flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))