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