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