aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2008-11-21 15:50:02 -0500
committerSam Ravnborg <sam@ravnborg.org>2008-12-03 15:31:59 -0500
commitd8672b40d3a6f17de5b5bc71d6e531d7576a856a (patch)
treed0792fab67fbdc54f7d3eef7339f456625ed7f52 /scripts
parent5b91c33cf295d9c235f587f29a8c0a7ae15a5320 (diff)
kbuild: expand -I in KBUILD_CPPFLAGS
kbuild failed to expand include flags in KBUILD_CPPFLAGS resulting in code like this in arch Makefiles: ifeq ($(KBUILD_SRC),) KBUILD_CPPFLAGS += -Iinclude/foo else KBUILD_CPPFLAGS += -I$(srctree)/include/foo endif Move use of LINUXINCLUDE into Makefile.lib to allow us to expand -I directives of KBUILD_CPPFLAGS so we can avoid the above code. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.lib15
1 files changed, 9 insertions, 6 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index b4ca38a21158..e06365775bdf 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -104,9 +104,11 @@ else
104debug_flags = 104debug_flags =
105endif 105endif
106 106
107orig_c_flags = $(KBUILD_CFLAGS) $(ccflags-y) $(CFLAGS_$(basetarget).o) 107orig_c_flags = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
108 $(ccflags-y) $(CFLAGS_$(basetarget).o)
108_c_flags = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags)) 109_c_flags = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags))
109_a_flags = $(KBUILD_AFLAGS) $(asflags-y) $(AFLAGS_$(basetarget).o) 110_a_flags = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) \
111 $(asflags-y) $(AFLAGS_$(basetarget).o)
110_cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F)) 112_cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F))
111 113
112# If building the kernel in a separate objtree expand all occurrences 114# If building the kernel in a separate objtree expand all occurrences
@@ -127,15 +129,16 @@ __a_flags = $(call flags,_a_flags)
127__cpp_flags = $(call flags,_cpp_flags) 129__cpp_flags = $(call flags,_cpp_flags)
128endif 130endif
129 131
130c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ 132c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
131 $(__c_flags) $(modkern_cflags) \ 133 $(__c_flags) $(modkern_cflags) \
132 -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) \ 134 -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) \
133 $(debug_flags) 135 $(debug_flags)
134 136
135a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ 137a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
136 $(__a_flags) $(modkern_aflags) 138 $(__a_flags) $(modkern_aflags)
137 139
138cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags) 140cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
141 $(__cpp_flags)
139 142
140ld_flags = $(LDFLAGS) $(ldflags-y) 143ld_flags = $(LDFLAGS) $(ldflags-y)
141 144