diff options
-rw-r--r-- | scripts/Makefile.host | 6 | ||||
-rw-r--r-- | scripts/Makefile.lib | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/scripts/Makefile.host b/scripts/Makefile.host index 0393f75db4d4..a115259b57e7 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host | |||
@@ -67,13 +67,15 @@ _hostc_flags = $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ | |||
67 | _hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ | 67 | _hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ |
68 | $(HOSTCXXFLAGS_$(basetarget).o) | 68 | $(HOSTCXXFLAGS_$(basetarget).o) |
69 | 69 | ||
70 | ifeq ($(KBUILD_SRC),) | ||
71 | __hostc_flags = $(_hostc_flags) | 70 | __hostc_flags = $(_hostc_flags) |
72 | __hostcxx_flags = $(_hostcxx_flags) | 71 | __hostcxx_flags = $(_hostcxx_flags) |
73 | else | 72 | |
73 | ifeq ($(KBUILD_EXTMOD),) | ||
74 | ifneq ($(KBUILD_SRC),) | ||
74 | __hostc_flags = -I$(obj) $(call flags,_hostc_flags) | 75 | __hostc_flags = -I$(obj) $(call flags,_hostc_flags) |
75 | __hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags) | 76 | __hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags) |
76 | endif | 77 | endif |
78 | endif | ||
77 | 79 | ||
78 | hostc_flags = -Wp,-MD,$(depfile) $(__hostc_flags) | 80 | hostc_flags = -Wp,-MD,$(depfile) $(__hostc_flags) |
79 | hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags) | 81 | hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags) |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 12b88d09c3a4..ecad15b4cda3 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -137,14 +137,14 @@ _c_flags += $(if $(patsubst n%,, \ | |||
137 | $(CFLAGS_KCOV)) | 137 | $(CFLAGS_KCOV)) |
138 | endif | 138 | endif |
139 | 139 | ||
140 | # If building the kernel in a separate objtree expand all occurrences | ||
141 | # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). | ||
142 | |||
143 | ifeq ($(KBUILD_SRC),) | ||
144 | __c_flags = $(_c_flags) | 140 | __c_flags = $(_c_flags) |
145 | __a_flags = $(_a_flags) | 141 | __a_flags = $(_a_flags) |
146 | __cpp_flags = $(_cpp_flags) | 142 | __cpp_flags = $(_cpp_flags) |
147 | else | 143 | |
144 | # If building the kernel in a separate objtree expand all occurrences | ||
145 | # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). | ||
146 | ifeq ($(KBUILD_EXTMOD),) | ||
147 | ifneq ($(KBUILD_SRC),) | ||
148 | 148 | ||
149 | # -I$(obj) locates generated .h files | 149 | # -I$(obj) locates generated .h files |
150 | # $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files | 150 | # $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files |
@@ -155,6 +155,7 @@ __c_flags = $(if $(obj),$(call addtree,-I$(src)) -I$(obj)) \ | |||
155 | __a_flags = $(call flags,_a_flags) | 155 | __a_flags = $(call flags,_a_flags) |
156 | __cpp_flags = $(call flags,_cpp_flags) | 156 | __cpp_flags = $(call flags,_cpp_flags) |
157 | endif | 157 | endif |
158 | endif | ||
158 | 159 | ||
159 | c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ | 160 | c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ |
160 | -include $(srctree)/include/linux/compiler_types.h \ | 161 | -include $(srctree)/include/linux/compiler_types.h \ |