|
root / base / usr / src / cmd / bhyve / Makefile.com
Makefile.com Makefile 164 lines 3.4 KB
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright 2014 Pluribus Networks Inc.
# Copyright 2020 Joyent, Inc.
# Copyright 2020 Oxide Computer Company
# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.
#

PROG =		bhyve

include $(SRC)/cmd/Makefile.cmd
include $(SRC)/cmd/Makefile.cmd.64
include $(SRC)/cmd/Makefile.ctf

COMMON_OBJS = \
	acpi.o			\
	acpi_device.o		\
	basl.o			\
	bhyvegc.o		\
	bhyverun.o		\
	block_if.o		\
	bootrom.o		\
	config.o		\
	console.o		\
	crc16.o			\
	gdb.o			\
	hexdump.o		\
	ilstr.o			\
	iov.o			\
	mem.o			\
	mevent.o		\
	net_backend_dlpi.o	\
	net_backends.o		\
	net_utils.o		\
	pci_ahci.o		\
	pci_e82545.o		\
	pci_emul.o		\
	pci_hostbridge.o	\
	pci_irq.o		\
	pci_nvme.o		\
	pci_uart.o		\
	pci_virtio_9p.o		\
	pci_virtio_block.o	\
	pci_virtio_console.o	\
	pci_virtio_net.o	\
	pci_virtio_rnd.o	\
	pci_virtio_scsi.o	\
	pci_virtio_scsi_uscsi.o	\
	pci_virtio_viona.o	\
	pci_xhci.o		\
	privileges.o		\
	qemu_fwcfg.o		\
	qemu_loader.o		\
	smbiostbl.o		\
	sockstream.o		\
	tpm_device.o		\
	tpm_emul_passthru.o	\
	tpm_emul_swtpm.o	\
	tpm_intf_crb.o		\
	tpm_ppi_qemu.o		\
	uart_backend.o		\
	uart_emul.o		\
	usb_emul.o		\
	usb_mouse.o		\
	virtio.o		\
	vmgenc.o		\
	bhyve_sol_glue.o

CFLAGS +=	$(CCVERBOSE)
CFLAGS +=	-Wimplicit-function-declaration
CPPFLAGS =	-I../common \
		-I$(COMPAT)/bhyve -I$(CONTRIB)/bhyve \
		-I$(COMPAT)/bhyve/amd64 -I$(CONTRIB)/bhyve/amd64 \
		-I$(CONTRIB)/bhyve/dev/usb/controller \
		-I$(CONTRIB)/bhyve/dev/mii \
		-I$(SRC)/lib/lib9p/common \
		-I$(SRC)/uts/common/io/e1000api \
		$(CPPFLAGS.master) \
		-I$(SRC)/uts/intel/io/vmm \
		-I$(SRC)/uts/common \
		-I$(SRC)/uts/intel \
		-DWITHOUT_CAPSICUM \
		-DOPENSSL_API_COMPAT=10101

SMOFF += all_func_returns
rfb.o : SMOFF=

CSTD=		$(CSTD_GNU99)

$(PROG) : LDLIBS += \
	-l9p \
	-lcmdutils \
	-lcrypto \
	-ldladm \
	-ldlpi \
	-lidspace \
	-lmd \
	-lnsl \
	-lnvpair \
	-lscsi \
	-lsocket \
	-lumem \
	-luuid \
	-lvmmapi \
	-lz
# Hammerhead: Disable PIE - bhyve objects are not compiled with -fPIC
# and GNU ld rejects R_X86_64_32 relocations in PIE executables.
# GCC 14 defaults to -pie; ZASLR only controlled illumos ld's -zaslr flag.
$(PROG) : LDFLAGS += -no-pie
# libscsi.so lives at /usr/lib/scsi/ on Hammerhead (flattened, no $(MACH64)
# subdir). Bhyve links against -lscsi via pci_nvme; the default -L search
# path doesn't include this subdir, so point both the link-time -L and the
# runtime -R there. Upstream illumos uses /usr/lib/scsi/$(MACH64).
$(PROG) : LDFLAGS += -Wl,-L$(ROOT)/usr/lib/scsi
$(PROG) : LDFLAGS += -Wl,-R/usr/lib/scsi

OBJS =		$(BHYVE_OBJS:%=pics/%)

CLEANFILES =	$(OBJS)
CLOBBERFILES =	$(PROG)

all: pics $(PROG)

clean:
	$(RM) $(CLEANFILES)

clobber: clean
	$(RM) $(CLOBBERFILES)

pics: FRC
	$(MKDIR) -p $@

pics/%.o: ../common/%.c
	$(COMPILE.c) $< -o $@
	$(POST_PROCESS_O)

pics/%.o: %.c
	$(COMPILE.c) $< -o $@
	$(POST_PROCESS_O)

pics/%.o: $(SRC)/common/hexdump/%.c
	$(COMPILE.c) $< -o $@
	$(POST_PROCESS_O)

pics/%.o: $(SRC)/common/ilstr/%.c
	$(COMPILE.c) $< -o $@
	$(POST_PROCESS_O)

$(PROG): pics $(OBJS)
	$(LINK.c) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
	$(POST_PROCESS)

FRC: