Xiantao Zhang | b693919 | 2008-03-28 14:58:47 +0800 | [diff] [blame] | 1 | #This Make file is to generate asm-offsets.h and build source. |
| 2 | # |
| 3 | |
| 4 | #Generate asm-offsets.h for vmm module build |
| 5 | offsets-file := asm-offsets.h |
| 6 | |
| 7 | always := $(offsets-file) |
| 8 | targets := $(offsets-file) |
| 9 | targets += arch/ia64/kvm/asm-offsets.s |
Xiantao Zhang | b693919 | 2008-03-28 14:58:47 +0800 | [diff] [blame] | 10 | |
| 11 | # Default sed regexp - multiline due to syntax constraints |
| 12 | define sed-y |
| 13 | "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" |
| 14 | endef |
| 15 | |
| 16 | quiet_cmd_offsets = GEN $@ |
| 17 | define cmd_offsets |
| 18 | (set -e; \ |
| 19 | echo "#ifndef __ASM_KVM_OFFSETS_H__"; \ |
| 20 | echo "#define __ASM_KVM_OFFSETS_H__"; \ |
| 21 | echo "/*"; \ |
| 22 | echo " * DO NOT MODIFY."; \ |
| 23 | echo " *"; \ |
| 24 | echo " * This file was generated by Makefile"; \ |
| 25 | echo " *"; \ |
| 26 | echo " */"; \ |
| 27 | echo ""; \ |
| 28 | sed -ne $(sed-y) $<; \ |
| 29 | echo ""; \ |
| 30 | echo "#endif" ) > $@ |
| 31 | endef |
Xiantao Zhang | e45948b | 2008-10-23 10:37:06 +0800 | [diff] [blame] | 32 | |
Xiantao Zhang | b693919 | 2008-03-28 14:58:47 +0800 | [diff] [blame] | 33 | # We use internal rules to avoid the "is up to date" message from make |
Xiantao Zhang | e45948b | 2008-10-23 10:37:06 +0800 | [diff] [blame] | 34 | arch/ia64/kvm/asm-offsets.s: arch/ia64/kvm/asm-offsets.c \ |
| 35 | $(wildcard $(srctree)/arch/ia64/include/asm/*.h)\ |
| 36 | $(wildcard $(srctree)/include/linux/*.h) |
Xiantao Zhang | b693919 | 2008-03-28 14:58:47 +0800 | [diff] [blame] | 37 | $(call if_changed_dep,cc_s_c) |
| 38 | |
| 39 | $(obj)/$(offsets-file): arch/ia64/kvm/asm-offsets.s |
| 40 | $(call cmd,offsets) |
| 41 | |
Xiantao Zhang | e45948b | 2008-10-23 10:37:06 +0800 | [diff] [blame] | 42 | FORCE : $(obj)/$(offsets-file) |
| 43 | |
Xiantao Zhang | b693919 | 2008-03-28 14:58:47 +0800 | [diff] [blame] | 44 | # |
| 45 | # Makefile for Kernel-based Virtual Machine module |
| 46 | # |
| 47 | |
| 48 | EXTRA_CFLAGS += -Ivirt/kvm -Iarch/ia64/kvm/ |
Al Viro | ea696f9 | 2008-04-28 06:59:05 +0100 | [diff] [blame] | 49 | EXTRA_AFLAGS += -Ivirt/kvm -Iarch/ia64/kvm/ |
Xiantao Zhang | b693919 | 2008-03-28 14:58:47 +0800 | [diff] [blame] | 50 | |
Laurent Vivier | 7f39f8a | 2008-05-30 16:05:57 +0200 | [diff] [blame] | 51 | common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \ |
Xiantao Zhang | 3de42dc | 2008-10-06 13:48:45 +0800 | [diff] [blame] | 52 | coalesced_mmio.o irq_comm.o) |
Xiantao Zhang | b693919 | 2008-03-28 14:58:47 +0800 | [diff] [blame] | 53 | |
Xiantao Zhang | 2381ad2 | 2008-10-08 08:29:33 +0800 | [diff] [blame] | 54 | ifeq ($(CONFIG_DMAR),y) |
| 55 | common-objs += $(addprefix ../../../virt/kvm/, vtd.o) |
| 56 | endif |
| 57 | |
Xiantao Zhang | b693919 | 2008-03-28 14:58:47 +0800 | [diff] [blame] | 58 | kvm-objs := $(common-objs) kvm-ia64.o kvm_fw.o |
| 59 | obj-$(CONFIG_KVM) += kvm.o |
| 60 | |
Xiantao Zhang | 547567c | 2008-11-20 10:35:35 +0800 | [diff] [blame] | 61 | CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127 |
Xiantao Zhang | b693919 | 2008-03-28 14:58:47 +0800 | [diff] [blame] | 62 | kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \ |
| 63 | vtlb.o process.o |
| 64 | #Add link memcpy and memset to avoid possible structure assignment error |
Xiantao Zhang | 25c437b | 2008-05-07 17:34:52 +0800 | [diff] [blame] | 65 | kvm-intel-objs += memcpy.o memset.o |
Xiantao Zhang | b693919 | 2008-03-28 14:58:47 +0800 | [diff] [blame] | 66 | obj-$(CONFIG_KVM_INTEL) += kvm-intel.o |