xref: /freebsd/usr.sbin/bhyve/Makefile (revision d93fbcf0222b05fcd7704b35bc94e5513c2682e2)
1366f6083SPeter Grehan#
2366f6083SPeter Grehan#
3366f6083SPeter Grehan
4f4d34383SMarcelo Araujo.include <src.opts.mk>
5f4d34383SMarcelo Araujo
6366f6083SPeter GrehanPROG=	bhyve
7c2e2d02cSBaptiste DaroussinPACKAGE=	bhyve
8366f6083SPeter Grehan
9621b5090SJohn BaldwinMAN=	bhyve.8 bhyve_config.5
10b1843e71SPeter Grehan
11e37bf586SPeter GrehanBHYVE_SYSDIR?=${SRCTOP}
125ccf6ce1SPeter Grehan
134f2bd402SMark Johnston.PATH:	${.CURDIR}/${MACHINE_CPUARCH}	\
144f2bd402SMark Johnston	${SRCTOP}/sys/libkern		\
154f2bd402SMark Johnston	${SRCTOP}/sys/cam/ctl
164f2bd402SMark Johnston
17b1843e71SPeter GrehanSRCS=	\
1819aebfbfSMark Johnston	acpi.c			\
191231f047SCorvin Köhne	acpi_device.c		\
206b021cc2SWarner Losh	audio.c			\
2121bbc284SCorvin Köhne	basl.c			\
222cf9911fSPeter Grehan	bhyvegc.c		\
23b1843e71SPeter Grehan	bhyverun.c		\
24e20b74daSMark Johnston	bhyverun_machdep.c	\
25b1843e71SPeter Grehan	block_if.c		\
269b1aa8d6SNeel Natu	bootrom.c		\
27621b5090SJohn Baldwin	config.c		\
282cf9911fSPeter Grehan	console.c		\
29b344bd3aSVal Packett	crc16.c			\
306f308bcfSJohn Baldwin	ctl_nvme_all.c		\
31f9c005a1SMarcelo Araujo	ctl_scsi_all.c		\
3219aebfbfSMark Johnston	ctl_util.c		\
336b021cc2SWarner Losh	hda_codec.c		\
3419aebfbfSMark Johnston	iov.c			\
35b1843e71SPeter Grehan	mem.c			\
36b1843e71SPeter Grehan	mevent.c		\
37be74aedeSMark Johnston	net_backend_netmap.c	\
38c5359e2aSMark Johnston	net_backend_slirp.c	\
390ff7076bSVincenzo Maffione	net_backends.c		\
404f7c3b7bSVincenzo Maffione	net_utils.c		\
410efad4acSJessica Clarke	pci_ahci.c		\
420efad4acSJessica Clarke	pci_e82545.c		\
43b1843e71SPeter Grehan	pci_emul.c		\
440efad4acSJessica Clarke	pci_hda.c		\
45b1843e71SPeter Grehan	pci_hostbridge.c	\
460efad4acSJessica Clarke	pci_irq.c		\
47c066c68cSMarcelo Araujo	pci_nvme.c		\
480efad4acSJessica Clarke	pci_uart.c		\
49100353cfSJakub Wojciech Klama	pci_virtio_9p.c		\
50b1843e71SPeter Grehan	pci_virtio_block.c	\
5113ee8ddeSJakub Wojciech Klama	pci_virtio_console.c	\
52054accacSCorvin Köhne	pci_virtio_input.c	\
53b1843e71SPeter Grehan	pci_virtio_net.c	\
549d0c4e17SPeter Grehan	pci_virtio_rnd.c	\
55f9c005a1SMarcelo Araujo	pci_virtio_scsi.c	\
560efad4acSJessica Clarke	pci_xhci.c		\
57d85147f3SCorvin Köhne	qemu_fwcfg.c		\
58f565b4d6SCorvin Köhne	qemu_loader.c		\
59af5bfc53STycho Nightingale	smbiostbl.c		\
602cf9911fSPeter Grehan	sockstream.c		\
61d5edf13dSCorvin Köhne	tpm_device.c		\
6211ba2146SCorvin Köhne	tpm_emul_passthru.c	\
63*d93fbcf0SHans Rosenfeld	tpm_emul_swtpm.c	\
640917f925SCorvin Köhne	tpm_intf_crb.c		\
6585a775e6SCorvin Köhne	tpm_ppi_qemu.c		\
66d1c5d0cfSMark Johnston	uart_backend.c		\
67b1843e71SPeter Grehan	uart_emul.c		\
682cf9911fSPeter Grehan	usb_emul.c		\
692cf9911fSPeter Grehan	usb_mouse.c		\
7019aebfbfSMark Johnston	virtio.c		\
7172f9c9d8SMark Johnston	vmexit.c		\
72548b1122SMark Johnston	vmgenc.c
73366f6083SPeter Grehan
74483d953aSJohn Baldwin.if ${MK_BHYVE_SNAPSHOT} != "no"
75483d953aSJohn BaldwinSRCS+=	snapshot.c
76483d953aSJohn Baldwin.endif
77483d953aSJohn Baldwin
784f2bd402SMark Johnston.include "${MACHINE_CPUARCH}/Makefile.inc"
794f2bd402SMark Johnston
80d878f72aSMark Johnston.if defined(BHYVE_FDT_SUPPORT)
81d878f72aSMark JohnstonLIBADD+= fdt
82d878f72aSMark JohnstonCFLAGS+= -I${SRCTOP}/sys/contrib/libfdt
83d878f72aSMark Johnston.endif
84d878f72aSMark Johnston
85ca2cda98SMark Johnston.if defined(BHYVE_GDB_SUPPORT)
86ca2cda98SMark JohnstonSRCS+=	gdb.c
87ca2cda98SMark JohnstonCFLAGS+= -DBHYVE_GDB
88ca2cda98SMark Johnston.ifdef GDB_LOG
89ca2cda98SMark JohnstonCFLAGS+=-DGDB_LOG
90ca2cda98SMark Johnston.endif
91f81cdf24SMark JohnstonSUBDIR+= gdb
92ca2cda98SMark Johnston.endif
93ca2cda98SMark Johnston
944f2bd402SMark JohnstonCFLAGS+=-I${.CURDIR}		\
954f2bd402SMark Johnston	-I${.CURDIR}/../../contrib/lib9p \
964f2bd402SMark Johnston	-I${SRCTOP}/sys
97ba9b7bf7SNeel Natu
98d878f72aSMark JohnstonLIBADD+= vmmapi md nv pthread z util sbuf cam 9p
9996602624SMariusz Zaborski
100483d953aSJohn Baldwin.if ${MK_BHYVE_SNAPSHOT} != "no"
101483d953aSJohn BaldwinLIBADD+= ucl xo
102483d953aSJohn Baldwin.endif
1032cf9911fSPeter Grehan
1048883128bSBjoern A. Zeeb.if ${MK_INET_SUPPORT} != "no"
1058883128bSBjoern A. ZeebCFLAGS+=-DINET
1068883128bSBjoern A. Zeeb.endif
1078883128bSBjoern A. Zeeb.if ${MK_INET6_SUPPORT} != "no"
1088883128bSBjoern A. ZeebCFLAGS+=-DINET6
1098883128bSBjoern A. Zeeb.endif
1102cd7735dSAleksandr Fedorov.if ${MK_NETGRAPH_SUPPORT} != "no"
111be74aedeSMark JohnstonSRCS+=	net_backend_netgraph.c
1122cd7735dSAleksandr FedorovLIBADD+=	netgraph
1132cd7735dSAleksandr Fedorov.endif
114f4d34383SMarcelo Araujo.if ${MK_OPENSSL} == "no"
115f4d34383SMarcelo AraujoCFLAGS+=-DNO_OPENSSL
116f4d34383SMarcelo Araujo.else
117f4d34383SMarcelo AraujoLIBADD+=	crypto
1189c6f3dfdSEd MasteCFLAGS+=-DOPENSSL_API_COMPAT=0x10100000L
119f4d34383SMarcelo Araujo.endif
120f4d34383SMarcelo Araujo
1219e749f25SAlexander MotinCFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/e1000
1229e749f25SAlexander MotinCFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/mii
1232cf9911fSPeter GrehanCFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/usb/controller
124483d953aSJohn Baldwin.if ${MK_BHYVE_SNAPSHOT} != "no"
125483d953aSJohn BaldwinCFLAGS+= -I${SRCTOP}/contrib/libucl/include
126483d953aSJohn BaldwinCFLAGS+= -DBHYVE_SNAPSHOT
127483d953aSJohn Baldwin.endif
128366f6083SPeter Grehan
1291a8e5239SMark Johnston# Disable thread safety analysis since it only finds very simple bugs and
1301a8e5239SMark Johnston# yields many false positives.
1311a8e5239SMark JohnstonNO_WTHREAD_SAFETY=
1321a8e5239SMark Johnston
13371ebd117SMark JohnstonNO_WCAST_ALIGN=
13471ebd117SMark Johnston
135366f6083SPeter Grehan.include <bsd.prog.mk>
136