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