diff options
author | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-04-07 02:36:49 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-04-07 02:36:49 -0400 |
commit | d9df92e22aca939857c5bc9ecb130ef22307ccc1 (patch) | |
tree | de428ec711fe241f3ad7ac1272ba8591d68d9fc2 /scripts | |
parent | 7d2d8fe0cb88914d26219db51341d780a032b198 (diff) |
kbuild: properly pass options to hostcc when doing make O=..
This fix a longstanding bug where proper options was not
passed to hostcc in case of a make O=.. build.
This bug showed up in (not yet merged) klibc, and is not known
to have any counterpart in-kernel.
Fixed by moving the flags macro to Kbuild.include so it can be used
by both Makefile.lib and Makefile.host.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Kbuild.include | 5 | ||||
-rw-r--r-- | scripts/Makefile.lib | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 59620b1554e0..b0d067be7390 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -87,6 +87,11 @@ cc-ifversion = $(shell if [ $(call cc-version, $(CC)) $(1) $(2) ]; then \ | |||
87 | # $(Q)$(MAKE) $(build)=dir | 87 | # $(Q)$(MAKE) $(build)=dir |
88 | build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj | 88 | build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj |
89 | 89 | ||
90 | # Prefix -I with $(srctree) if it is not an absolute path | ||
91 | addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1) | ||
92 | # Find all -I options and call addtree | ||
93 | flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) | ||
94 | |||
90 | # If quiet is set, only print short version of command | 95 | # If quiet is set, only print short version of command |
91 | cmd = @$(echo-cmd) $(cmd_$(1)) | 96 | cmd = @$(echo-cmd) $(cmd_$(1)) |
92 | 97 | ||
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 550798f57da5..2cb4935e85d1 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -99,11 +99,6 @@ __a_flags = $(_a_flags) | |||
99 | __cpp_flags = $(_cpp_flags) | 99 | __cpp_flags = $(_cpp_flags) |
100 | else | 100 | else |
101 | 101 | ||
102 | # Prefix -I with $(srctree) if it is not an absolute path | ||
103 | addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1) | ||
104 | # Find all -I options and call addtree | ||
105 | flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) | ||
106 | |||
107 | # -I$(obj) locates generated .h files | 102 | # -I$(obj) locates generated .h files |
108 | # $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files | 103 | # $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files |
109 | # and locates generated .h files | 104 | # and locates generated .h files |