xref: /freebsd/usr.sbin/bhyve/Makefile (revision 2e3f49888ec8851bafb22011533217487764fdb0)
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_emul.c		\
60	usb_emul.c		\
61	usb_mouse.c		\
62	virtio.c		\
63	vmexit.c		\
64	vmgenc.c
65
66.if ${MK_BHYVE_SNAPSHOT} != "no"
67SRCS+=	snapshot.c
68.endif
69
70.include "${MACHINE_CPUARCH}/Makefile.inc"
71
72.if defined(BHYVE_GDB_SUPPORT)
73SRCS+=	gdb.c
74CFLAGS+= -DBHYVE_GDB
75.ifdef GDB_LOG
76CFLAGS+=-DGDB_LOG
77.endif
78.endif
79
80CFLAGS+=-I${.CURDIR}		\
81	-I${.CURDIR}/../../contrib/lib9p \
82	-I${SRCTOP}/sys
83
84LIBADD=	vmmapi md nv pthread z util sbuf cam 9p
85
86.if ${MK_BHYVE_SNAPSHOT} != "no"
87LIBADD+= ucl xo
88.endif
89
90.if ${MK_INET_SUPPORT} != "no"
91CFLAGS+=-DINET
92.endif
93.if ${MK_INET6_SUPPORT} != "no"
94CFLAGS+=-DINET6
95.endif
96.if ${MK_NETGRAPH_SUPPORT} != "no"
97SRCS+=	net_backend_netgraph.c
98LIBADD+=	netgraph
99.endif
100.if ${MK_OPENSSL} == "no"
101CFLAGS+=-DNO_OPENSSL
102.else
103LIBADD+=	crypto
104CFLAGS+=-DOPENSSL_API_COMPAT=0x10100000L
105.endif
106
107CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/e1000
108CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/mii
109CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/usb/controller
110.if ${MK_BHYVE_SNAPSHOT} != "no"
111CFLAGS+= -I${SRCTOP}/contrib/libucl/include
112CFLAGS+= -DBHYVE_SNAPSHOT
113.endif
114
115# Disable thread safety analysis since it only finds very simple bugs and
116# yields many false positives.
117NO_WTHREAD_SAFETY=
118
119NO_WCAST_ALIGN=
120
121.include <bsd.prog.mk>
122