blob: 52353397a1a4b94d36f167680ffffa7822ca326c [file] [log] [blame]
Xiantao Zhangb6939192008-03-28 14:58:47 +08001#This Make file is to generate asm-offsets.h and build source.
2#
3
4#Generate asm-offsets.h for vmm module build
5offsets-file := asm-offsets.h
6
7always := $(offsets-file)
8targets := $(offsets-file)
9targets += arch/ia64/kvm/asm-offsets.s
10clean-files := $(addprefix $(objtree)/,$(targets) $(obj)/memcpy.S $(obj)/memset.S)
11
12# Default sed regexp - multiline due to syntax constraints
13define sed-y
14 "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
15endef
16
17quiet_cmd_offsets = GEN $@
18define cmd_offsets
19 (set -e; \
20 echo "#ifndef __ASM_KVM_OFFSETS_H__"; \
21 echo "#define __ASM_KVM_OFFSETS_H__"; \
22 echo "/*"; \
23 echo " * DO NOT MODIFY."; \
24 echo " *"; \
25 echo " * This file was generated by Makefile"; \
26 echo " *"; \
27 echo " */"; \
28 echo ""; \
29 sed -ne $(sed-y) $<; \
30 echo ""; \
31 echo "#endif" ) > $@
32endef
33# We use internal rules to avoid the "is up to date" message from make
34arch/ia64/kvm/asm-offsets.s: arch/ia64/kvm/asm-offsets.c
35 $(call if_changed_dep,cc_s_c)
36
37$(obj)/$(offsets-file): arch/ia64/kvm/asm-offsets.s
38 $(call cmd,offsets)
39
40#
41# Makefile for Kernel-based Virtual Machine module
42#
43
44EXTRA_CFLAGS += -Ivirt/kvm -Iarch/ia64/kvm/
Al Viroea696f92008-04-28 06:59:05 +010045EXTRA_AFLAGS += -Ivirt/kvm -Iarch/ia64/kvm/
Xiantao Zhangb6939192008-03-28 14:58:47 +080046
47common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o)
48
49kvm-objs := $(common-objs) kvm-ia64.o kvm_fw.o
50obj-$(CONFIG_KVM) += kvm.o
51
52FORCE : $(obj)/$(offsets-file)
53EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127
54kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \
55 vtlb.o process.o
56#Add link memcpy and memset to avoid possible structure assignment error
Al Viroea696f92008-04-28 06:59:05 +010057kvm-intel-objs += ../lib/memset.o ../lib/memcpy.o
Xiantao Zhangb6939192008-03-28 14:58:47 +080058obj-$(CONFIG_KVM_INTEL) += kvm-intel.o