xref: /illumos-gate/usr/src/cmd/bhyve/Makefile.com (revision 204eecd741aeb173ccbd0761993ea21a279d1e00)
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_intf_crb.o		\
67	tpm_ppi_qemu.o		\
68	uart_backend.o		\
69	uart_emul.o		\
70	usb_emul.o		\
71	usb_mouse.o		\
72	virtio.o		\
73	vmgenc.o		\
74	bhyve_sol_glue.o
75
76CFLAGS +=	$(CCVERBOSE)
77CFLAGS +=	-_gcc=-Wimplicit-function-declaration
78CPPFLAGS =	-I../common \
79		-I$(COMPAT)/bhyve -I$(CONTRIB)/bhyve \
80		-I$(COMPAT)/bhyve/amd64 -I$(CONTRIB)/bhyve/amd64 \
81		-I$(CONTRIB)/bhyve/dev/usb/controller \
82		-I$(CONTRIB)/bhyve/dev/mii \
83		-I$(SRC)/lib/lib9p/common \
84		-I$(SRC)/uts/common/io/e1000api \
85		$(CPPFLAGS.master) \
86		-I$(SRC)/uts/intel/io/vmm \
87		-I$(SRC)/uts/common \
88		-I$(SRC)/uts/intel \
89		-DWITHOUT_CAPSICUM \
90		-DOPENSSL_API_COMPAT=0x10100000L
91
92SMOFF += all_func_returns
93rfb.o := SMOFF=
94
95CSTD=		$(CSTD_GNU99)
96
97$(PROG) := LDLIBS += \
98	-l9p \
99	-lcmdutils \
100	-lcrypto \
101	-ldladm \
102	-ldlpi \
103	-lidspace \
104	-lmd \
105	-lnsl \
106	-lnvpair \
107	-lsocket \
108	-lumem \
109	-luuid \
110	-lvmmapi \
111	-lz
112NATIVE_LIBS += libz.so libcrypto.so
113$(PROG) := LDFLAGS += $(ZASLR)
114
115OBJS =		$(BHYVE_OBJS:%=pics/%)
116
117CLEANFILES =	$(OBJS)
118CLOBBERFILES =	$(PROG)
119
120all: pics $(PROG)
121
122clean:
123	$(RM) $(CLEANFILES)
124
125clobber: clean
126	$(RM) $(CLOBBERFILES)
127
128pics: FRC
129	$(MKDIR) -p $@
130
131pics/%.o: ../common/%.c
132	$(COMPILE.c) $< -o $@
133	$(POST_PROCESS_O)
134
135pics/%.o: %.c
136	$(COMPILE.c) $< -o $@
137	$(POST_PROCESS_O)
138
139pics/%.o: $(SRC)/common/hexdump/%.c
140	$(COMPILE.c) $< -o $@
141	$(POST_PROCESS_O)
142
143pics/%.o: $(SRC)/common/ilstr/%.c
144	$(COMPILE.c) $< -o $@
145	$(POST_PROCESS_O)
146
147$(PROG): pics $(OBJS)
148	$(LINK.c) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
149	$(POST_PROCESS)
150
151FRC:
152