xref: /freebsd/sys/modules/vmm/Makefile (revision 3cbb4cc200f8a0ad7ed08233425ea54524a21f1c)
1# $FreeBSD$
2
3.include <kmod.opts.mk>
4
5KMOD=	vmm
6
7SRCS=	opt_acpi.h opt_bhyve_snapshot.h opt_ddb.h
8SRCS+=	device_if.h bus_if.h pci_if.h pcib_if.h acpi_if.h vnode_if.h
9DPSRCS+=	vmx_assym.h svm_assym.h
10DPSRCS+=	vmx_genassym.c svm_genassym.c offset.inc
11
12CFLAGS+= -DVMM_KEEP_STATS
13CFLAGS+= -I${SRCTOP}/sys/amd64/vmm
14CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/io
15CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/intel
16CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/amd
17
18# generic vmm support
19.PATH: ${SRCTOP}/sys/amd64/vmm
20SRCS+=	vmm.c		\
21	vmm_dev.c	\
22	vmm_host.c	\
23	vmm_instruction_emul.c	\
24	vmm_ioport.c	\
25	vmm_lapic.c	\
26	vmm_mem.c	\
27	vmm_stat.c	\
28	vmm_util.c	\
29	x86.c
30
31.PATH: ${SRCTOP}/sys/amd64/vmm/io
32SRCS+=	iommu.c		\
33	ppt.c           \
34	vatpic.c	\
35	vatpit.c	\
36	vhpet.c		\
37	vioapic.c	\
38	vlapic.c	\
39	vpmtmr.c	\
40	vrtc.c
41
42# intel-specific files
43.PATH: ${SRCTOP}/sys/amd64/vmm/intel
44SRCS+=	ept.c		\
45	vmcs.c		\
46	vmx_msr.c	\
47	vmx_support.S	\
48	vmx.c		\
49	vtd.c
50
51# amd-specific files
52.PATH: ${SRCTOP}/sys/amd64/vmm/amd
53SRCS+=	vmcb.c		\
54	svm.c		\
55	svm_support.S	\
56	npt.c		\
57	ivrs_drv.c	\
58	amdvi_hw.c	\
59	svm_msr.c
60
61.if ${KERN_OPTS:MBHYVE_SNAPSHOT} != ""
62SRCS+=	vmm_snapshot.c
63.endif
64
65CLEANFILES=	vmx_assym.h vmx_genassym.o svm_assym.h svm_genassym.o
66
67OBJS_DEPEND_GUESS.vmx_support.o+= vmx_assym.h
68OBJS_DEPEND_GUESS.svm_support.o+= svm_assym.h
69
70vmx_assym.h:    vmx_genassym.o
71	sh ${SYSDIR}/kern/genassym.sh vmx_genassym.o > ${.TARGET}
72
73svm_assym.h:    svm_genassym.o
74	sh ${SYSDIR}/kern/genassym.sh svm_genassym.o > ${.TARGET}
75
76vmx_support.o:
77	${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
78	    ${.IMPSRC} -o ${.TARGET}
79
80svm_support.o:
81	${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
82	    ${.IMPSRC} -o ${.TARGET}
83
84vmx_genassym.o: offset.inc
85	${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
86
87svm_genassym.o: offset.inc
88	${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
89
90.include <bsd.kmod.mk>
91