|
@@ -144,7 +144,9 @@ ld-option = $(call try-run,\
|
|
build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
|
|
build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
|
|
|
|
|
|
# Prefix -I with $(srctree) if it is not an absolute path.
|
|
# Prefix -I with $(srctree) if it is not an absolute path.
|
|
-addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1)
|
|
|
|
|
|
+# skip if -I has no parameter
|
|
|
|
+addtree = $(if $(patsubst -I%,%,$(1)), \
|
|
|
|
+$(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1))
|
|
|
|
|
|
# Find all -I options and call addtree
|
|
# Find all -I options and call addtree
|
|
flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))
|
|
flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))
|