From: Jerone Y. <jy...@us...> - 2008-04-24 04:41:20
|
1 file changed, 37 insertions(+), 21 deletions(-) kernel/Makefile | 58 +++++++++++++++++++++++++++++++++++-------------------- - This adapts perviously sent patch to new changes to kernel/Makefile - Fixes improper check in conditional This patch add the ability for make sync in the kernel directory to work for mulitiple architectures and not just x86. Signed-off-by: Jerone Young <jy...@us...> diff --git a/kernel/Makefile b/kernel/Makefile --- a/kernel/Makefile +++ b/kernel/Makefile @@ -1,5 +1,10 @@ include ../config.mak include ../config.mak +ARCH_DIR=$(ARCH) +ifneq '$(filter $(ARCH_DIR), x86_64 i386)' '' + ARCH_DIR=x86 +endif + KVERREL = $(patsubst /lib/modules/%/build,%,$(KERNELDIR)) DESTDIR= @@ -18,11 +23,25 @@ _hack = mv $1 $1.orig && \ | sed '/\#include/! s/\blapic\b/l_apic/g' > $1 && rm $1.orig _unifdef = mv $1 $1.orig && \ - unifdef -DCONFIG_X86 $1.orig > $1; \ - [ $$? -le 1 ] && rm $1.orig + unifdef -DCONFIG_$(shell echo $(ARCH_DIR)|tr '[:lower:]' '[:upper:]') $1.orig > $1; \ + [ $$? -le 1 ] && rm $1.orig hack = $(call _hack,$T/$(strip $1)) unifdef = $(call _unifdef,$T/$(strip $1)) + +UNIFDEF_FILES = include/linux/kvm.h \ + include/linux/kvm_para.h \ + include/asm-$(ARCH_DIR)/kvm.h \ + include/asm-$(ARCH_DIR)/kvm_para.h + +ifneq '$(filter $(ARCH_DIR), x86)' '' +HACK_FILES = kvm_main.c \ + mmu.c \ + vmx.c \ + svm.c \ + x86.c \ + irq.h +endif all:: # include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat @@ -39,17 +58,16 @@ header-sync: rm -rf $T rsync -R \ "$(LINUX)"/./include/linux/kvm*.h \ - "$(LINUX)"/./include/asm-x86/kvm*.h \ - $T/ - mkdir -p include/linux include/asm-x86 - ln -sf asm-x86 include/asm - ln -sf asm-x86 include-compat/asm + "$(LINUX)"/./include/asm-$(ARCH_DIR)/kvm*.h \ + $T/ - $(call unifdef, include/linux/kvm.h) - $(call unifdef, include/linux/kvm_para.h) - $(call unifdef, include/asm-x86/kvm.h) - $(call unifdef, include/asm-x86/kvm_para.h) - $(call hack, include/linux/kvm.h) + mkdir -p include/linux include/asm-$(ARCH_DIR) + ln -sf asm-$(ARCH_DIR) include/asm + ln -sf asm-$(ARCH_DIR) include-compat/asm + + for i in $(UNIFDEF_FILES); \ + do $(call unifdef, $$i); done + for i in $$(find $T -type f -printf '%P '); \ do cmp -s $$i $T/$$i || cp $T/$$i $$i; done rm -rf $T @@ -57,15 +75,13 @@ source-sync: source-sync: rm -rf $T rsync --exclude='*.mod.c' -R \ - "$(LINUX)"/arch/x86/kvm/./*.[ch] \ - "$(LINUX)"/virt/kvm/./*.[ch] \ - $T/ - $(call hack, kvm_main.c) - $(call hack, mmu.c) - $(call hack, vmx.c) - $(call hack, svm.c) - $(call hack, x86.c) - $(call hack, irq.h) + "$(LINUX)"/arch/$(ARCH_DIR)/kvm/./*.[ch] \ + "$(LINUX)"/virt/kvm/./*.[ch] \ + $T/ + + for i in $(HACK_FILES); \ + do $(call hack, $$i); done + for i in $$(find $T -type f -printf '%P '); \ do cmp -s $$i $T/$$i || cp $T/$$i $$i; done rm -rf $T |
From: Jerone Y. <jy...@us...> - 2008-04-15 02:47:08
|
1 file changed, 13 insertions(+), 5 deletions(-) kernel/Makefile | 18 +++++++++++++----- This patch add the ability for make sync in the kernel directory to work for mulitiple architectures and not just x86. Signed-off-by: Jerone Young <jy...@us...> diff --git a/kernel/Makefile b/kernel/Makefile --- a/kernel/Makefile +++ b/kernel/Makefile @@ -1,5 +1,10 @@ include ../config.mak include ../config.mak +ASM_DIR=$(ARCH) +ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' '' + ASM_DIR=x86 +endif + KVERREL = $(patsubst /lib/modules/%/build,%,$(KERNELDIR)) DESTDIR= @@ -34,15 +39,16 @@ sync: sync: rm -rf tmp include rsync --exclude='*.mod.c' -R \ - "$(LINUX)"/arch/x86/kvm/./*.[ch] \ + "$(LINUX)"/arch/$(ASM_DIR)/kvm/./*.[ch] \ "$(LINUX)"/virt/kvm/./*.[ch] \ "$(LINUX)"/./include/linux/kvm*.h \ - "$(LINUX)"/./include/asm-x86/kvm*.h \ + "$(LINUX)"/./include/asm-$(ASM_DIR)/kvm*.h \ tmp/ - mkdir -p include/linux include/asm-x86 - ln -s asm-x86 include/asm - ln -sf asm-x86 include-compat/asm + mkdir -p include/linux include/asm-$(ASM_DIR) + ln -s asm-$(ASM_DIR) include/asm + ln -sf asm-$(ASM_DIR) include-compat/asm +ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' '' $(call unifdef, include/linux/kvm.h) $(call unifdef, include/linux/kvm_para.h) $(call unifdef, include/asm-x86/kvm.h) @@ -54,6 +60,8 @@ sync: $(call hack, svm.c) $(call hack, x86.c) $(call hack, irq.h) +endif + for i in $$(find tmp -type f -printf '%P '); \ do cmp -s $$i tmp/$$i || cp tmp/$$i $$i; done rm -rf tmp |
From: Anthony L. <an...@co...> - 2008-04-15 03:36:42
|
Jerone Young wrote: > 1 file changed, 13 insertions(+), 5 deletions(-) > kernel/Makefile | 18 +++++++++++++----- > > > This patch add the ability for make sync in the kernel directory to work for mulitiple architectures and not just x86. > > Signed-off-by: Jerone Young <jy...@us...> > > diff --git a/kernel/Makefile b/kernel/Makefile > --- a/kernel/Makefile > +++ b/kernel/Makefile > @@ -1,5 +1,10 @@ include ../config.mak > include ../config.mak > > +ASM_DIR=$(ARCH) > +ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' '' > + ASM_DIR=x86 > +endif > That doesn't look correct for ia64... Regards, Anthony Liguori > KVERREL = $(patsubst /lib/modules/%/build,%,$(KERNELDIR)) > > DESTDIR= > @@ -34,15 +39,16 @@ sync: > sync: > rm -rf tmp include > rsync --exclude='*.mod.c' -R \ > - "$(LINUX)"/arch/x86/kvm/./*.[ch] \ > + "$(LINUX)"/arch/$(ASM_DIR)/kvm/./*.[ch] \ > "$(LINUX)"/virt/kvm/./*.[ch] \ > "$(LINUX)"/./include/linux/kvm*.h \ > - "$(LINUX)"/./include/asm-x86/kvm*.h \ > + "$(LINUX)"/./include/asm-$(ASM_DIR)/kvm*.h \ > tmp/ > - mkdir -p include/linux include/asm-x86 > - ln -s asm-x86 include/asm > - ln -sf asm-x86 include-compat/asm > + mkdir -p include/linux include/asm-$(ASM_DIR) > + ln -s asm-$(ASM_DIR) include/asm > + ln -sf asm-$(ASM_DIR) include-compat/asm > > +ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' '' > $(call unifdef, include/linux/kvm.h) > $(call unifdef, include/linux/kvm_para.h) > $(call unifdef, include/asm-x86/kvm.h) > @@ -54,6 +60,8 @@ sync: > $(call hack, svm.c) > $(call hack, x86.c) > $(call hack, irq.h) > +endif > + > for i in $$(find tmp -type f -printf '%P '); \ > do cmp -s $$i tmp/$$i || cp tmp/$$i $$i; done > rm -rf tmp > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > kvm-devel mailing list > kvm...@li... > https://lists.sourceforge.net/lists/listinfo/kvm-devel > |
From: Hollis B. <ho...@us...> - 2008-04-15 14:10:45
|
On Monday 14 April 2008 21:46:43 Jerone Young wrote: > 1 file changed, 13 insertions(+), 5 deletions(-) > kernel/Makefile | 18 +++++++++++++----- > > > This patch add the ability for make sync in the kernel directory to work > for mulitiple architectures and not just x86. > > Signed-off-by: Jerone Young <jy...@us...> > > diff --git a/kernel/Makefile b/kernel/Makefile > --- a/kernel/Makefile > +++ b/kernel/Makefile > @@ -1,5 +1,10 @@ include ../config.mak > include ../config.mak > > +ASM_DIR=$(ARCH) > +ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' '' > + ASM_DIR=x86 > +endif Minor complaint: "ASM_DIR" really isn't. You use it as arch/$(ASM_DIR) and also as include/asm-$(ASM_DIR). I think what you really meant is "ARCH_DIR" (or similar). > +ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' '' > $(call unifdef, include/linux/kvm.h) > $(call unifdef, include/linux/kvm_para.h) > $(call unifdef, include/asm-x86/kvm.h) > @@ -54,6 +60,8 @@ sync: > $(call hack, svm.c) > $(call hack, x86.c) > $(call hack, irq.h) > +endif > + Why are you keeping IA64 touching asm-x86? What happened to my suggestion of creating a per-arch HACK_FILES and UNIFDEF_FILES variables, and looping over those? -- Hollis Blanchard IBM Linux Technology Center |
From: Jerone Y. <jy...@us...> - 2008-04-15 16:21:06
|
On Tue, 2008-04-15 at 09:08 -0500, Hollis Blanchard wrote: > On Monday 14 April 2008 21:46:43 Jerone Young wrote: > > 1 file changed, 13 insertions(+), 5 deletions(-) > > kernel/Makefile | 18 +++++++++++++----- > > > > > > This patch add the ability for make sync in the kernel directory to work > > for mulitiple architectures and not just x86. > > > > Signed-off-by: Jerone Young <jy...@us...> > > > > diff --git a/kernel/Makefile b/kernel/Makefile > > --- a/kernel/Makefile > > +++ b/kernel/Makefile > > @@ -1,5 +1,10 @@ include ../config.mak > > include ../config.mak > > > > +ASM_DIR=$(ARCH) > > +ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' '' > > + ASM_DIR=x86 > > +endif > > Minor complaint: "ASM_DIR" really isn't. You use it as arch/$(ASM_DIR) and > also as include/asm-$(ASM_DIR). I think what you really meant is "ARCH_DIR" > (or similar). I can change it. Not that big of a deal. Oh left the ia64 on there by accident. > > > +ifneq '$(filter $(ASM_DIR), x86_64 i386 ia64)' '' > > $(call unifdef, include/linux/kvm.h) > > $(call unifdef, include/linux/kvm_para.h) > > $(call unifdef, include/asm-x86/kvm.h) > > @@ -54,6 +60,8 @@ sync: > > $(call hack, svm.c) > > $(call hack, x86.c) > > $(call hack, irq.h) > > +endif > > + > > Why are you keeping IA64 touching asm-x86? Accident. Cut and past error from the first mistake. > > What happened to my suggestion of creating a per-arch HACK_FILES and > UNIFDEF_FILES variables, and looping over those? These macros are only for x86. We don't want them or need them. So I just left them be as not to accidentally miss or break anything. > |
From: Hollis B. <ho...@us...> - 2008-04-15 18:21:41
|
On Tuesday 15 April 2008 11:20:58 Jerone Young wrote: > > What happened to my suggestion of creating a per-arch HACK_FILES and > > UNIFDEF_FILES variables, and looping over those? > > These macros are only for x86. We don't want them or need them. So I > just left them be as not to accidentally miss or break anything. Right, they are only used for x86. So as I said before, create arch-specific HACK_FILES and UNIFDEF_FILES variables, and use those instead. -- Hollis Blanchard IBM Linux Technology Center |
From: Avi K. <av...@qu...> - 2008-04-24 12:38:20
|
Jerone Young wrote: > 1 file changed, 37 insertions(+), 21 deletions(-) > kernel/Makefile | 58 +++++++++++++++++++++++++++++++++++-------------------- > > > - This adapts perviously sent patch to new changes to kernel/Makefile > - Fixes improper check in conditional > > This patch add the ability for make sync in the kernel directory to work for mulitiple architectures and not just x86. > > I addressed this in a different way by always syncing headers from all architectures. This means the tarballs can be used to build userspace on any arch (though kernel modules are limited to x86, mostly due to arch limitations). In addition, we no longer refer to KERNELDIR when building userspace, so it ought to be easier to build on random kernels. Patches to be pushed shortly... -- error compiling committee.c: too many arguments to function |