VirtualBox

source: vbox/trunk/src/VBox/Devices/PC/BIOS/Makefile.kmk@ 4612

Last change on this file since 4612 was 4071, checked in by vboxsync, 17 years ago

Biggest check-in ever. New source code headers for all (C) innotek files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.0 KB
Line 
1# $Id: Makefile.kmk 4071 2007-08-07 17:07:59Z vboxsync $
2## @file
3# PC BIOS Sub-Makefile.
4#
5
6#
7# Copyright (C) 2006-2007 innotek GmbH
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License as published by the Free Software Foundation,
13# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14# distribution. VirtualBox OSE is distributed in the hope that it will
15# be useful, but WITHOUT ANY WARRANTY of any kind.
16
17DEPTH ?= ../../../../../
18SUB_DEPTH = ../..
19include $(PATH_KBUILD)/subheader.kmk
20
21VBOX_PATH_DEVICES_SRC = $(PATH_SUB_ROOT)
22
23#
24# Build program for calculating the PC BIOS checksums.
25#
26BLDPROGS += pcbiossums
27pcbiossums_TEMPLATE = VBOXBLDPROG
28pcbiossums_SOURCES = biossums.c
29
30
31#
32# The library containing the PC BIOS image.
33#
34LIBRARIES += PcBiosBin
35PcBiosBin_TEMPLATE = VBOXR3
36PcBiosBin_DEFS = IN_VBOXDD2
37PcBiosBin_INCS = $(VBOX_PATH_DEVICES_SRC)
38PcBiosBin_SOURCES = $(PATH_TARGET)/PcBiosBin.c
39$(PATH_TARGET)/PcBiosBin.c_DEPS = $(PATH_TARGET)/pcbios-syms.h
40PcBiosBin_CLEAN = \
41 $(PATH_TARGET)/_rombios_.c \
42 $(PATH_TARGET)/rombios0.s \
43 $(PATH_TARGET)/rombios1.s \
44 $(PATH_TARGET)/pcbios.lst \
45 $(PATH_TARGET)/pcbios.tmp \
46 $(PATH_TARGET)/pcbios.bin \
47 $(PATH_TARGET)/PcBiosBin.c \
48 $(PATH_TARGET)/PcDefBiosLogo.c \
49 $(PATH_TARGET)/pcbios-syms.h
50
51#
52# Rule for making the bios.
53#
54$(PATH_TARGET)/PcBiosBin.c: $(PATH_TARGET)/pcbios.bin $(VBOX_BIN2C)
55 $(call MSG_TOOL,bin2c,PcBiosBin,$<,$@)
56 $(QUIET)$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary $< $@
57
58#
59# Six steps to pcbios.bin and pcbios-syms.h
60#
61
62# 1. precompile rombios.c
63$(PATH_TARGET)/_rombios_.c: $(PATH_SUB_CURRENT)/rombios.c $(PATH_SUB_CURRENT)/logo.c $(PATH_SUB_CURRENT)/apmbios.S | $(call DIRDEP,$(TARGET_PATH))
64 $(call MSG_TOOL,cpp,PcBiosBin,$<,$@)
65 $(QUIET)$(TOOL_$(VBOX_GCC_TOOL)_CC) -E -I$(PATH_TARGET) -I$(VBOX_PATH_DEVICES_SRC)/PC -I$(PATH_ROOT)/include -I$(PATH_OUT) -DBX_SMP_PROCESSORS=1 -DVBOX $(addprefix -D,$(DEFS) $(DEFS.$(BUILD_TYPE))) -P $< > $@
66
67# 2. compile to intermediate asm file - tempfile clashes, make sure it's built alone.
68.NOTPARALLEL: $(PATH_TARGET)/rombios0.s
69$(PATH_TARGET)/rombios0.s: $(PATH_TARGET)/_rombios_.c
70 $(call MSG_COMPILE,PcBiosBin,$<,$@,C)
71 $(QUIET)$(VBOX_BCC) -o $@ -C-c -D__i86__ -0 -S $^
72
73# 3. post process intermediate asm file.
74$(PATH_TARGET)/rombios1.s: $(PATH_TARGET)/rombios0.s
75 $(call MSG_TOOL,Adjusting BCC Assembly,PcBiosBin,$<,$@)
76 $(QUIET)$(SED) -e 's/^\.text//' -e 's/^\.data//' $^ > $@
77
78# 4. assemble the intermediate asm file. (also creates a listing rombios.lst)
79$(PATH_TARGET)/pcbios.tmp $(PATH_TARGET)/pcbios.lst: $(PATH_TARGET)/rombios1.s
80 $(call MSG_COMPILE,PcBiosBin,$<,$@,AS)
81 $(QUIET)$(VBOX_AS86) -b $(PATH_TARGET)/pcbios.tmp -u- -w- -g -0 -j -O -l $(PATH_TARGET)/pcbios.lst - < $^
82
83# 5. calculate checksums for the final BIOS image.
84$(PATH_TARGET)/pcbios.bin: $(PATH_TARGET)/pcbios.tmp $$(TARGET_pcbiossums)
85 $(call MSG_TOOL,pcbiossums,PcBiosBin,$<,$@)
86 $(QUIET)$(CP) -f $(PATH_TARGET)/pcbios.tmp $(PATH_TARGET)/pcbios.bin
87 $(QUIET)$(TARGET_pcbiossums) $(PATH_TARGET)/pcbios.bin
88
89# 6. create the symbol table.
90$(PATH_TARGET)/pcbios-syms.h: $(PATH_TARGET)/pcbios.lst $(MAKEFILE_CURRENT)
91 $(call MSG_GENERATE,PcBiosBin,$<,$@)
92 $(QUIET)$(SED) \
93 -e '/^[0-9][0-9][0-9][0-9][0-9] 000[0-9A-F]* [[:space:]]*[a-zA-Z0-9_]*:/!d' \
94 -e 's/^[0-9][0-9][0-9][0-9][0-9] \(000[0-9A-F]*\) [[:space:]]*\([a-zA-Z0-9_]*\):.*$$/ DEFSYM(0x\1, "\2"),/' \
95 $(PATH_TARGET)/pcbios.lst > $@
96
97
98#
99# The PC BIOS Logo.
100#
101LIBRARIES += PcDefBiosLogo
102PcDefBiosLogo_TEMPLATE = VBOXR3
103PcDefBiosLogo_INCS = $(VBOX_PATH_DEVICES_SRC)
104PcDefBiosLogo_SOURCES = $(PATH_TARGET)/PcDefBiosLogo.c
105
106#
107# Rule for making the bios logo.
108#
109$(PATH_TARGET)/PcDefBiosLogo.c: $(PATH_SUB_CURRENT)/innotek_logo.bmp $(VBOX_BIN2C)
110 $(call MSG_TOOL,bin2c,PcBiosBin,$<,$@)
111 $(QUIET)$(VBOX_BIN2C) -max 64 PcDefBiosLogo $< $@
112
113
114include $(PATH_KBUILD)/subfooter.kmk
115
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