VirtualBox

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

Last change on this file since 40754 was 36877, checked in by vboxsync, 13 years ago

BIOS: AHCI driver skeleton

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1# $Id: Makefile.kmk 36877 2011-04-28 19:38:13Z vboxsync $
2## @file
3# PC BIOS Sub-Makefile.
4#
5
6#
7# Copyright (C) 2006-2007 Oracle Corporation
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
18SUB_DEPTH = ../../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21#
22# Globals
23#
24VBOX_PATH_DEVICES_SRC ?= $(PATH_ROOT)/src/VBox/Devices
25
26#
27# The library containing the PC BIOS image.
28#
29LIBRARIES += PcBiosBin
30PcBiosBin_TEMPLATE = VBOXR3
31PcBiosBin_DEFS = IN_VBOXDD2
32PcBiosBin_INCS = $(VBOX_PATH_DEVICES_SRC)
33PcBiosBin_SOURCES = $(PcBiosBin_0_OUTDIR)/PcBiosBin.c
34PcBiosBin_DEPS = $(PcBiosBin_0_OUTDIR)/pcbios-syms.h
35PcBiosBin_CLEAN = \
36 $(PcBiosBin_0_OUTDIR)/_rombios_.c \
37 $(PcBiosBin_0_OUTDIR)/rombios0.s \
38 $(PcBiosBin_0_OUTDIR)/rombios1.s \
39 $(PcBiosBin_0_OUTDIR)/pcbios.lst \
40 $(PcBiosBin_0_OUTDIR)/pcbios.tmp \
41 $(PcBiosBin_0_OUTDIR)/pcbios.bin \
42 $(PcBiosBin_0_OUTDIR)/PcBiosBin.c \
43 $(PcBiosBin_0_OUTDIR)/pcbios-syms.h
44
45#
46# Rule for making the bios.
47#
48$$(PcBiosBin_0_OUTDIR)/PcBiosBin.c: $$(PcBiosBin_0_OUTDIR)/pcbios.bin $(VBOX_BIN2C)
49 $(call MSG_TOOL,bin2c,PcBiosBin,$<,$@)
50 $(QUIET)$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary $< $@
51
52#
53# Six steps to pcbios.bin and pcbios-syms.h
54#
55
56# 1. precompile rombios.c
57$$(PcBiosBin_0_OUTDIR)/_rombios_.c: $(PATH_SUB_CURRENT)/rombios.c $(PATH_SUB_CURRENT)/logo.c \
58 $(PATH_SUB_CURRENT)/apmbios.S $(if $(VBOX_WITH_SCSI),$(PATH_SUB_CURRENT)/scsi.c) \
59 $(PATH_SUB_CURRENT)/../DevPcBios.h $(PATH_ROOT)/include/VBox/bioslogo.h \
60 $(if $(VBOX_WITH_BIOS_AHCI),$(PATH_SUB_CURRENT)/ahci.c) \
61 $(VBOX_VERSION_STAMP) | $$(dir $$@)
62 $(call MSG_TOOL,cpp,PcBiosBin,$<,$@)
63 $(QUIET)$(TOOL_$(VBOX_GCC_TOOL)_CC) -E \
64 -I$(PcBiosBin_0_OUTDIR) -I$(VBOX_PATH_DEVICES_SRC)/PC -I$(PATH_ROOT)/include -I$(PATH_OUT) \
65 -DBX_SMP_PROCESSORS=1 -DVBOX -DVBOX_PC_BIOS $(addprefix -D,$(DEFS) $(DEFS.$(KBUILD_TYPE))) \
66 $(if $(VBOX_WITH_SCSI),-DVBOX_WITH_SCSI) $(if $(VBOX_WITH_BIOS_AHCI),-DVBOX_WITH_BIOS_AHCI) \
67 -P -o $@ $<
68
69# 2. compile to intermediate asm file.
70# BCC tempfile clashes, order the BCC jobs to make sure they don't interfere with one another.
71$$(PcBiosBin_0_OUTDIR)/rombios0.s: $$(PcBiosBin_0_OUTDIR)/_rombios_.c | $(VBOX_BCC_JOBS)
72 $(call MSG_COMPILE,PcBiosBin,$<,$@,C)
73 $(QUIET)$(VBOX_BCC) -o $@ -C-c -D__i86__ -0 -S $<
74VBOX_BCC_JOBS += $(PcBiosBin_0_OUTDIR)/rombios0.s
75
76# 3. post process intermediate asm file.
77$$(PcBiosBin_0_OUTDIR)/rombios1.s: $$(PcBiosBin_0_OUTDIR)/rombios0.s
78 $(call MSG_TOOL,Adjusting BCC Assembly,PcBiosBin,$<,$@)
79 $(QUIET)$(SED) -e 's/^\.text//' -e 's/^\.data//' --output $@ $^
80
81# 4. assemble the intermediate asm file. (also creates a listing rombios.lst)
82$$(PcBiosBin_0_OUTDIR)/pcbios.tmp + $$(PcBiosBin_0_OUTDIR)/pcbios.lst: $$(PcBiosBin_0_OUTDIR)/rombios1.s
83 $(call MSG_COMPILE,PcBiosBin,$<,$@,AS)
84 $(QUIET)$(REDIRECT) -ri $^ -- $(VBOX_AS86) -b $(PcBiosBin_0_OUTDIR)/pcbios.tmp -u- -w- -g -0 -j -O -l $(PcBiosBin_0_OUTDIR)/pcbios.lst
85
86# 5. calculate checksums for the final BIOS image.
87$$(PcBiosBin_0_OUTDIR)/pcbios.bin: $$(PcBiosBin_0_OUTDIR)/pcbios.tmp $$(VBOX_BIOSSUMS)
88 $(call MSG_TOOL,biossums,PcBiosBin,$<,$@)
89 $(QUIET)$(VBOX_BIOSSUMS) $< $@
90
91# 6. create the symbol table.
92$$(PcBiosBin_0_OUTDIR)/pcbios-syms.h: $$(PcBiosBin_0_OUTDIR)/pcbios.lst $(MAKEFILE_CURRENT)
93 $(call MSG_GENERATE,PcBiosBin,$<,$@)
94 $(QUIET)$(SED) \
95 -e '/^[0-9][0-9][0-9][0-9][0-9] 000[0-9A-F]* [[:space:]]*[a-zA-Z0-9_]*:/!d' \
96 -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"),/' \
97 --output $@ \
98 $(PcBiosBin_0_OUTDIR)/pcbios.lst
99
100
101include $(KBUILD_PATH)/subfooter.kmk
102
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use