aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Kbuild.include
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Kbuild.include')
-rw-r--r--scripts/Kbuild.include4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 982dcae7bbe2..936940b541f9 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -144,7 +144,9 @@ ld-option = $(call try-run,\
144build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj 144build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
145 145
146# Prefix -I with $(srctree) if it is not an absolute path. 146# Prefix -I with $(srctree) if it is not an absolute path.
147addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1) 147# skip if -I has no parameter
148addtree = $(if $(patsubst -I%,%,$(1)), \
149$(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1))
148 150
149# Find all -I options and call addtree 151# Find all -I options and call addtree
150flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) 152flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))