summaryrefslogtreecommitdiff
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib26
1 files changed, 8 insertions, 18 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 41e98fa66b91..1b412d4394ae 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -137,36 +137,26 @@ _c_flags += $(if $(patsubst n%,, \
$(CFLAGS_KCOV))
endif
-__c_flags = $(_c_flags)
-__a_flags = $(_a_flags)
-__cpp_flags = $(_cpp_flags)
-
-# If building the kernel in a separate objtree expand all occurrences
-# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').
+# $(srctree)/$(src) for including checkin headers from generated source files
+# $(objtree)/$(obj) for including generated headers from checkin source files
ifeq ($(KBUILD_EXTMOD),)
ifneq ($(srctree),.)
-
-# -I$(obj) locates generated .h files
-# $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files
-# and locates generated .h files
-# FIXME: Replace both with specific CFLAGS* statements in the makefiles
-__c_flags = $(if $(obj),$(call addtree,-I$(src)) -I$(obj)) \
- $(call flags,_c_flags)
-__a_flags = $(call flags,_a_flags)
-__cpp_flags = $(call flags,_cpp_flags)
+_c_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj)
+_a_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj)
+_cpp_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj)
endif
endif
c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
-include $(srctree)/include/linux/compiler_types.h \
- $(__c_flags) $(modkern_cflags) \
+ $(_c_flags) $(modkern_cflags) \
$(basename_flags) $(modname_flags)
a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
- $(__a_flags) $(modkern_aflags)
+ $(_a_flags) $(modkern_aflags)
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
- $(__cpp_flags)
+ $(_cpp_flags)
ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))