# $Id: Makefile.kmk 26028 2010-01-25 17:00:10Z vboxsync $ ## @file # VGA BIOS Sub-Makefile # # # Copyright (C) 2006-2007 Sun Microsystems, Inc. # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; # you can redistribute it and/or modify it under the terms of the GNU # General Public License (GPL) as published by the Free Software # Foundation, in version 2 as it comes in the "COPYING" file of the # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa # Clara, CA 95054 USA or visit http://www.sun.com if you need # additional information or have any questions. # SUB_DEPTH = ../../../../.. include $(KBUILD_PATH)/subheader.kmk # # Globals # VBOX_PATH_DEVICES_SRC ?= $(PATH_ROOT)/src/VBox/Devices # # Build program for calculating the VGA BIOS checksums. # BLDPROGS += vbetables-gen vbetables-gen_TEMPLATE = VBOXBLDPROG vbetables-gen_SOURCES = vbetables-gen.c # # The library containing the VGA BIOS image. # LIBRARIES += VgaBiosBin VgaBiosBin_TEMPLATE = VBOXR3 VgaBiosBin_DEFS = IN_VBOXDD2 VgaBiosBin_INCS = $(VBOX_PATH_DEVICES_SRC) VgaBiosBin_SOURCES = $(PATH_VgaBiosBin)/VgaBiosBin.c VgaBiosBin_CLEAN = \ $(PATH_VgaBiosBin)/vbetables.h \ \ $(PATH_VgaBiosBin)/_vgabios_.c \ $(PATH_VgaBiosBin)/vgabios0.s \ $(PATH_VgaBiosBin)/vgabios1.s \ $(PATH_VgaBiosBin)/vgabios.tmp \ $(PATH_VgaBiosBin)/vgabios.lst \ $(PATH_VgaBiosBin)/vgabios.bin \ $(PATH_VgaBiosBin)/VgaBiosBin.c \ $(PATH_VgaBiosBin)/VgaDefBiosLogo.c \ \ $(PATH_VgaBiosBin)/_vgabios-cirrus_.c \ $(PATH_VgaBiosBin)/vgabios-cirrus0.s \ $(PATH_VgaBiosBin)/vgabios-cirrus1.s \ $(PATH_VgaBiosBin)/vgabios-cirrus.tmp \ $(PATH_VgaBiosBin)/vgabios-cirrus.lst \ $(PATH_VgaBiosBin)/vgabios-cirrus.bin # # Rule for making the bios. # $$(PATH_VgaBiosBin)/VgaBiosBin.c: $$(PATH_VgaBiosBin)/vgabios.bin $(VBOX_BIN2C) $(call MSG_TOOL,bin2c,VgaBiosBin,$<,$@) $(QUIET)$(VBOX_BIN2C) -min 36 -max 36 -mask 0x0fff -ascii -export VgaBiosBinary $< $@ # # vgabios # # 1. create vbetables.h $$(PATH_VgaBiosBin)/vbetables.h: $(MAKEFILE_CURRENT) $$(TARGET_vbetables-gen) | $$(dir $$@) $(QUIET)$(REDIRECT) -wo $@ -- $(TARGET_vbetables-gen) # 2. precompile # WARNING! DEBUG is undefined here to keep the image size stable between debug and release builds. $$(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) $(call MSG_TOOL,cpp,VgaBiosBin,$<,$@) $(QUIET)$(TOOL_$(VBOX_GCC_TOOL)_CC) -E -P -DVBOX -DVBOX_VERSION_STRING=\"$(VBOX_VERSION_STRING)\" \ -DVBE -DVGABIOS_DATE="''" $(addprefix -D,$(DEFS) $(DEFS.$(KBUILD_TYPE))) \ -UDEBUG \ -o $@ $< # 3. compile # BCC tempfile clashes, order the BCC jobs to make sure they don't interfere with one another. $$(PATH_VgaBiosBin)/vgabios0.s: $$(PATH_VgaBiosBin)/_vgabios_.c | $(VBOX_BCC_JOBS) $(call MSG_COMPILE,VgaBiosBin,$<,$@,C) $(QUIET)$(VBOX_BCC) -o $@ -C-c -D__i86__ -0 -S $^ VBOX_BCC_JOBS += $(PATH_VgaBiosBin)/vgabios0.s # 4. preprocess intermediate assembly. $$(PATH_VgaBiosBin)/vgabios1.s: $$(PATH_VgaBiosBin)/vgabios0.s $(call MSG_TOOL,Adjusting BCC Assembly,VgaBiosBin,$<,$@) $(QUIET)$(SED) -e 's/^\.text//' -e 's/^\.data//' --output $@ $^ # 5. assemble $$(PATH_VgaBiosBin)/vgabios.tmp $$(PATH_VgaBiosBin)/vgabios.lst: $$(PATH_VgaBiosBin)/vgabios1.s $(call MSG_COMPILE,VgaBiosBin,$<,$@,AS) $(QUIET)$(REDIRECT) -ri $^ -- $(VBOX_AS86) -b $(PATH_VgaBiosBin)/vgabios.tmp -u- -w- -g -0 -j -O -l $(PATH_VgaBiosBin)/vgabios.lst # 6. checksums $$(PATH_VgaBiosBin)/vgabios.bin: $$(PATH_VgaBiosBin)/vgabios.tmp $$(VBOX_BIOSSUMS) $(call MSG_TOOL,biossums,VgaBiosBin,$<,$@) $(QUIET)$(VBOX_BIOSSUMS) $< $@ # # The VGA BIOS Logo. # LIBRARIES += VgaDefBiosLogo VgaDefBiosLogo_TEMPLATE = VBOXR3 VgaDefBiosLogo_INCS = $(VBOX_PATH_DEVICES_SRC) VgaDefBiosLogo_SOURCES = $(PATH_VgaBiosBin)/VgaDefBiosLogo.c # # Rule for making the bios logo. # $$(PATH_VgaBiosBin)/VgaDefBiosLogo.c: $(VBOX_BRAND_BIOS_LOGO) $(VBOX_BIN2C) $(call MSG_TOOL,bin2c,VgaBiosBin,$<,$@) $(QUIET)$(VBOX_BIN2C) VgaDefBiosLogo $< $@ include $(KBUILD_PATH)/subfooter.kmk