xref: /freebsd/sys/modules/vmm/Makefile (revision 19261079b74319502c6ffa1249920079f0f69a72)
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	amdiommu.c	\
55	ivhd_if.c	\
56	ivhd_if.h	\
57	svm.c		\
58	svm_support.S	\
59	npt.c		\
60	ivrs_drv.c	\
61	amdvi_hw.c	\
62	svm_msr.c
63
64.if ${KERN_OPTS:MBHYVE_SNAPSHOT} != ""
65SRCS+=	vmm_snapshot.c
66.endif
67
68CLEANFILES=	vmx_assym.h vmx_genassym.o svm_assym.h svm_genassym.o
69
70OBJS_DEPEND_GUESS.vmx_support.o+= vmx_assym.h
71OBJS_DEPEND_GUESS.svm_support.o+= svm_assym.h
72
73vmx_assym.h:    vmx_genassym.o
74	sh ${SYSDIR}/kern/genassym.sh vmx_genassym.o > ${.TARGET}
75
76svm_assym.h:    svm_genassym.o
77	sh ${SYSDIR}/kern/genassym.sh svm_genassym.o > ${.TARGET}
78
79vmx_support.o:
80	${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
81	    ${.IMPSRC} -o ${.TARGET}
82
83svm_support.o:
84	${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
85	    ${.IMPSRC} -o ${.TARGET}
86
87vmx_genassym.o: offset.inc
88	${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
89
90svm_genassym.o: offset.inc
91	${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
92
93.include <bsd.kmod.mk>
94