xref: /freebsd/usr.sbin/bhyve/Makefile (revision 2008043f386721d58158e37e0d7e50df8095942d)
1#
2#
3
4.include <src.opts.mk>
5
6PROG=	bhyve
7PACKAGE=	bhyve
8
9MAN=	bhyve.8 bhyve_config.5
10
11BHYVE_SYSDIR?=${SRCTOP}
12
13.PATH:	${.CURDIR}/${MACHINE_CPUARCH}	\
14	${SRCTOP}/sys/libkern		\
15	${SRCTOP}/sys/cam/ctl
16
17SRCS=	\
18	acpi.c			\
19	acpi_device.c		\
20	audio.c			\
21	basl.c			\
22	bhyvegc.c		\
23	bhyverun.c		\
24	bhyverun_machdep.c	\
25	block_if.c		\
26	bootrom.c		\
27	config.c		\
28	console.c		\
29	crc16.c			\
30	ctl_scsi_all.c		\
31	ctl_util.c		\
32	hda_codec.c		\
33	iov.c			\
34	mem.c			\
35	mevent.c		\
36	net_backends.c		\
37	net_utils.c		\
38	pci_emul.c		\
39	pci_hostbridge.c	\
40	pci_nvme.c		\
41	pci_passthru.c		\
42	pci_virtio_9p.c		\
43	pci_virtio_block.c	\
44	pci_virtio_console.c	\
45	pci_virtio_input.c	\
46	pci_virtio_net.c	\
47	pci_virtio_rnd.c	\
48	pci_virtio_scsi.c	\
49	qemu_fwcfg.c		\
50	qemu_loader.c		\
51	smbiostbl.c		\
52	sockstream.c		\
53	tpm_device.c		\
54	tpm_emul_passthru.c	\
55	tpm_intf_crb.c		\
56	tpm_ppi_qemu.c		\
57	uart_emul.c		\
58	usb_emul.c		\
59	usb_mouse.c		\
60	virtio.c		\
61	vmexit.c		\
62	vmgenc.c
63
64.if ${MK_BHYVE_SNAPSHOT} != "no"
65SRCS+=	snapshot.c
66.endif
67
68.include "${MACHINE_CPUARCH}/Makefile.inc"
69
70.if defined(BHYVE_GDB_SUPPORT)
71SRCS+=	gdb.c
72CFLAGS+= -DBHYVE_GDB
73.ifdef GDB_LOG
74CFLAGS+=-DGDB_LOG
75.endif
76.endif
77
78CFLAGS+=-I${.CURDIR}		\
79	-I${.CURDIR}/../../contrib/lib9p \
80	-I${SRCTOP}/sys
81
82LIBADD=	vmmapi md nv pthread z util sbuf cam 9p
83
84.if ${MK_BHYVE_SNAPSHOT} != "no"
85LIBADD+= ucl xo
86.endif
87
88.if ${MK_INET_SUPPORT} != "no"
89CFLAGS+=-DINET
90.endif
91.if ${MK_INET6_SUPPORT} != "no"
92CFLAGS+=-DINET6
93.endif
94.if ${MK_NETGRAPH_SUPPORT} != "no"
95CFLAGS+=-DNETGRAPH
96LIBADD+=    netgraph
97.endif
98.if ${MK_OPENSSL} == "no"
99CFLAGS+=-DNO_OPENSSL
100.else
101LIBADD+=	crypto
102CFLAGS+=-DOPENSSL_API_COMPAT=0x10100000L
103.endif
104
105CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/e1000
106CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/mii
107CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/usb/controller
108.if ${MK_BHYVE_SNAPSHOT} != "no"
109CFLAGS+= -I${SRCTOP}/contrib/libucl/include
110CFLAGS+= -DBHYVE_SNAPSHOT
111.endif
112
113# Disable thread safety analysis since it only finds very simple bugs and
114# yields many false positives.
115NO_WTHREAD_SAFETY=
116
117NO_WCAST_ALIGN=
118
119.include <bsd.prog.mk>
120