aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-01-15 21:56:40 -0500
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-01-27 19:11:17 -0500
commit58156ba4468f1d0de166a4330374bc9df9b74efc (patch)
treeb5e8269f2248f1ce8802d3c264aedee534bd9fd7 /scripts/Makefile.lib
parentf17b5f06cb92ef2250513a1e154c47b78df07d40 (diff)
kbuild: skip 'addtree' and 'flags' magic for external module build
When building an external module, $(obj) is the absolute path to it. The header search paths from ccflags-y etc. should not be tweaked. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib11
1 files changed, 6 insertions, 5 deletions
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))
138endif 138endif
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
143ifeq ($(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)
147else 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 '/').
146ifeq ($(KBUILD_EXTMOD),)
147ifneq ($(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)
157endif 157endif
158endif
158 159
159c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ 160c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
160 -include $(srctree)/include/linux/compiler_types.h \ 161 -include $(srctree)/include/linux/compiler_types.h \