VirtualBox

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

Last change on this file since 98103 was 98103, checked in by vboxsync, 2 years ago

Copyright year updates by scm.

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette