diff options
| -rw-r--r-- | scripts/Kbuild.include | 2 | ||||
| -rw-r--r-- | scripts/Makefile.lib | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index f8b45eb47ed3..15b196fc2f49 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
| @@ -202,7 +202,7 @@ hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj | |||
| 202 | # Prefix -I with $(srctree) if it is not an absolute path. | 202 | # Prefix -I with $(srctree) if it is not an absolute path. |
| 203 | # skip if -I has no parameter | 203 | # skip if -I has no parameter |
| 204 | addtree = $(if $(patsubst -I%,%,$(1)), \ | 204 | addtree = $(if $(patsubst -I%,%,$(1)), \ |
| 205 | $(if $(filter-out -I/% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1)) | 205 | $(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1))) |
| 206 | 206 | ||
| 207 | # Find all -I options and call addtree | 207 | # Find all -I options and call addtree |
| 208 | flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) | 208 | flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index e7df0f5db7ec..e89c214745eb 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
| @@ -155,9 +155,10 @@ else | |||
| 155 | # $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files | 155 | # $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files |
| 156 | # and locates generated .h files | 156 | # and locates generated .h files |
| 157 | # FIXME: Replace both with specific CFLAGS* statements in the makefiles | 157 | # FIXME: Replace both with specific CFLAGS* statements in the makefiles |
| 158 | __c_flags = $(call addtree,-I$(obj)) $(call flags,_c_flags) | 158 | __c_flags = $(if $(obj),-I$(srctree)/$(src) -I$(obj)) \ |
| 159 | __a_flags = $(call flags,_a_flags) | 159 | $(call flags,_c_flags) |
| 160 | __cpp_flags = $(call flags,_cpp_flags) | 160 | __a_flags = $(call flags,_a_flags) |
| 161 | __cpp_flags = $(call flags,_cpp_flags) | ||
| 161 | endif | 162 | endif |
| 162 | 163 | ||
| 163 | c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ | 164 | c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ |
