Sam Ravnborg
2006-Apr-17 12:28 UTC
[klibc] [PATCH] klibc: generate havesyscall in $(objtree) with make O=..
Avoiding full path to KLIBCINC will result in havesyscall.h being generated in the $(objtree). We do not want generated files in the source tree with make O=.. -I parmeters to gcc now prefixed with $(srctree) allowing to pick up the generated .h file in $(objtree) Signed-off-by: Sam Ravnborg <sam@ravnborg.org> --- diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc index e7b3fcf..1030a97 100644 --- a/scripts/Kbuild.klibc +++ b/scripts/Kbuild.klibc @@ -157,9 +157,19 @@ lib-y := $(addprefix $(obj)/,$ always := $(addprefix $(obj)/,$(always)) targets := $(addprefix $(obj)/,$(targets)) +##### +# Handle options to gcc. Support building with separate output directory + +__klibccflags = $(KLIBCCFLAGS) $(EXTRA_KLIBCCFLAGS) $(KLIBCCFLAGS_$(*F).o) +__klibcaflags = $(KLIBCAFLAGS) $(EXTRA_KLIBCAFLAGS) $(KLIBCAFLAGS_$(*F).o) -_klibccflags = $(KLIBCCFLAGS) $(EXTRA_KLIBCCFLAGS) $(KLIBCCFLAGS_$(*F).o) -_klibcaflags = $(KLIBCAFLAGS) $(EXTRA_KLIBCAFLAGS) $(KLIBCAFLAGS_$(*F).o) +ifeq ($(KBUILD_SRC),) +_klibccflags = $(__klibccflags) +_klibcaflags = $(__klibcaflags) +else +_klibccflags = $(call flags,__klibccflags) +_klibcaflags = $(call flags,__klibcaflags) +endif klibccflags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(_klibccflags) klibcaflags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(_klibcaflags) diff --git a/usr/Kbuild b/usr/Kbuild index bc50c48..6ac1959 100644 --- a/usr/Kbuild +++ b/usr/Kbuild @@ -4,7 +4,7 @@ # # klibc definitions - to be moved to top-level Makefile later export KLIBCSRC := $(srctree)/$(src)/klibc -export KLIBCINC := $(srctree)/$(src)/include +export KLIBCINC := $(src)/include export KLIBCOBJ := $(objtree)/$(obj)/klibc CONFIG_KLIBC := 1
Maybe Matching Threads
- [klibc 19/43] klibc basic build infrastructure
- [PATCH 00/16] External building, update for 2.6.33 and multiple root devices.
- [PATCH] klibc: default initramfs content stored in usr/initramfs.default
- [PATCH] Kbuild for klibc and nfsmount: add -fcommon
- [klibc:master] Kbuild: Tell gas we don't want executable stacks