1# 2# This file and its contents are supplied under the terms of the 3# Common Development and Distribution License ("CDDL"), version 1.0. 4# You may only use this file in accordance with the terms of version 5# 1.0 of the CDDL. 6# 7# A full copy of the text of the CDDL should have accompanied this 8# source. A copy of the CDDL is also available via the Internet at 9# http://www.illumos.org/license/CDDL. 10# 11 12# 13# Copyright 2014 Pluribus Networks Inc. 14# Copyright 2020 Joyent, Inc. 15# Copyright 2020 Oxide Computer Company 16# Copyright 2024 OmniOS Community Edition (OmniOSce) Association. 17# 18 19PROG = bhyve 20 21include $(SRC)/cmd/Makefile.cmd 22include $(SRC)/cmd//Makefile.cmd.64 23include $(SRC)/cmd/Makefile.ctf 24 25COMMON_OBJS = \ 26 acpi.o \ 27 acpi_device.o \ 28 basl.o \ 29 bhyvegc.o \ 30 bhyverun.o \ 31 block_if.o \ 32 bootrom.o \ 33 config.o \ 34 console.o \ 35 crc16.o \ 36 gdb.o \ 37 hexdump.o \ 38 iov.o \ 39 mem.o \ 40 mevent.o \ 41 net_backend_dlpi.o \ 42 net_backends.o \ 43 net_utils.o \ 44 pci_ahci.o \ 45 pci_e82545.o \ 46 pci_emul.o \ 47 pci_hostbridge.o \ 48 pci_irq.o \ 49 pci_nvme.o \ 50 pci_uart.o \ 51 pci_virtio_9p.o \ 52 pci_virtio_block.o \ 53 pci_virtio_console.o \ 54 pci_virtio_net.o \ 55 pci_virtio_rnd.o \ 56 pci_virtio_viona.o \ 57 pci_xhci.o \ 58 privileges.o \ 59 qemu_fwcfg.o \ 60 qemu_loader.o \ 61 smbiostbl.o \ 62 sockstream.o \ 63 tpm_device.o \ 64 tpm_emul_passthru.o \ 65 tpm_intf_crb.o \ 66 tpm_ppi_qemu.o \ 67 uart_backend.o \ 68 uart_emul.o \ 69 usb_emul.o \ 70 usb_mouse.o \ 71 virtio.o \ 72 vmgenc.o \ 73 bhyve_sol_glue.o 74 75CFLAGS += $(CCVERBOSE) 76CFLAGS += -_gcc=-Wimplicit-function-declaration 77CPPFLAGS = -I../common \ 78 -I$(COMPAT)/bhyve -I$(CONTRIB)/bhyve \ 79 -I$(COMPAT)/bhyve/amd64 -I$(CONTRIB)/bhyve/amd64 \ 80 -I$(CONTRIB)/bhyve/dev/usb/controller \ 81 -I$(CONTRIB)/bhyve/dev/mii \ 82 -I$(SRC)/lib/lib9p/common \ 83 -I$(SRC)/uts/common/io/e1000api \ 84 $(CPPFLAGS.master) \ 85 -I$(SRC)/uts/intel/io/vmm \ 86 -I$(SRC)/uts/common \ 87 -I$(SRC)/uts/intel \ 88 -DWITHOUT_CAPSICUM \ 89 -DOPENSSL_API_COMPAT=0x10100000L 90 91SMOFF += all_func_returns 92rfb.o := SMOFF= 93 94CSTD= $(CSTD_GNU99) 95 96$(PROG) := LDLIBS += \ 97 -l9p \ 98 -lcmdutils \ 99 -lcrypto \ 100 -ldladm \ 101 -ldlpi \ 102 -lidspace \ 103 -lmd \ 104 -lnsl \ 105 -lnvpair \ 106 -lsocket \ 107 -lumem \ 108 -luuid \ 109 -lvmmapi \ 110 -lz 111NATIVE_LIBS += libz.so libcrypto.so 112$(PROG) := LDFLAGS += $(ZASLR) 113 114OBJS = $(BHYVE_OBJS:%=pics/%) 115 116CLEANFILES = $(OBJS) 117CLOBBERFILES = $(PROG) 118 119all: pics $(PROG) 120 121clean: 122 $(RM) $(CLEANFILES) 123 124clobber: clean 125 $(RM) $(CLOBBERFILES) 126 127pics: FRC 128 $(MKDIR) -p $@ 129 130pics/%.o: ../common/%.c 131 $(COMPILE.c) -c -o $@ $< 132 $(POST_PROCESS_O) 133 134pics/%.o: %.c 135 $(COMPILE.c) -c -o $@ $< 136 $(POST_PROCESS_O) 137 138$(PROG): pics $(OBJS) 139 $(LINK.c) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS) 140 $(POST_PROCESS) 141 142FRC: 143