diff options
Diffstat (limited to 'scripts/Kbuild.include')
-rw-r--r-- | scripts/Kbuild.include | 4 |
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,\ | |||
144 | build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj | 144 | build := -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. |
147 | addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1) | 147 | # skip if -I has no parameter |
148 | addtree = $(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 |
150 | flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) | 152 | flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) |