xref: /freebsd/sys/modules/vmm/Makefile (revision d9a42747950146bf03cda7f6e25d219253f8a57a)
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
64SRCS.BHYVE_SNAPSHOT=	vmm_snapshot.c
65
66CLEANFILES=	vmx_assym.h vmx_genassym.o svm_assym.h svm_genassym.o
67
68OBJS_DEPEND_GUESS.vmx_support.o+= vmx_assym.h
69OBJS_DEPEND_GUESS.svm_support.o+= svm_assym.h
70
71vmx_assym.h:    vmx_genassym.o
72	sh ${SYSDIR}/kern/genassym.sh vmx_genassym.o > ${.TARGET}
73
74svm_assym.h:    svm_genassym.o
75	sh ${SYSDIR}/kern/genassym.sh svm_genassym.o > ${.TARGET}
76
77vmx_support.o:
78	${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
79	    ${.IMPSRC} -o ${.TARGET}
80
81svm_support.o:
82	${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
83	    ${.IMPSRC} -o ${.TARGET}
84
85vmx_genassym.o: offset.inc
86	${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
87
88svm_genassym.o: offset.inc
89	${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
90
91.include <bsd.kmod.mk>
92