1 | # $Id: Makefile.kmk 42048 2012-07-09 10:13:46Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the New BIOS ROM.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2012 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 |
|
---|
18 | SUB_DEPTH = ../../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 |
|
---|
22 | ifdef VBOX_WITH_OPEN_WATCOM
|
---|
23 |
|
---|
24 | #
|
---|
25 | # VBoxBios - Template for building the BIOS bits.
|
---|
26 | #
|
---|
27 | TEMPLATE_VBoxBios = PXE ROM
|
---|
28 | TEMPLATE_VBoxBios_TOOL = OPENWATCOM-16
|
---|
29 | TEMPLATE_VBoxBios_LDTOOL = OPENWATCOM-WL
|
---|
30 | TEMPLATE_VBoxBios_ASTOOL = OPENWATCOM-16
|
---|
31 | TEMPLATE_VBoxBios_BLD_TRG = os-agnostic
|
---|
32 | TEMPLATE_VBoxBios_BLD_TRG_ARCH = x86
|
---|
33 | TEMPLATE_VBoxBios_BINSUFF = .rom
|
---|
34 | TEMPLATE_VBoxBios_INCS = .
|
---|
35 | TEMPLATE_VBoxBios_ASFLAGS = -q -wx
|
---|
36 | TEMPLATE_VBoxBios_CFLAGS = -q -3 -wx -zl -zu -s -oas -d1+ -ms
|
---|
37 | TEMPLATE_VBoxBios_DEFS = \
|
---|
38 | VBOX_PC_BIOS \
|
---|
39 | VBOX_LANBOOT_SEG=0xE200 \
|
---|
40 | VBOX_VERSION_STRING=\"$(VBOX_VERSION_STRING)\" \
|
---|
41 | VBOX_WITH_SCSI \
|
---|
42 | VBOX_WITH_AHCI
|
---|
43 | TEMPLATE_VBoxBios_LDFLAGS = system dos \
|
---|
44 | debug all \
|
---|
45 | option quiet, nofarcalls, map, verbose, statics, symfile \
|
---|
46 | output raw offset=0xF0000 order \
|
---|
47 | clname DATA segaddr=0xF000 segment _DATA \
|
---|
48 | clname CODE \
|
---|
49 | segment _TEXT segaddr=0xF000 offset=0x1600 \
|
---|
50 | segment BIOS32 segaddr=0xF000 offset=0xDE00 \
|
---|
51 | segment BIOSSEG segaddr=0xF000 offset=0xE000 \
|
---|
52 | disable 1014, 1023, 2120
|
---|
53 | TEMPLATE_VBoxBios_LNK_DEPS = $(VBOX_BIOSSUMS)
|
---|
54 | TEMPLATE_VBoxBios_POST_CMDS = \
|
---|
55 | $(QUIET)$(MV_EXT) -f $(out) $(out).tmp \
|
---|
56 | && $(VBOX_BIOSSUMS) $(out).tmp $(out) \
|
---|
57 | && $(RM_EXT) -f $(out).tmp
|
---|
58 |
|
---|
59 |
|
---|
60 | #
|
---|
61 | # VBoxPcBios - The PC BIOS.
|
---|
62 | #
|
---|
63 | MISCBINS += VBoxPcBios
|
---|
64 | VBoxPcBios_TEMPLATE = VBoxBios
|
---|
65 | VBoxPcBios_SOURCES = \
|
---|
66 | bios.c \
|
---|
67 | print.c \
|
---|
68 | ata.c \
|
---|
69 | floppy.c \
|
---|
70 | eltorito.c \
|
---|
71 | boot.c \
|
---|
72 | keyboard.c \
|
---|
73 | disk.c \
|
---|
74 | serial.c \
|
---|
75 | system.c \
|
---|
76 | timepci.c \
|
---|
77 | ps2mouse.c \
|
---|
78 | parallel.c \
|
---|
79 | logo.c \
|
---|
80 | scsi.c \
|
---|
81 | ahci.c \
|
---|
82 | pciutil.c \
|
---|
83 | vds.c \
|
---|
84 | support.asm \
|
---|
85 | pcibio32.asm \
|
---|
86 | orgs.asm
|
---|
87 |
|
---|
88 | #
|
---|
89 | # Updates the alternative source file.
|
---|
90 | #
|
---|
91 | update-bios-source | $(PATH_SUB_CURRENT)/VBoxBiosAlternative.asm $(PATH_SUB_CURRENT)/VBoxBiosAlternative.md5sum: \
|
---|
92 | $$(VBoxPcBios_1_TARGET) \
|
---|
93 | $$(MakeDebianBiosAssembly_1_TARGET) \
|
---|
94 | $(VBOX_VBOXCMP)
|
---|
95 | if1of ($(KBUILD_TYPE), release)
|
---|
96 | $(MakeDebianBiosAssembly_1_TARGET) \
|
---|
97 | --bios-image $< \
|
---|
98 | --bios-map $(basename $<).map \
|
---|
99 | --bios-sym $(basename $<).sym \
|
---|
100 | --output $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.asm
|
---|
101 | $(QUIET)yasm -f bin -o $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.bin $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.asm
|
---|
102 | $(VBOX_VBOXCMP) $< $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.bin
|
---|
103 | $(CP) --changed -- $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.asm $(PATH_ROOT)/src/VBox/Devices/PC/BIOS-new/VBoxBiosAlternative.asm
|
---|
104 | $(REDIRECT) -C $(dir $(VBoxPcBios_1_TARGET)) -- \
|
---|
105 | $(MD5SUM_EXT) -bo $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.md5sum $(notdir $(VBoxPcBios_1_TARGET))
|
---|
106 | $(CP) --changed -- $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.md5sum $(PATH_ROOT)/src/VBox/Devices/PC/BIOS-new/VBoxBiosAlternative.md5sum
|
---|
107 | $(RM) -f -- $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.asm $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.bin $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.md5sum
|
---|
108 | else
|
---|
109 | $(QUIET)$(ECHO) "Fatal error: Can only update VBoxBiosAlternative.asm/md5sum with a release build."
|
---|
110 | $(QUIET)exit 1
|
---|
111 | endif
|
---|
112 |
|
---|
113 | endif # VBOX_WITH_OPEN_WATCOM
|
---|
114 |
|
---|
115 |
|
---|
116 | #
|
---|
117 | # The library containing the PC BIOS image.
|
---|
118 | #
|
---|
119 | LIBRARIES += PcBiosBin
|
---|
120 | PcBiosBin_TEMPLATE = VBOXR3
|
---|
121 | PcBiosBin_DEFS = IN_VBOXDD2
|
---|
122 | PcBiosBin_SOURCES = $(PcBiosBin_0_OUTDIR)/PcBiosBin.c
|
---|
123 | PcBiosBin_CLEAN = $(PcBiosBin_0_OUTDIR)/PcBiosBin.c
|
---|
124 |
|
---|
125 | ifdef VBOX_WITH_OPEN_WATCOM
|
---|
126 | $$(PcBiosBin_0_OUTDIR)/PcBiosBin.c: $$(VBoxPcBios_1_TARGET) $(VBOX_BIN2C) | $$(dir $$@)
|
---|
127 | $(call MSG_TOOL,bin2c,PcBiosBin,$<,$@)
|
---|
128 | $(QUIET)$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary $< $@
|
---|
129 | else
|
---|
130 | PcBiosBin_CLEAN += $(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom
|
---|
131 |
|
---|
132 | $$(PcBiosBin_0_OUTDIR)/PcBiosBin.c + $$(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom: \
|
---|
133 | $(PATH_SUB_CURRENT)/VBoxBiosAlternative.asm \
|
---|
134 | $(PATH_SUB_CURRENT)/VBoxBiosAlternative.md5sum \
|
---|
135 | $(VBOX_BIN2C) | $$(dir $$@)
|
---|
136 | $(call MSG_TOOL,bin2c,PcBiosBin,$<,$@)
|
---|
137 | $(QUIET)yasm -f bin -o $(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom $<
|
---|
138 | $(QUIET)$(REDIRECT) -C $(PcBiosBin_0_OUTDIR) -- \
|
---|
139 | $(MD5SUM_EXT) -c $(basename $<).md5sum
|
---|
140 | $(QUIET)$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary $(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom $@
|
---|
141 | $(QUIET)$(RM) -f -- $$(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom
|
---|
142 | endif
|
---|
143 |
|
---|
144 |
|
---|
145 | #
|
---|
146 | # MakeDebianBiosAssembly - For distros without OpenWatcom.
|
---|
147 | #
|
---|
148 | ifdef TODO_LATER
|
---|
149 | BLDPROGS += MakeDebianBiosAssembly
|
---|
150 | MakeDebianBiosAssembly_TEMPLATE = VBoxAdvBldProg
|
---|
151 | MakeDebianBiosAssembly_DEFS = IN_DIS
|
---|
152 | MakeDebianBiosAssembly_SOURCES = MakeDebianBiosAssembly.cpp
|
---|
153 | MakeDebianBiosAssembly_LIBS = \
|
---|
154 | $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB)
|
---|
155 | ifdef IPRT_WITH_KSTUFF
|
---|
156 | MakeDebianBiosAssembly_LIBS += \
|
---|
157 | $(PATH_STAGE_LIB)/VBox-kStuff$(VBOX_SUFF_LIB)
|
---|
158 | endif
|
---|
159 | else
|
---|
160 | PROGRAMS += MakeDebianBiosAssembly ## TODO this is build program, really. later.
|
---|
161 | MakeDebianBiosAssembly_TEMPLATE = VBOXR3EXE
|
---|
162 | MakeDebianBiosAssembly_DEFS = IN_DIS
|
---|
163 | MakeDebianBiosAssembly_SOURCES = MakeDebianBiosAssembly.cpp
|
---|
164 | MakeDebianBiosAssembly_LIBS = \
|
---|
165 | $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB) \
|
---|
166 | $(LIB_RUNTIME)
|
---|
167 | endif
|
---|
168 |
|
---|
169 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
170 |
|
---|