VirtualBox

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

Last change on this file since 13002 was 12589, checked in by vboxsync, 16 years ago

fix OSE

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1# $Id: Makefile.kmk 12589 2008-09-19 06:59:57Z vboxsync $
2## @file
3# PC BIOS Sub-Makefile.
4#
5
6#
7# Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18# Clara, CA 95054 USA or visit http://www.sun.com if you need
19# additional information or have any questions.
20#
21
22SUB_DEPTH = ../../../../..
23include $(KBUILD_PATH)/subheader.kmk
24
25#
26# Globals
27#
28VBOX_PATH_DEVICES_SRC ?= $(PATH_ROOT)/src/VBox/Devices
29
30#
31# Build program for calculating the PC BIOS checksums.
32#
33BLDPROGS += pcbiossums
34pcbiossums_TEMPLATE = VBOXBLDPROG
35pcbiossums_SOURCES = biossums.c
36
37
38#
39# The library containing the PC BIOS image.
40#
41LIBRARIES += PcBiosBin
42PcBiosBin_TEMPLATE = VBOXR3
43PcBiosBin_DEFS = IN_VBOXDD2
44PcBiosBin_INCS = $(VBOX_PATH_DEVICES_SRC)
45PcBiosBin_SOURCES = $(PATH_PcBiosBin)/PcBiosBin.c
46PcBiosBin_DEPS = $(PATH_PcBiosBin)/pcbios-syms.h
47PcBiosBin_CLEAN = \
48 $(PATH_PcBiosBin)/_rombios_.c \
49 $(PATH_PcBiosBin)/rombios0.s \
50 $(PATH_PcBiosBin)/rombios1.s \
51 $(PATH_PcBiosBin)/pcbios.lst \
52 $(PATH_PcBiosBin)/pcbios.tmp \
53 $(PATH_PcBiosBin)/pcbios.bin \
54 $(PATH_PcBiosBin)/PcBiosBin.c \
55 $(PATH_PcBiosBin)/pcbios-syms.h
56
57#
58# Rule for making the bios.
59#
60$$(PATH_PcBiosBin)/PcBiosBin.c: $$(PATH_PcBiosBin)/pcbios.bin $(VBOX_BIN2C)
61 $(call MSG_TOOL,bin2c,PcBiosBin,$<,$@)
62 $(QUIET)$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary $< $@
63
64#
65# Six steps to pcbios.bin and pcbios-syms.h
66#
67
68# 1. precompile rombios.c
69$$(PATH_PcBiosBin)/_rombios_.c: $(PATH_SUB_CURRENT)/rombios.c $(PATH_SUB_CURRENT)/logo.c $(PATH_SUB_CURRENT)/apmbios.S $(if $(VBOX_WITH_SCSI),$(PATH_SUB_CURRENT)/scsi.c) \
70 $(PATH_SUB_CURRENT)/../DevPcBios.h $(PATH_ROOT)/include/VBox/bioslogo.h | $$(dir $$@)
71 $(call MSG_TOOL,cpp,PcBiosBin,$<,$@)
72 $(QUIET)$(TOOL_$(VBOX_GCC_TOOL)_CC) -E \
73 -I$(PATH_PcBiosBin) -I$(VBOX_PATH_DEVICES_SRC)/PC -I$(PATH_ROOT)/include -I$(PATH_OUT) \
74 -DBX_SMP_PROCESSORS=1 -DVBOX -DVBOX_PC_BIOS $(addprefix -D,$(DEFS) $(DEFS.$(KBUILD_TYPE))) \
75 $(if $(VBOX_WITH_SCSI),-DVBOX_WITH_SCSI) \
76 -P -o $@ $<
77
78# 2. compile to intermediate asm file.
79# BCC tempfile clashes, order the BCC jobs to make sure they don't interfere with one another.
80$$(PATH_PcBiosBin)/rombios0.s: $$(PATH_PcBiosBin)/_rombios_.c $(VBOX_VERSION_STAMP) | $(VBOX_BCC_JOBS)
81 $(call MSG_COMPILE,PcBiosBin,$<,$@,C)
82 $(QUIET)$(VBOX_BCC) -o $@ -C-c -D__i86__ -0 -S $<
83VBOX_BCC_JOBS += $(PATH_PcBiosBin)/rombios0.s
84
85# 3. post process intermediate asm file.
86$$(PATH_PcBiosBin)/rombios1.s: $$(PATH_PcBiosBin)/rombios0.s
87 $(call MSG_TOOL,Adjusting BCC Assembly,PcBiosBin,$<,$@)
88 $(QUIET)$(SED) -e 's/^\.text//' -e 's/^\.data//' --output $@ $^
89
90# 4. assemble the intermediate asm file. (also creates a listing rombios.lst)
91$$(PATH_PcBiosBin)/pcbios.tmp + $$(PATH_PcBiosBin)/pcbios.lst: $$(PATH_PcBiosBin)/rombios1.s
92 $(call MSG_COMPILE,PcBiosBin,$<,$@,AS)
93 $(QUIET)$(REDIRECT) -ri $^ -- $(VBOX_AS86) -b $(PATH_PcBiosBin)/pcbios.tmp -u- -w- -g -0 -j -O -l $(PATH_PcBiosBin)/pcbios.lst
94
95# 5. calculate checksums for the final BIOS image.
96$$(PATH_PcBiosBin)/pcbios.bin: $$(PATH_PcBiosBin)/pcbios.tmp $$(TARGET_pcbiossums)
97 $(call MSG_TOOL,pcbiossums,PcBiosBin,$<,$@)
98 $(QUIET)$(CP) -f $(PATH_PcBiosBin)/pcbios.tmp $(PATH_PcBiosBin)/pcbios.bin
99 $(QUIET)$(TARGET_pcbiossums) $(PATH_PcBiosBin)/pcbios.bin
100
101# 6. create the symbol table.
102$$(PATH_PcBiosBin)/pcbios-syms.h: $$(PATH_PcBiosBin)/pcbios.lst $(MAKEFILE_CURRENT)
103 $(call MSG_GENERATE,PcBiosBin,$<,$@)
104 $(QUIET)$(SED) \
105 -e '/^[0-9][0-9][0-9][0-9][0-9] 000[0-9A-F]* [[:space:]]*[a-zA-Z0-9_]*:/!d' \
106 -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"),/' \
107 --output $@ \
108 $(PATH_PcBiosBin)/pcbios.lst
109
110
111include $(KBUILD_PATH)/subfooter.kmk
112
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