VirtualBox

source: vbox/trunk/src/VBox/Devices/PC/ipxe/Makefile.kmk

Last change on this file was 104027, checked in by vboxsync, 3 months ago

Devices/PC/ipxe: Don't try to build it on linux.arm64, bugref:10391

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.3 KB
Line 
1# $Id: Makefile.kmk 104027 2024-03-24 18:34:26Z vboxsync $
2## @file
3# Sub-makefile for iPXE.
4#
5
6#
7# Copyright (C) 2012-2023 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28SUB_DEPTH = ../../../../..
29include $(KBUILD_PATH)/subheader.kmk
30
31#
32# Globals.
33#
34VBOX_PATH_IPXE_SRC := $(PATH_SUB_CURRENT)
35
36
37#
38# iPxeBiosBin - Library containing the iPXE ROM as a data blob.
39# Will be linked into VBoxDD2.
40#
41LIBRARIES += iPxeBiosBin
42iPxeBiosBin_TEMPLATE = VBoxR3Dll
43iPxeBiosBin_DEFS = IN_VBOXDD2
44iPxeBiosBin_SOURCES = $(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c
45iPxeBiosBin_CLEAN = \
46 $(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c \
47
48if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.amd64 darwin.arm64 linux.arm64 os2.x86 solaris.amd64 win.amd64)
49 $$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c: $(PATH_SUB_CURRENT)/iPxeBiosBin.rom $(VBOX_BIN2C) | $$(dir $$@)
50 $(call MSG_TOOL,bin2c,iPxeBiosBin,$<,$@)
51 $(QUIET)$(VBOX_BIN2C) -min 32 -max 56 -mask 0x1ff -export NetBiosBinary $< $@
52
53else
54 iPxeBiosBin_CLEAN += \
55 $(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.rom \
56 $(iPxeBiosBin_0_OUTDIR)/iPxeBaseBin.rom.bin \
57 $(iPxeBiosBin_0_OUTDIR)/iPxeBaseBin.rom.zinfo
58
59 $$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c: $$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.rom $(VBOX_BIN2C)
60 $(call MSG_TOOL,bin2c,iPxeBiosBin,$<,$@)
61 $(QUIET)$(VBOX_BIN2C) -min 32 -max 56 -export NetBiosBinary $< $@
62
63
64 $$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.rom: \
65 $$(iPxeBaseBin_1_TARGET) \
66 $$(ipxezbin_1_TARGET) \
67 $(VBOX_PATH_IPXE_SRC)/src/util/padimg.pl \
68 $(VBOX_PATH_IPXE_SRC)/src/util/fixrom.pl \
69 | $$(dir $$@)
70 $(call MSG_TOOL,zbin,iPxeBiosBin,$<,$@)
71 $(TOOL_$(VBOX_GCC32_TOOL)_OBJCOPY) -O binary -R .zinfo $< $(iPxeBiosBin_0_OUTDIR)/iPxeBaseBin.rom.bin
72 $(TOOL_$(VBOX_GCC32_TOOL)_OBJCOPY) -O binary -j .zinfo $< $(iPxeBiosBin_0_OUTDIR)/iPxeBaseBin.rom.zinfo
73 $(ipxezbin_1_TARGET) \
74 $(iPxeBiosBin_0_OUTDIR)/iPxeBaseBin.rom.bin \
75 $(iPxeBiosBin_0_OUTDIR)/iPxeBaseBin.rom.zinfo \
76 > $@
77 perl $(VBOX_PATH_IPXE_SRC)/src/util/fixrom.pl $@
78 $(RM) -- \
79 $(iPxeBiosBin_0_OUTDIR)/iPxeBaseBin.rom.bin \
80 $(iPxeBiosBin_0_OUTDIR)/iPxeBaseBin.rom.zinfo
81
82 #
83 # iPxeLinker - Linker tool used to link the ROM binary.
84 #
85 TOOL_iPxeLinker = iPXE LD tool.
86 TOOL_iPxeLinker_LINK_PROGRAM_OUTPUT =
87 TOOL_iPxeLinker_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map
88 TOOL_iPxeLinker_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug
89 TOOL_iPxeLinker_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
90 TOOL_iPxeLinker_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
91 $(filter %.def, $(othersrc))
92 TOOL_iPxeLinker_LINK_PROGRAM_DEPORD =
93 define TOOL_iPxeLinker_LINK_PROGRAM_CMDS
94 $(QUIET)ld $(flags) -o $(out) $(objs)\
95 $(foreach p,$(libpath), -L$(p))\
96 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
97 endef
98
99 #
100 # iPXE - Template used to build the ROM binary.
101 #
102 TEMPLATE_iPxe = iPXE code
103 TEMPLATE_iPxe_TOOL = $(VBOX_GCC32_TOOL)
104 TEMPLATE_iPxe_LDTOOL = iPxeLinker
105 TEMPLATE_iPxe_LDFLAGS = \
106 -N \
107 --no-check-sections \
108 --gc-sections \
109 -T $(VBOX_PATH_IPXE_SRC)/src/arch/x86/scripts/pcbios.lds \
110 -u _rom_start --defsym check__rom_start=_rom_start \
111 -u obj_config --defsym check_obj_config=obj_config \
112 -u _build_id --defsym _build_id=0xaffeaffe \
113 --defsym pci_vendor_id=0x8086 \
114 --defsym pci_device_id=0x100E \
115 -e _rom_start
116ifeq ($(KBUILD_TARGET), freebsd)
117 TEMPLATE_iPxe_LDFLAGS += -m elf_i386_fbsd
118else
119 TEMPLATE_iPxe_LDFLAGS += -m elf_i386
120endif
121 TEMPLATE_iPxe_LNK_DEPS = $(VBOX_PATH_IPXE_SRC)/src/arch/x86/scripts/pcbios.lds
122 TEMPLATE_iPxe_CFLAGS = \
123 -fno-pie \
124 -fcommon \
125 -ffreestanding \
126 -ffunction-sections \
127 -march=i386 \
128 -fomit-frame-pointer \
129 -fstrength-reduce \
130 -falign-jumps=1 \
131 -falign-loops=1 \
132 -Os \
133 -falign-functions=1 \
134 -mpreferred-stack-boundary=2 \
135 -mregparm=3 \
136 -mrtd \
137 -freg-struct-return \
138 -fshort-wchar \
139 -Ui386 \
140 -Ulinux \
141 -include compiler.h \
142 -Wall \
143 -W \
144 -Wformat-nonliteral \
145 $(VBOX_GCC_fno-stack-protector) \
146 $(VBOX_GCC_fno-dwarf2-cfi-asm) \
147 $(VBOX_GCC_Wno-address)
148 TEMPLATE_iPxe_ASFLAGS = \
149 -ffreestanding \
150 -ffunction-sections \
151 -march=i386 \
152 -fomit-frame-pointer \
153 -fstrength-reduce \
154 -falign-jumps=1 \
155 -falign-loops=1 \
156 -falign-functions=1 \
157 -mpreferred-stack-boundary=2 \
158 -mregparm=3 \
159 -mrtd \
160 -freg-struct-return \
161 -fshort-wchar \
162 -Ui386 \
163 -Ulinux \
164 -include compiler.h \
165 -Wall \
166 -W \
167 -Wformat-nonliteral \
168 $(VBOX_GCC_fno-stack-protector) \
169 $(VBOX_GCC_fno-dwarf2-cfi-asm) \
170 $(VBOX_GCC_Wno-address) \
171 -DASSEMBLY \
172 -DASM_TCHAR=@ \
173 -DASM_TCHAR_OPS=@
174 TEMPLATE_iPxe_DEFS = \
175 ARCH=i386 \
176 PLATFORM=pcbios \
177 VERSION_MAJOR=1 \
178 VERSION_MINOR=21 \
179 VERSION_PATCH=1 \
180 ASM_TCHAR=@ \
181 ASM_TCHAR_OPS=@
182 ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
183 TEMPLATE_iPxe_DEFS += \
184 VERSION="1.21.1" \
185 BUILD_NAME="VBox"
186 else
187 TEMPLATE_iPxe_DEFS += \
188 VERSION=\"1.21.1\" \
189 BUILD_NAME=\"VBox\"
190 endif
191
192 #
193 # iPxeBaseBin - The iPXE ROM base binary.
194 #
195 PROGRAMS += iPxeBaseBin
196
197 iPxeBaseBin_TEMPLATE = iPxe
198
199 iPxeBaseBin_INCS = \
200 vbox \
201 src \
202 src/include \
203 src/arch/x86/include \
204 src/arch/i386/include \
205 src/arch/i386/include/pcbios
206
207 iPxeBaseBin_SOURCES = \
208 src/arch/x86/core/basemem_packet.c \
209 src/arch/x86/core/relocate.c \
210 src/arch/x86/interface/pcbios/basemem.c \
211 src/arch/x86/interface/pcbios/bios_console.c \
212 src/arch/x86/interface/pcbios/hidemem.c \
213 src/arch/x86/interface/pcbios/memmap.c \
214 src/arch/x86/hci/commands/pxe_cmd.c \
215 src/arch/x86/image/bootsector.c \
216 src/arch/x86/image/pxe_image.c \
217 src/arch/x86/interface/pcbios/bios_nap.c \
218 src/arch/x86/interface/pcbios/bios_smbios.c \
219 src/arch/x86/interface/pcbios/bios_timer.c \
220 src/arch/x86/interface/pcbios/biosint.c \
221 src/arch/x86/interface/pcbios/int13.c \
222 src/arch/x86/interface/pcbios/memtop_umalloc.c \
223 src/arch/x86/interface/pcbios/pcibios.c \
224 src/arch/x86/interface/pcbios/rtc_time.c \
225 src/arch/x86/interface/pxe/pxe_call.c \
226 src/arch/x86/interface/pxe/pxe_file.c \
227 src/arch/x86/interface/pxe/pxe_loader.c \
228 src/arch/x86/interface/pxe/pxe_preboot.c \
229 src/arch/x86/interface/pxe/pxe_tftp.c \
230 src/arch/x86/interface/pxe/pxe_udp.c \
231 src/arch/x86/interface/pxe/pxe_undi.c \
232 src/arch/x86/core/pci_autoboot.c \
233 src/arch/x86/core/pit8254.c \
234 src/arch/x86/core/x86_string.c \
235 src/config/config.c \
236 src/config/config_ethernet.c \
237 src/config/config_http.c \
238 src/config/config_romprefix.c \
239 src/config/config_route.c \
240 src/config/config_timer.c \
241 src/core/acpi.c \
242 src/core/ansicol.c \
243 src/core/ansiesc.c \
244 src/core/asprintf.c \
245 src/core/base16.c \
246 src/core/base64.c \
247 src/core/basename.c \
248 src/core/bitmap.c \
249 src/core/blockdev.c \
250 src/core/blocktrans.c \
251 src/core/console.c \
252 src/core/ctype.c \
253 src/core/cwuri.c \
254 src/core/device.c \
255 src/core/downloader.c \
256 src/core/edd.c \
257 src/core/exec.c \
258 src/core/errno.c \
259 src/core/getkey.c \
260 src/core/getopt.c \
261 src/core/image.c \
262 src/core/init.c \
263 src/core/interface.c \
264 src/core/iobuf.c \
265 src/core/job.c \
266 src/core/linebuf.c \
267 src/core/list.c \
268 src/core/main.c \
269 src/core/malloc.c \
270 src/core/menu.c \
271 src/core/monojob.c \
272 src/core/nvo.c \
273 src/core/null_sanboot.c \
274 src/core/open.c \
275 src/core/params.c \
276 src/core/parseopt.c \
277 src/core/pending.c \
278 src/core/pool.c \
279 src/core/posix_io.c \
280 src/core/process.c \
281 src/core/quiesce.c \
282 src/core/random.c \
283 src/core/refcnt.c \
284 src/core/resolv.c \
285 src/core/sanboot.c \
286 src/core/settings.c \
287 src/core/string.c \
288 src/core/time.c \
289 src/core/timer.c \
290 src/core/uri.c \
291 src/core/uuid.c \
292 src/core/version.c \
293 src/core/vsprintf.c \
294 src/core/xfer.c \
295 src/core/xferbuf.c \
296 src/crypto/chap.c \
297 src/crypto/md5.c \
298 src/drivers/bitbash/bitbash.c \
299 src/drivers/bitbash/spi_bit.c \
300 src/drivers/bus/pci.c \
301 src/drivers/bus/pciextra.c \
302 src/drivers/bus/pci_settings.c \
303 src/drivers/bus/virtio-ring.c \
304 src/drivers/bus/virtio-pci.c \
305 src/drivers/net/mii.c \
306 src/drivers/net/ne.c \
307 src/drivers/net/intel.c \
308 src/drivers/net/pcnet32.c \
309 src/drivers/net/virtio-net.c \
310 src/drivers/nvs/nvs.c \
311 src/drivers/nvs/spi.c \
312 src/drivers/nvs/threewire.c \
313 src/hci/commands/autoboot_cmd.c \
314 src/hci/commands/config_cmd.c \
315 src/hci/commands/ifmgmt_cmd.c \
316 src/hci/commands/dhcp_cmd.c \
317 src/hci/commands/image_cmd.c \
318 src/hci/editstring.c \
319 src/hci/keymap/keymap_us.c \
320 src/hci/mucurses/ansi_screen.c \
321 src/hci/mucurses/clear.c \
322 src/hci/mucurses/colour.c \
323 src/hci/mucurses/mucurses.c \
324 src/hci/mucurses/print.c \
325 src/hci/mucurses/widgets/editbox.c \
326 src/hci/mucurses/winattrs.c \
327 src/hci/mucurses/wininit.c \
328 src/hci/readline.c \
329 src/hci/jumpscroll.c \
330 src/hci/shell.c \
331 src/hci/strerror.c \
332 src/hci/tui/login_ui.c \
333 src/hci/tui/menu_ui.c \
334 src/hci/tui/settings_ui.c \
335 src/image/segment.c \
336 src/interface/smbios/smbios.c \
337 src/interface/smbios/smbios_settings.c \
338 src/libgcc/implicit.c \
339 src/net/arp.c \
340 src/net/dhcpopts.c \
341 src/net/dhcppkt.c \
342 src/net/eth_slow.c \
343 src/net/ethernet.c \
344 src/net/fakedhcp.c \
345 src/net/fragment.c \
346 src/net/icmp.c \
347 src/net/icmpv4.c \
348 src/net/icmpv6.c \
349 src/net/iobpad.c \
350 src/net/ipv4.c \
351 src/net/neighbour.c \
352 src/net/netdev_settings.c \
353 src/net/netdevice.c \
354 src/net/nullnet.c \
355 src/net/rarp.c \
356 src/net/retry.c \
357 src/net/socket.c \
358 src/net/tcp.c \
359 src/net/tcpip.c \
360 src/net/udp.c \
361 src/net/udp/dhcp.c \
362 src/net/udp/dns.c \
363 src/net/udp/tftp.c \
364 src/usr/autoboot.c \
365 src/usr/dhcpmgmt.c \
366 src/usr/ifmgmt.c \
367 src/usr/imgmgmt.c \
368 src/usr/prompt.c \
369 src/usr/pxemenu.c \
370 src/usr/route.c \
371 src/usr/route_ipv4.c \
372 src/arch/x86/core/x86_tcpip.c \
373 src/arch/x86/core/patch_cf.S \
374 src/arch/i386/core/setjmp.S \
375 src/arch/x86/core/stack.S \
376 src/arch/x86/core/stack16.S \
377 src/arch/x86/interface/pcbios/e820mangler.S \
378 src/arch/x86/interface/pxe/pxe_entry.S \
379 src/arch/x86/prefix/unlzma16.S \
380 src/arch/x86/prefix/romprefix.S \
381 src/arch/x86/prefix/undiloader.S \
382 src/arch/x86/transitions/liba20.S \
383 src/arch/x86/transitions/librm.S \
384 src/arch/x86/transitions/librm_mgmt.c \
385 src/arch/i386/core/gdbidt.S \
386 src/arch/x86/prefix/libprefix.S
387
388 define def_iPxeBaseBinDefs
389 $(file)_DEFS += OBJECT=$(subst -,_,$(basename $(notdir $(file))))
390 endef
391
392 $(foreach file,$(iPxeBaseBin_SOURCES),$(eval $(call def_iPxeBaseBinDefs)))
393
394 #
395 # ipxezbin - Compressor?
396 #
397 BLDPROGS += ipxezbin
398 ipxezbin_TEMPLATE = VBoxBldProg
399 ipxezbin_CFLAGS = -Wno-format -Wno-unused-function -Wno-pointer-arith
400 ipxezbin_SOURCES = src/util/zbin.c
401 ifdef VBOX_WITH_LIBLZMA
402 ipxezbin_INCS = $(SDK_VBoxLibLzma_INCS) # Can't use the proper SDK here as link order matters and liblzma depends on our runtime.
403 ipxezbin_LIBS = \
404 $(SDK_VBoxLibLzma_LIBS) \
405 $(PATH_STAGE_LIB)/RuntimeBldProg$(VBOX_HOSTSUFF_LIB)
406 else
407 ipxezbin_LIBS = lzma # Assume it is installed on the system ready for linking
408 endif
409
410endif
411
412
413include $(FILE_KBUILD_SUB_FOOTER)
414
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use