1 | # $Id: Makefile.kmk 13155 2008-10-10 08:07:41Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # VGA 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 |
|
---|
22 | SUB_DEPTH = ../../../../..
|
---|
23 | include $(KBUILD_PATH)/subheader.kmk
|
---|
24 |
|
---|
25 | #
|
---|
26 | # Globals
|
---|
27 | #
|
---|
28 | VBOX_PATH_DEVICES_SRC ?= $(PATH_ROOT)/src/VBox/Devices
|
---|
29 |
|
---|
30 | #
|
---|
31 | # Build program for calculating the VGA BIOS checksums.
|
---|
32 | #
|
---|
33 | BLDPROGS += vbetables-gen
|
---|
34 | vbetables-gen_TEMPLATE = VBOXBLDPROG
|
---|
35 | vbetables-gen_SOURCES = vbetables-gen.c
|
---|
36 |
|
---|
37 | #
|
---|
38 | # The library containing the VGA BIOS image.
|
---|
39 | #
|
---|
40 | LIBRARIES += VgaBiosBin
|
---|
41 | VgaBiosBin_TEMPLATE = VBOXR3
|
---|
42 | VgaBiosBin_DEFS = IN_VBOXDD2
|
---|
43 | VgaBiosBin_INCS = $(VBOX_PATH_DEVICES_SRC)
|
---|
44 | VgaBiosBin_SOURCES = $(PATH_VgaBiosBin)/VgaBiosBin.c
|
---|
45 | VgaBiosBin_CLEAN = \
|
---|
46 | $(PATH_VgaBiosBin)/vbetables.h \
|
---|
47 | \
|
---|
48 | $(PATH_VgaBiosBin)/_vgabios_.c \
|
---|
49 | $(PATH_VgaBiosBin)/vgabios0.s \
|
---|
50 | $(PATH_VgaBiosBin)/vgabios1.s \
|
---|
51 | $(PATH_VgaBiosBin)/vgabios.tmp \
|
---|
52 | $(PATH_VgaBiosBin)/vgabios.lst \
|
---|
53 | $(PATH_VgaBiosBin)/vgabios.bin \
|
---|
54 | $(PATH_VgaBiosBin)/VgaBiosBin.c \
|
---|
55 | $(PATH_VgaBiosBin)/VgaDefBiosLogo.c \
|
---|
56 | \
|
---|
57 | $(PATH_VgaBiosBin)/_vgabios-cirrus_.c \
|
---|
58 | $(PATH_VgaBiosBin)/vgabios-cirrus0.s \
|
---|
59 | $(PATH_VgaBiosBin)/vgabios-cirrus1.s \
|
---|
60 | $(PATH_VgaBiosBin)/vgabios-cirrus.tmp \
|
---|
61 | $(PATH_VgaBiosBin)/vgabios-cirrus.lst \
|
---|
62 | $(PATH_VgaBiosBin)/vgabios-cirrus.bin
|
---|
63 |
|
---|
64 | #
|
---|
65 | # Rule for making the bios.
|
---|
66 | #
|
---|
67 | $$(PATH_VgaBiosBin)/VgaBiosBin.c: $$(PATH_VgaBiosBin)/vgabios.bin $(VBOX_BIN2C)
|
---|
68 | $(call MSG_TOOL,bin2c,VgaBiosBin,$<,$@)
|
---|
69 | $(QUIET)$(VBOX_BIN2C) -min 32 -max 64 -mask 0x0fff -ascii -export VgaBiosBinary $< $@
|
---|
70 |
|
---|
71 | #
|
---|
72 | # vgabios
|
---|
73 | #
|
---|
74 |
|
---|
75 | # 1. create vbetables.h
|
---|
76 | $$(PATH_VgaBiosBin)/vbetables.h: $(MAKEFILE_CURRENT) $$(TARGET_vbetables-gen) | $$(dir $$@)
|
---|
77 | $(QUIET)$(REDIRECT) -wo $@ -- $(TARGET_vbetables-gen)
|
---|
78 |
|
---|
79 | # 2. precompile
|
---|
80 | $$(PATH_VgaBiosBin)/_vgabios_.c: $(addprefix $(PATH_SUB_CURRENT)/,vgabios.c vgabios.h vbe.h vgatables.h vgafonts.h vbe.c clext.c) $$(PATH_VgaBiosBin)/vbetables.h $(VBOX_VERSION_STAMP)
|
---|
81 | $(call MSG_TOOL,cpp,VgaBiosBin,$<,$@)
|
---|
82 | $(QUIET)$(TOOL_$(VBOX_GCC_TOOL)_CC) -E -P -DVBOX -DVBOX_VERSION_STRING=\"$(VBOX_VERSION_STRING)\" -DVBE -DVGABIOS_DATE="''" $(addprefix -D,$(DEFS) $(DEFS.$(KBUILD_TYPE))) -o $@ $<
|
---|
83 |
|
---|
84 | # 3. compile
|
---|
85 | # BCC tempfile clashes, order the BCC jobs to make sure they don't interfere with one another.
|
---|
86 | $$(PATH_VgaBiosBin)/vgabios0.s: $$(PATH_VgaBiosBin)/_vgabios_.c | $(VBOX_BCC_JOBS)
|
---|
87 | $(call MSG_COMPILE,VgaBiosBin,$<,$@,C)
|
---|
88 | $(QUIET)$(VBOX_BCC) -o $@ -C-c -D__i86__ -0 -S $^
|
---|
89 | VBOX_BCC_JOBS += $(PATH_VgaBiosBin)/vgabios0.s
|
---|
90 |
|
---|
91 | # 4. preprocess intermediate assembly.
|
---|
92 | $$(PATH_VgaBiosBin)/vgabios1.s: $$(PATH_VgaBiosBin)/vgabios0.s
|
---|
93 | $(call MSG_TOOL,Adjusting BCC Assembly,VgaBiosBin,$<,$@)
|
---|
94 | $(QUIET)$(SED) -e 's/^\.text//' -e 's/^\.data//' --output $@ $^
|
---|
95 |
|
---|
96 | # 5. assemble
|
---|
97 | $$(PATH_VgaBiosBin)/vgabios.tmp $$(PATH_VgaBiosBin)/vgabios.lst: $$(PATH_VgaBiosBin)/vgabios1.s
|
---|
98 | $(call MSG_COMPILE,VgaBiosBin,$<,$@,AS)
|
---|
99 | $(QUIET)$(REDIRECT) -ri $^ -- $(VBOX_AS86) -b $(PATH_VgaBiosBin)/vgabios.tmp -u- -w- -g -0 -j -O -l $(PATH_VgaBiosBin)/vgabios.lst
|
---|
100 |
|
---|
101 | # 6. checksums
|
---|
102 | $$(PATH_VgaBiosBin)/vgabios.bin: $$(PATH_VgaBiosBin)/vgabios.tmp $$(VBOX_BIOSSUMS)
|
---|
103 | $(call MSG_TOOL,biossums,VgaBiosBin,$<,$@)
|
---|
104 | $(QUIET)$(VBOX_BIOSSUMS) $< $@
|
---|
105 |
|
---|
106 | #
|
---|
107 | # The VGA BIOS Logo.
|
---|
108 | #
|
---|
109 | LIBRARIES += VgaDefBiosLogo
|
---|
110 | VgaDefBiosLogo_TEMPLATE = VBOXR3
|
---|
111 | VgaDefBiosLogo_INCS = $(VBOX_PATH_DEVICES_SRC)
|
---|
112 | VgaDefBiosLogo_SOURCES = $(PATH_VgaBiosBin)/VgaDefBiosLogo.c
|
---|
113 |
|
---|
114 | #
|
---|
115 | # Rule for making the bios logo.
|
---|
116 | #
|
---|
117 | $$(PATH_VgaBiosBin)/VgaDefBiosLogo.c: $(VBOX_BRAND_BIOS_LOGO) $(VBOX_BIN2C)
|
---|
118 | $(call MSG_TOOL,bin2c,VgaBiosBin,$<,$@)
|
---|
119 | $(QUIET)$(VBOX_BIN2C) VgaDefBiosLogo $< $@
|
---|
120 |
|
---|
121 |
|
---|
122 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
123 |
|
---|