1 | # $Id: Makefile.kmk 5450 2007-10-23 19:03:55Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # VGA 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 |
|
---|
17 | DEPTH ?= ../../../../..
|
---|
18 | SUB_DEPTH = ../..
|
---|
19 | include $(PATH_KBUILD)/subheader.kmk
|
---|
20 |
|
---|
21 | VBOX_PATH_DEVICES_SRC = $(PATH_SUB_ROOT)
|
---|
22 |
|
---|
23 | #
|
---|
24 | # Build program for calculating the VGA BIOS checksums.
|
---|
25 | #
|
---|
26 | BLDPROGS += vgabiossums vbetables-gen
|
---|
27 | vgabiossums_TEMPLATE = VBOXBLDPROG
|
---|
28 | vgabiossums_SOURCES = biossums.c
|
---|
29 | vbetables-gen_TEMPLATE = VBOXBLDPROG
|
---|
30 | vbetables-gen_SOURCES = vbetables-gen.c
|
---|
31 |
|
---|
32 | #
|
---|
33 | # The library containing the VGA BIOS image.
|
---|
34 | #
|
---|
35 | LIBRARIES += VgaBiosBin
|
---|
36 | VgaBiosBin_TEMPLATE = VBOXR3
|
---|
37 | VgaBiosBin_DEFS = IN_VBOXDD2
|
---|
38 | VgaBiosBin_INCS = $(VBOX_PATH_DEVICES_SRC)
|
---|
39 | VgaBiosBin_SOURCES = $(PATH_TARGET)/VgaBiosBin.c
|
---|
40 | VgaBiosBin_CLEAN = \
|
---|
41 | $(PATH_TARGET)/_vgabios_.c \
|
---|
42 | $(PATH_TARGET)/vgabios0.s \
|
---|
43 | $(PATH_TARGET)/vgabios1.s \
|
---|
44 | $(PATH_TARGET)/vgabios.tmp \
|
---|
45 | $(PATH_TARGET)/vgabios.lst \
|
---|
46 | $(PATH_TARGET)/vgabios.bin \
|
---|
47 | $(PATH_TARGET)/VgaBiosBin.c \
|
---|
48 | \
|
---|
49 | $(PATH_TARGET)/_vgabios-cirrus_.c \
|
---|
50 | $(PATH_TARGET)/vgabios-cirrus0.s \
|
---|
51 | $(PATH_TARGET)/vgabios-cirrus1.s \
|
---|
52 | $(PATH_TARGET)/vgabios-cirrus.tmp \
|
---|
53 | $(PATH_TARGET)/vgabios-cirrus.lst \
|
---|
54 | $(PATH_TARGET)/vgabios-cirrus.bin
|
---|
55 |
|
---|
56 | #
|
---|
57 | # Rule for making the bios.
|
---|
58 | #
|
---|
59 | $(PATH_TARGET)/VgaBiosBin.c: $(PATH_TARGET)/vgabios.bin $(VBOX_BIN2C)
|
---|
60 | $(call MSG_TOOL,bin2c,VgaBiosBin,$<,$@)
|
---|
61 | $(QUIET)$(VBOX_BIN2C) -min 32 -max 64 -mask 0x0fff -ascii -export VgaBiosBinary $< $@
|
---|
62 |
|
---|
63 | #
|
---|
64 | # vgabios
|
---|
65 | #
|
---|
66 |
|
---|
67 | # 1. create vbetables.h
|
---|
68 | $(PATH_SUB_CURRENT)/vbetables.h: $(MAKEFILE_CURRENT)
|
---|
69 | $(QUIET)$(TARGET_vbetables-gen) > $@
|
---|
70 |
|
---|
71 | # 2. precompile
|
---|
72 | $(PATH_TARGET)/_vgabios_.c: $(addprefix $(PATH_SUB_CURRENT)/,vgabios.c vgabios.h vbe.h vgatables.h vgafonts.h vbe.c clext.c) $(PATH_SUB_CURRENT)/vbetables.h
|
---|
73 | $(call MSG_TOOL,cpp,VgaBiosBin,$<,$@)
|
---|
74 | $(QUIET)$(TOOL_$(VBOX_GCC_TOOL)_CC) -DVBOX -DVBOX_VERSION_STRING=\"$(VBOX_VERSION_STRING)\" -E -P $< -DVBE -DVGABIOS_DATE="''" $(addprefix -D,$(DEFS) $(DEFS.$(BUILD_TYPE))) > $@
|
---|
75 |
|
---|
76 | # 3. compile - tempfile clashes, so make sure it's built in solitude.
|
---|
77 | .NOTPARALLEL: $(PATH_TARGET)/vgabios0.s
|
---|
78 | $(PATH_TARGET)/vgabios0.s: $(PATH_TARGET)/_vgabios_.c
|
---|
79 | $(call MSG_COMPILE,VgaBiosBin,$<,$@,C)
|
---|
80 | $(QUIET)$(VBOX_BCC) -o $@ -C-c -D__i86__ -0 -S $^
|
---|
81 |
|
---|
82 | # 4. preprocess intermediate assembly.
|
---|
83 | $(PATH_TARGET)/vgabios1.s: $(PATH_TARGET)/vgabios0.s
|
---|
84 | $(call MSG_TOOL,Adjusting BCC Assembly,VgaBiosBin,$<,$@)
|
---|
85 | $(QUIET)$(SED) -e 's/^\.text//' -e 's/^\.data//' $^ > $@
|
---|
86 |
|
---|
87 | # 5. assemble
|
---|
88 | $(PATH_TARGET)/vgabios.tmp $(PATH_TARGET)/vgabios.lst: $(PATH_TARGET)/vgabios1.s
|
---|
89 | $(call MSG_COMPILE,VgaBiosBin,$<,$@,AS)
|
---|
90 | $(QUIET)$(VBOX_AS86) -b $(PATH_TARGET)/vgabios.tmp -u- -w- -g -0 -j -O -l $(PATH_TARGET)/vgabios.lst < $^
|
---|
91 |
|
---|
92 | # 6. checksums
|
---|
93 | $(PATH_TARGET)/vgabios.bin: $(PATH_TARGET)/vgabios.tmp $$(TARGET_vgabiossums)
|
---|
94 | $(call MSG_TOOL,vgabiossums,VgaBiosBin,$<,$@)
|
---|
95 | $(QUIET)$(CP) -f $(PATH_TARGET)/vgabios.tmp $@
|
---|
96 | $(QUIET)$(TARGET_vgabiossums) $@
|
---|
97 |
|
---|
98 |
|
---|
99 | include $(PATH_KBUILD)/subfooter.kmk
|
---|
100 |
|
---|