Instead of adding more and more ifeq ($(SRCARCH),...), declare arch/*/Makefile to be an include of the top-level makefile. The previous content of the arch makefiles is moved into new Kbuild files.
Signed-off-by: Jan Kiszka <[email protected]> --- hypervisor/Makefile | 17 ++--------------- hypervisor/arch/arm/{Makefile => Kbuild} | 0 hypervisor/arch/arm/Makefile | 23 ++--------------------- hypervisor/arch/arm64/{Makefile => Kbuild} | 0 hypervisor/arch/arm64/Makefile | 16 +--------------- hypervisor/arch/x86/{Makefile => Kbuild} | 0 hypervisor/arch/x86/Makefile | 15 +++++---------- 7 files changed, 10 insertions(+), 61 deletions(-) copy hypervisor/arch/arm/{Makefile => Kbuild} (100%) copy hypervisor/arch/arm64/{Makefile => Kbuild} (100%) copy hypervisor/arch/x86/{Makefile => Kbuild} (100%) diff --git a/hypervisor/Makefile b/hypervisor/Makefile index c037ed0..bf808e0 100644 --- a/hypervisor/Makefile +++ b/hypervisor/Makefile @@ -1,7 +1,7 @@ # # Jailhouse, a Linux-based partitioning hypervisor # -# Copyright (c) Siemens AG, 2013 +# Copyright (c) Siemens AG, 2013-2016 # Copyright (c) Valentine Sinitsyn, 2014 # # Authors: @@ -22,20 +22,7 @@ KBUILD_CFLAGS := -g -Os -Wall -Wstrict-prototypes -Wtype-limits \ -fno-strict-aliasing -fno-pic -fno-common \ -fno-stack-protector -fno-builtin-ffsl -ifeq ($(SRCARCH),x86) -KBUILD_CFLAGS += -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -KBUILD_CFLAGS += $(call cc-option,-mno-avx,) -KBUILD_CPPFLAGS += -m64 -BUILD_VARIANTS := amd intel -endif - -ifeq ($(SRCARCH),arm) -KBUILD_CFLAGS += -marm -endif - -ifeq ($(SRCARCH),arm64) -LINUXINCLUDE += -I$(src)/arch/arm/include -endif +include $(src)/arch/$(SRCARCH)/Makefile ifneq ($(wildcard $(obj)/include/jailhouse/config.h),) KBUILD_CFLAGS += -include $(obj)/include/jailhouse/config.h diff --git a/hypervisor/arch/arm/Makefile b/hypervisor/arch/arm/Kbuild similarity index 100% copy from hypervisor/arch/arm/Makefile copy to hypervisor/arch/arm/Kbuild diff --git a/hypervisor/arch/arm/Makefile b/hypervisor/arch/arm/Makefile index f073926..e4721c5 100644 --- a/hypervisor/arch/arm/Makefile +++ b/hypervisor/arch/arm/Makefile @@ -1,7 +1,7 @@ # # Jailhouse, a Linux-based partitioning hypervisor # -# Copyright (c) Siemens AG, 2013 +# Copyright (c) Siemens AG, 2016 # # Authors: # Jan Kiszka <[email protected]> @@ -10,23 +10,4 @@ # the COPYING file in the top-level directory. # -include $(CONFIG_MK) - -KBUILD_AFLAGS := $(subst -include asm/unified.h,,$(KBUILD_AFLAGS)) - -always := built-in.o - -COMMON := ../arm-common - -obj-y := entry.o exception.o setup.o control.o traps.o mmio.o -obj-y += mmu_hyp.o caches.o smp-stubs.o -obj-y += $(COMMON)/dbg-write.o $(COMMON)/lib.o $(COMMON)/psci.o -obj-y += $(COMMON)/paging.o $(COMMON)/mmu_cell.o -obj-y += $(COMMON)/irqchip.o $(COMMON)/gic-common.o -obj-y += $(COMMON)/control.o -obj-$(CONFIG_ARM_GIC_V2) += $(COMMON)/gic-v2.o -obj-$(CONFIG_ARM_GIC_V3) += gic-v3.o -obj-$(CONFIG_SERIAL_AMBA_PL011) += $(COMMON)/uart-pl011.o -obj-$(CONFIG_SERIAL_8250_DW) += uart-8250-dw.o -obj-$(CONFIG_SERIAL_TEGRA) += uart-tegra.o -obj-$(CONFIG_MACH_VEXPRESS) += smp-vexpress.o +KBUILD_CFLAGS += -marm diff --git a/hypervisor/arch/arm64/Makefile b/hypervisor/arch/arm64/Kbuild similarity index 100% copy from hypervisor/arch/arm64/Makefile copy to hypervisor/arch/arm64/Kbuild diff --git a/hypervisor/arch/arm64/Makefile b/hypervisor/arch/arm64/Makefile index 2d44cdd..b78e88b 100644 --- a/hypervisor/arch/arm64/Makefile +++ b/hypervisor/arch/arm64/Makefile @@ -10,18 +10,4 @@ # the COPYING file in the top-level directory. # -include $(CONFIG_MK) - -COMMON := ../arm-common - -always := built-in.o - -obj-y := entry.o setup.o control.o mmio.o caches.o -obj-y += exception.o traps.o -obj-y += $(COMMON)/dbg-write.o $(COMMON)/lib.o -obj-y += $(COMMON)/control.o $(COMMON)/psci.o -obj-y += $(COMMON)/mmu_cell.o $(COMMON)/paging.o -obj-y += $(COMMON)/irqchip.o $(COMMON)/gic-common.o - -obj-$(CONFIG_SERIAL_AMBA_PL011) += $(COMMON)/uart-pl011.o -obj-$(CONFIG_ARM_GIC_V2) += $(COMMON)/gic-v2.o +LINUXINCLUDE += -I$(src)/arch/arm/include diff --git a/hypervisor/arch/x86/Makefile b/hypervisor/arch/x86/Kbuild similarity index 100% copy from hypervisor/arch/x86/Makefile copy to hypervisor/arch/x86/Kbuild diff --git a/hypervisor/arch/x86/Makefile b/hypervisor/arch/x86/Makefile index b459f8f..43343f4 100644 --- a/hypervisor/arch/x86/Makefile +++ b/hypervisor/arch/x86/Makefile @@ -1,7 +1,7 @@ # # Jailhouse, a Linux-based partitioning hypervisor # -# Copyright (c) Siemens AG, 2013 +# Copyright (c) Siemens AG, 2013-2016 # Copyright (c) Valentine Sinitsyn, 2014 # # Authors: @@ -12,14 +12,9 @@ # the COPYING file in the top-level directory. # -BUILT_IN_OBJECTS := built-in-amd.o built-in-intel.o -COMMON_OBJECTS := apic.o dbg-write.o entry.o setup.o control.o mmio.o iommu.o \ - paging.o ../../pci.o pci.o ioapic.o i8042.o vcpu.o \ - ../../pci_ivshmem.o +KBUILD_CFLAGS += -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow +KBUILD_CFLAGS += $(call cc-option,-mno-avx,) -always := $(BUILT_IN_OBJECTS) +KBUILD_CPPFLAGS += -m64 -obj-y := $(BUILT_IN_OBJECTS) - -built-in-amd-y := $(COMMON_OBJECTS) svm.o amd_iommu.o svm-vmexit.o cat-stubs.o -built-in-intel-y := $(COMMON_OBJECTS) vmx.o vtd.o vmx-vmexit.o cat.o +BUILD_VARIANTS := amd intel -- 2.1.4 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
