xref: /freebsd/usr.sbin/bhyve/Makefile (revision 783d3ff6)
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_backend_netmap.c	\
37	net_backend_slirp.c	\
38	net_backends.c		\
39	net_utils.c		\
40	pci_emul.c		\
41	pci_hostbridge.c	\
42	pci_nvme.c		\
43	pci_passthru.c		\
44	pci_virtio_9p.c		\
45	pci_virtio_block.c	\
46	pci_virtio_console.c	\
47	pci_virtio_input.c	\
48	pci_virtio_net.c	\
49	pci_virtio_rnd.c	\
50	pci_virtio_scsi.c	\
51	qemu_fwcfg.c		\
52	qemu_loader.c		\
53	smbiostbl.c		\
54	sockstream.c		\
55	tpm_device.c		\
56	tpm_emul_passthru.c	\
57	tpm_intf_crb.c		\
58	tpm_ppi_qemu.c		\
59	uart_backend.c		\
60	uart_emul.c		\
61	usb_emul.c		\
62	usb_mouse.c		\
63	virtio.c		\
64	vmexit.c		\
65	vmgenc.c
66
67.if ${MK_BHYVE_SNAPSHOT} != "no"
68SRCS+=	snapshot.c
69.endif
70
71.include "${MACHINE_CPUARCH}/Makefile.inc"
72
73.if defined(BHYVE_GDB_SUPPORT)
74SRCS+=	gdb.c
75CFLAGS+= -DBHYVE_GDB
76.ifdef GDB_LOG
77CFLAGS+=-DGDB_LOG
78.endif
79SUBDIR+= gdb
80.endif
81
82CFLAGS+=-I${.CURDIR}		\
83	-I${.CURDIR}/../../contrib/lib9p \
84	-I${SRCTOP}/sys
85
86LIBADD=	vmmapi md nv pthread z util sbuf cam 9p
87
88.if ${MK_BHYVE_SNAPSHOT} != "no"
89LIBADD+= ucl xo
90.endif
91
92.if ${MK_INET_SUPPORT} != "no"
93CFLAGS+=-DINET
94.endif
95.if ${MK_INET6_SUPPORT} != "no"
96CFLAGS+=-DINET6
97.endif
98.if ${MK_NETGRAPH_SUPPORT} != "no"
99SRCS+=	net_backend_netgraph.c
100LIBADD+=	netgraph
101.endif
102.if ${MK_OPENSSL} == "no"
103CFLAGS+=-DNO_OPENSSL
104.else
105LIBADD+=	crypto
106CFLAGS+=-DOPENSSL_API_COMPAT=0x10100000L
107.endif
108
109CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/e1000
110CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/mii
111CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/usb/controller
112.if ${MK_BHYVE_SNAPSHOT} != "no"
113CFLAGS+= -I${SRCTOP}/contrib/libucl/include
114CFLAGS+= -DBHYVE_SNAPSHOT
115.endif
116
117# Disable thread safety analysis since it only finds very simple bugs and
118# yields many false positives.
119NO_WTHREAD_SAFETY=
120
121NO_WCAST_ALIGN=
122
123.include <bsd.prog.mk>
124