>From a2c959bc3566ec23c7991da49449ae46c008c623 Mon Sep 17 00:00:00 2001 From: Xiantao Zhang <xiantao.zhang@xxxxxxxxx> Date: Fri, 4 Jul 2008 09:57:36 +0800 Subject: [PATCH] KVM: external module: Moving Kbuild to x86. Moving x86's Kbuild to x86. Signed-off-by: Xiantao Zhang <xiantao.zhang@xxxxxxxxx> --- kernel/Kbuild | 12 +----------- kernel/Makefile | 9 ++++++--- kernel/x86/Kbuild | 11 +++++++++++ 3 files changed, 18 insertions(+), 14 deletions(-) create mode 100644 kernel/x86/Kbuild diff --git a/kernel/Kbuild b/kernel/Kbuild index de56aec..7019ca0 100644 --- a/kernel/Kbuild +++ b/kernel/Kbuild @@ -1,11 +1 @@ -obj-m := kvm.o kvm-intel.o kvm-amd.o -kvm-objs := kvm_main.o x86.o mmu.o x86_emulate.o x86/anon_inodes.o irq.o i8259.o \ - lapic.o ioapic.o x86/preempt.o i8254.o coalesced_mmio.o \ - x86/external-module-compat.o -ifeq ($(CONFIG_KVM_TRACE),y) -kvm-objs += kvm_trace.o -endif -kvm-intel-objs := vmx.o x86/vmx-debug.o x86/external-module-compat.o -kvm-amd-objs := svm.o x86/external-module-compat.o - -CFLAGS_kvm_main.o = -DKVM_MAIN +obj-$(CONFIG_X86) += x86/ diff --git a/kernel/Makefile b/kernel/Makefile index c2c666e..94d63bc 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -67,16 +67,19 @@ source-sync: "$(LINUX)"/virt/kvm/./*.[ch] \ $T/ + set -e && for i in $(find $T -name '*.c'); do \ + $(call unifdef,$$i); done + 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 + do cmp -s $(ARCH_DIR)/$$i $T/$$i || cp $T/$$i $(ARCH_DIR)/$$i; done rm -rf $T install: mkdir -p $(DESTDIR)/$(INSTALLDIR) - cp *.ko $(DESTDIR)/$(INSTALLDIR) + cp $(ARCH_DIR)/*.ko $(DESTDIR)/$(INSTALLDIR) for i in $(ORIGMODDIR)/drivers/kvm/*.ko \ $(ORIGMODDIR)/arch/$(ARCH_DIR)/kvm/*.ko; do \ if [ -f "$$i" ]; then mv "$$i" "$$i.orig"; fi; \ @@ -94,7 +97,7 @@ rpm: all sed 's/^Release:.*/Release: $(rpmrelease)/; s/^%define kverrel.*/%define kverrel $(KVERREL)/' \ kvm-kmod.spec > $(tmpspec) rpmbuild --define="kverrel $(KVERREL)" \ - --define="objdir $$(pwd)" \ + --define="objdir $$(pwd)/$(ARCH_DIR)" \ --define="_rpmdir $(RPMDIR)" \ --define="_topdir $(rpm-topdir)" \ -bb $(tmpspec) diff --git a/kernel/x86/Kbuild b/kernel/x86/Kbuild new file mode 100644 index 0000000..676f28d --- /dev/null +++ b/kernel/x86/Kbuild @@ -0,0 +1,11 @@ +obj-m := kvm.o kvm-intel.o kvm-amd.o +kvm-objs := kvm_main.o x86.o mmu.o x86_emulate.o anon_inodes.o irq.o i8259.o \ + lapic.o ioapic.o preempt.o i8254.o coalesced_mmio.o \ + external-module-compat.o +ifeq ($(CONFIG_KVM_TRACE),y) +kvm-objs += kvm_trace.o +endif +kvm-intel-objs := vmx.o vmx-debug.o external-module-compat.o +kvm-amd-objs := svm.o external-module-compat.o + +CFLAGS_kvm_main.o = -DKVM_MAIN -- 1.5.2
Attachment:
0002-KVM-external-module-Moving-Kbuild-to-x86.patch
Description: 0002-KVM-external-module-Moving-Kbuild-to-x86.patch