[klibc] kbuild: fix make O= in kernel

Sam Ravnborg sam at ravnborg.org
Thu Aug 4 13:31:53 PDT 2005


A few places needed to be fixed in order to support make O=
Actually suprisingly few places needed to change, and we really
want this feature to work before pushing to -mm

Signed-off-by: Sam Ravnborg <sam at ravnborg.org>

---
commit 3346986f08271f35630e5c5b4b3af47eb8b874ab
tree d08cc5f1282cd265eeeed80d33dfd0dd2953c19c
parent 19eaf1b12e932acfc29ae3747c4935bc0800f2aa
author Sam Ravnborg <sam at mars.(none)> Thu, 04 Aug 2005 22:30:19 +0200
committer Sam Ravnborg <sam at mars.(none)> Thu, 04 Aug 2005 22:30:19 +0200

 ash/Kbuild           |    5 +++++
 kinit/Kbuild         |    4 ++--
 scripts/Kbuild.klibc |    2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ash/Kbuild b/ash/Kbuild
--- a/ash/Kbuild
+++ b/ash/Kbuild
@@ -29,6 +29,11 @@ cflags-$(CONFIG_KLIBC_SH_MAIL) += -DKLIB
 cflags-y += -DJOBS=$(if $(CONFIG_KLIBC_SH_JOBS),1,0)
     sh-$(CONFIG_KLIBC_SH_JOBS) += kill.o
 
+# locate .h files from generated .c files (make O=)
+cflags-y += -I$(srctree)/$(src)
+# locate generated .h files from normal .c files
+cflags-y += -I$(objtree)/$(obj)
+
 EXTRA_KLIBCCFLAGS := $(cflags-y)
 
 # The shared binary
diff --git a/kinit/Kbuild b/kinit/Kbuild
--- a/kinit/Kbuild
+++ b/kinit/Kbuild
@@ -11,9 +11,9 @@ kinit-y  += nfsmount/
 
 
 # kinit.c include ipconfig header file
-KLIBCCFLAGS_kinit.o   := -I$(src)/ipconfig
+KLIBCCFLAGS_kinit.o   := -I$(srctree)/$(src)/ipconfig
 # So do nfsroot
-KLIBCCFLAGS_nfsroot.o := -I$(src)/ipconfig -I$(src)/nfsmount
+KLIBCCFLAGS_nfsroot.o := -I$(srctree)/$(src)/ipconfig -I$(srctree)/$(src)/nfsmount
 
 
 # TODO - stripped image
diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc
--- a/scripts/Kbuild.klibc
+++ b/scripts/Kbuild.klibc
@@ -79,7 +79,7 @@ KLIBCCPPFLAGS    := -I$(KLIBCINC)/arch/$
                     -I$(KLIBCINC)
 # kernel include paths
 KLIBCCPPFLAGS    += -I$(KLIBCKERNELSRC)include                              \
-                     $(if $(KBUILD_SRC),-I$include2 -I$(srctree)/include)
+                     $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
 # klibc definitions
 KLIBCCPPFLAGS    += -D__KLIBC__=1 -D__KLIBC_MINOR__=0                       \
 		    -DBITSIZE=$(KLIBCBITSIZE)



More information about the klibc mailing list