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