xref: /freebsd/sys/modules/vmm/Makefile (revision 02e9120893770924227138ba49df1edb3896112a)
1
2.include <kmod.opts.mk>
3
4KMOD=	vmm
5
6SRCS=	opt_acpi.h opt_bhyve_snapshot.h opt_ddb.h
7SRCS+=	device_if.h bus_if.h pci_if.h pcib_if.h acpi_if.h vnode_if.h
8DPSRCS+=	vmx_assym.h svm_assym.h
9DPSRCS+=	vmx_genassym.c svm_genassym.c offset.inc
10
11CFLAGS+= -DVMM_KEEP_STATS
12CFLAGS+= -I${SRCTOP}/sys/amd64/vmm
13CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/io
14CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/intel
15CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/amd
16
17# generic vmm support
18.PATH: ${SRCTOP}/sys/amd64/vmm
19SRCS+=	vmm.c		\
20	vmm_dev.c	\
21	vmm_host.c	\
22	vmm_instruction_emul.c	\
23	vmm_ioport.c	\
24	vmm_lapic.c	\
25	vmm_mem.c	\
26	vmm_stat.c	\
27	vmm_util.c	\
28	x86.c
29
30.PATH: ${SRCTOP}/sys/amd64/vmm/io
31SRCS+=	iommu.c		\
32	ppt.c           \
33	vatpic.c	\
34	vatpit.c	\
35	vhpet.c		\
36	vioapic.c	\
37	vlapic.c	\
38	vpmtmr.c	\
39	vrtc.c
40
41# intel-specific files
42.PATH: ${SRCTOP}/sys/amd64/vmm/intel
43SRCS+=	ept.c		\
44	vmcs.c		\
45	vmx_msr.c	\
46	vmx_support.S	\
47	vmx.c		\
48	vtd.c
49
50# amd-specific files
51.PATH: ${SRCTOP}/sys/amd64/vmm/amd
52SRCS+=	vmcb.c		\
53	amdiommu.c	\
54	ivhd_if.c	\
55	ivhd_if.h	\
56	svm.c		\
57	svm_support.S	\
58	npt.c		\
59	ivrs_drv.c	\
60	amdvi_hw.c	\
61	svm_msr.c
62
63SRCS.BHYVE_SNAPSHOT=	vmm_snapshot.c
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