Sam Ravnborg
2005-Jul-28 14:39 UTC
[klibc] [PATCH] Use KLIBSRC + KLIBINC consistent in kbuild files
Factor out all kernel specific path's (those containing usr/) into two variables: KLIBSRC + KLIBINC. Set the variables in a kernel spcific Kbuild file. Sam commit e6f989c1597a837f4aecbd11083697184c089611 tree 93f88d7564bb9e4d4bc95fd455b842d0bd0fdc54 parent 8151f4a98f82fba4fe3b949f49da4ab8bba71501 author Sam Ravnborg <sam@mars.(none)> Thu, 28 Jul 2005 23:36:07 +0200 committer Sam Ravnborg <sam@mars.(none)> Thu, 28 Jul 2005 23:36:07 +0200 kernel/Kbuild | 4 ++++ klibc/socketcalls/Kbuild | 12 +++++------- klibc/syscalls/Kbuild | 28 +++++++++++++--------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/kernel/Kbuild b/kernel/Kbuild --- a/kernel/Kbuild +++ b/kernel/Kbuild @@ -2,6 +2,10 @@ # kbuild file for usr/ - including initramfs image and klibc # +klibc definitions - to be moved to top-level Makefile later +export KLIBSRC := $(srctree)/$(src)/klibc +export KLIBINC := $(srctree)/$(src)/include + obj-y := initramfs_data.o always := klibc/libc.a hostprogs-y := gen_init_cpio diff --git a/klibc/socketcalls/Kbuild b/klibc/socketcalls/Kbuild --- a/klibc/socketcalls/Kbuild +++ b/klibc/socketcalls/Kbuild @@ -11,8 +11,6 @@ endif # Composite object containing all .o file always := socketcalls.o -klibc-dir := $(srctree)/usr/klibc - ##### # Generate socket calls stubs # Based on input from SOCKETCALLS.def generate socket call stubs @@ -26,15 +24,15 @@ $(obj)/socketcalls.o: $(call objectify,$ $(call if_changed,userld) quiet_cmd_socketcalls = GEN $@ - cmd_socketcalls = $(PERL) $(klibc-dir)/socketcalls.pl \ - $(klibc-dir)/SOCKETCALLS.def \ + cmd_socketcalls = $(PERL) $(KLIBSRC)/socketcalls.pl \ + $(KLIBSRC)/SOCKETCALLS.def \ $(ARCH) $(obj) > $@ || rm -f $@ # Generate socketcall stubs -$(obj)/socketcalls.mk: $(klibc-dir)/socketcalls.pl \ - $(klibc-dir)/SOCKETCALLS.def \ +$(obj)/socketcalls.mk: $(KLIBSRC)/socketcalls.pl \ + $(KLIBSRC)/SOCKETCALLS.def \ $(call objectify, $(socketcall-objs:.o=.S)) \ - $(klibc-dir)/socketcommon.h + $(KLIBSRC)/socketcommon.h $(call cmd,socketcalls) diff --git a/klibc/syscalls/Kbuild b/klibc/syscalls/Kbuild --- a/klibc/syscalls/Kbuild +++ b/klibc/syscalls/Kbuild @@ -11,8 +11,6 @@ endif # Composite object containing all .o file always := syscalls.o -klibc-dir := $(srctree)/usr/klibc - ##### # Generate syscalls stubs @@ -24,7 +22,7 @@ targets += SYSCALLS.i syscalls.nrs targets += $(syscall-objs) # Side effect of running syscalls.pl -clean-files += $(objtree)/usr/include/klibc/havesyscall.h +clean-files += $(KLIBINC)/klibc/havesyscall.h # All the syscall stubs clean-files += *.o *.S *.c @@ -37,29 +35,29 @@ $(obj)/syscalls.o: $(call objectify,$(sy quiet_cmd_syscall.i = GEN $@ cmd_syscall.i = $(USERCC) $(usercflags) -D__ASSEMBLY__ \ -ansi -x assembler-with-cpp -E -o $@ $< -$(obj)/SYSCALLS.i: $(klibc-dir)/SYSCALLS.def FORCE +$(obj)/SYSCALLS.i: $(KLIBSRC)/SYSCALLS.def FORCE $(call if_changed_dep,syscall.i) # Get syscalls numbers quiet_cmd_syscall.nrs = GEN $@ cmd_syscall.nrs = $(USERCC) $(usercflags) -Wp,-dM -x c -E -o $@ $< -$(obj)/syscalls.nrs: $(srctree)/usr/include/sys/syscall.h FORCE +$(obj)/syscalls.nrs: $(KLIBINC)/sys/syscall.h FORCE $(call if_changed_dep,syscall.nrs) -# Generate usr/include/klibc/havesyscall.h + makefile fragment +# Generate $(KLIBINC)/klibc/havesyscall.h + makefile fragment # Using sysstub.pl in arch dir generate all .S files quiet_cmd_syscalls = GEN $@ - cmd_syscalls = mkdir -p $(objtree)/usr/include/klibc/; \ - $(PERL) $(klibc-dir)/syscalls.pl $(obj)/SYSCALLS.i \ - $(klibc-dir)/arch/$(ARCH)/sysstub.ph \ - $(ARCH) $(BITSIZE) $(obj)/syscalls.nrs \ - $(obj) \ - $(objtree)/usr/include/klibc/havesyscall.h > $@ \ + cmd_syscalls = mkdir -p $(KLIBINC)/klibc/; \ + $(PERL) $(KLIBSRC)/syscalls.pl $(obj)/SYSCALLS.i \ + $(KLIBSRC)/arch/$(ARCH)/sysstub.ph \ + $(ARCH) $(BITSIZE) $(obj)/syscalls.nrs \ + $(obj) \ + $(KLIBINC)/klibc/havesyscall.h > $@ \ || rm -f $@ -$(obj)/syscalls.mk: $(klibc-dir)/syscalls.pl $(obj)/SYSCALLS.i \ - $(klibc-dir)/arch/$(ARCH)/sysstub.ph \ +$(obj)/syscalls.mk: $(KLIBSRC)/syscalls.pl $(obj)/SYSCALLS.i \ + $(KLIBSRC)/arch/$(ARCH)/sysstub.ph \ $(call objectify, $(syscall-objs:.o=.S)) \ - $(klibc-dir)/syscommon.h $(obj)/syscalls.nrs + $(KLIBSRC)/syscommon.h $(obj)/syscalls.nrs $(call cmd,syscalls)