xref: /illumos-gate/usr/src/cmd/bhyve/Makefile.com (revision d852f8ff587f58ad4c891927373169c1cec33ecf)
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	ilstr.o			\
39	iov.o			\
40	mem.o			\
41	mevent.o		\
42	net_backend_dlpi.o	\
43	net_backends.o		\
44	net_utils.o		\
45	pci_ahci.o		\
46	pci_e82545.o		\
47	pci_emul.o		\
48	pci_hostbridge.o	\
49	pci_irq.o		\
50	pci_nvme.o		\
51	pci_uart.o		\
52	pci_virtio_9p.o		\
53	pci_virtio_block.o	\
54	pci_virtio_console.o	\
55	pci_virtio_net.o	\
56	pci_virtio_rnd.o	\
57	pci_virtio_viona.o	\
58	pci_xhci.o		\
59	privileges.o		\
60	qemu_fwcfg.o		\
61	qemu_loader.o		\
62	smbiostbl.o		\
63	sockstream.o		\
64	tpm_device.o		\
65	tpm_emul_passthru.o	\
66	tpm_emul_swtpm.o	\
67	tpm_intf_crb.o		\
68	tpm_ppi_qemu.o		\
69	uart_backend.o		\
70	uart_emul.o		\
71	usb_emul.o		\
72	usb_mouse.o		\
73	virtio.o		\
74	vmgenc.o		\
75	bhyve_sol_glue.o
76
77CFLAGS +=	$(CCVERBOSE)
78CFLAGS +=	-_gcc=-Wimplicit-function-declaration
79CPPFLAGS =	-I../common \
80		-I$(COMPAT)/bhyve -I$(CONTRIB)/bhyve \
81		-I$(COMPAT)/bhyve/amd64 -I$(CONTRIB)/bhyve/amd64 \
82		-I$(CONTRIB)/bhyve/dev/usb/controller \
83		-I$(CONTRIB)/bhyve/dev/mii \
84		-I$(SRC)/lib/lib9p/common \
85		-I$(SRC)/uts/common/io/e1000api \
86		$(CPPFLAGS.master) \
87		-I$(SRC)/uts/intel/io/vmm \
88		-I$(SRC)/uts/common \
89		-I$(SRC)/uts/intel \
90		-DWITHOUT_CAPSICUM \
91		-DOPENSSL_API_COMPAT=10101
92
93SMOFF += all_func_returns
94rfb.o := SMOFF=
95
96CSTD=		$(CSTD_GNU99)
97
98$(PROG) := LDLIBS += \
99	-l9p \
100	-lcmdutils \
101	-lcrypto \
102	-ldladm \
103	-ldlpi \
104	-lidspace \
105	-lmd \
106	-lnsl \
107	-lnvpair \
108	-lsocket \
109	-lumem \
110	-luuid \
111	-lvmmapi \
112	-lz
113NATIVE_LIBS += libz.so libcrypto.so
114$(PROG) := LDFLAGS += $(ZASLR)
115
116OBJS =		$(BHYVE_OBJS:%=pics/%)
117
118CLEANFILES =	$(OBJS)
119CLOBBERFILES =	$(PROG)
120
121all: pics $(PROG)
122
123clean:
124	$(RM) $(CLEANFILES)
125
126clobber: clean
127	$(RM) $(CLOBBERFILES)
128
129pics: FRC
130	$(MKDIR) -p $@
131
132pics/%.o: ../common/%.c
133	$(COMPILE.c) $< -o $@
134	$(POST_PROCESS_O)
135
136pics/%.o: %.c
137	$(COMPILE.c) $< -o $@
138	$(POST_PROCESS_O)
139
140pics/%.o: $(SRC)/common/hexdump/%.c
141	$(COMPILE.c) $< -o $@
142	$(POST_PROCESS_O)
143
144pics/%.o: $(SRC)/common/ilstr/%.c
145	$(COMPILE.c) $< -o $@
146	$(POST_PROCESS_O)
147
148$(PROG): pics $(OBJS)
149	$(LINK.c) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
150	$(POST_PROCESS)
151
152FRC:
153