Makefile revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
1280N/A#
1280N/A# PC BIOS Makefile
1280N/A#
1280N/A
1280N/A# Copyright (C) 2006 InnoTek Systemberatung GmbH
1280N/A#
1280N/A# This file is part of VirtualBox Open Source Edition (OSE), as
1280N/A# available from http://www.virtualbox.org. This file is free software;
1280N/A# you can redistribute it and/or modify it under the terms of the GNU
1280N/A# General Public License as published by the Free Software Foundation,
1280N/A# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
1280N/A# distribution. VirtualBox OSE is distributed in the hope that it will
1280N/A# be useful, but WITHOUT ANY WARRANTY of any kind.
1280N/A#
1280N/A# If you received this file as part of a commercial VirtualBox
1280N/A# distribution, then only the terms of your commercial VirtualBox
1280N/A# license agreement apply instead of the previous paragraph.
1280N/A#
1280N/A
1280N/ADEPTH = ../../../../../
1280N/Ainclude $(PATH_KBUILD)/header.kmk
1280N/A
1280N/ABLDPROGS = biossums
1280N/ALIBRARIES = PcBiosBin PcDefBiosLogo
3215N/A
6207N/AOTHERS = $(PATH_TARGET)/bios.bin
1280N/A
1280N/AOTHER_CLEAN = \
1280N/A $(PATH_TARGET)/_rombios_.c \
2086N/A $(PATH_TARGET)/rombios0.s \
6207N/A $(PATH_TARGET)/rombios1.s \
2086N/A $(PATH_TARGET)/bios.lst \
2086N/A $(PATH_TARGET)/bios.tmp \
6207N/A $(PATH_TARGET)/bios.bin \
6207N/A $(PATH_TARGET)/PcBiosBin.c \
6207N/A $(PATH_TARGET)/PcDefBiosLogo.c
6207N/A
6207N/ATEMPLATE = VBOXBLDPROG
6207N/Abiossums_SOURCES = biossums.c
1280N/A
1280N/APcBiosBin_TEMPLATE = VBOXR3
1280N/APcBiosBin_DEFS = IN_VBOXDD2
1280N/APcBiosBin_INCS = ../..
1280N/APcBiosBin_SOURCES = $(PATH_TARGET)/PcBiosBin.c
1280N/A$(PATH_TARGET)/PcBiosBin.c_DEPS = $(PATH_TARGET)/bios-syms.h
1280N/A
1280N/APcDefBiosLogo_TEMPLATE = VBOXR3
1280N/APcDefBiosLogo_INCS = ../..
1280N/APcDefBiosLogo_SOURCES = $(PATH_TARGET)/PcDefBiosLogo.c
1280N/A
1280N/A
1280N/Ainclude $(PATH_KBUILD)/footer.kmk
1280N/A
1280N/A
1280N/A#
1280N/A# Rule for making the bios.
1280N/A#
1280N/A$(PATH_TARGET)/PcBiosBin.c: $(PATH_TARGET)/bios.bin $(VBOX_BIN2C)
1280N/A $(call MSG_L1,bin2c $< => $@)
1280N/A $(QUIET)$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary $< $@
1280N/A
1280N/A#
1280N/A# Rule for making the bios logo.
1280N/A#
1280N/A$(PATH_TARGET)/PcDefBiosLogo.c: innotek_logo.bmp $(VBOX_BIN2C)
1280N/A $(call MSG_L1,bin2c $< => $@)
1280N/A $(QUIET)$(VBOX_BIN2C) -max 64 PcDefBiosLogo $< $@
6207N/A
6207N/A#
1280N/A# Six steps to bios.bin and bios-syms.h
1280N/A#
1280N/A
1280N/A# 1. precompile rombios.c
1280N/A$(PATH_TARGET)/_rombios_.c: rombios.c logo.c apmbios.S
1280N/A $(call MSG_L1,Precompiling $<,=> $@)
1280N/A $(QUIET)$(TOOL_$(VBOX_GCC_TOOL)_CC) -E -I$(PATH_TARGET) -I$(PATH_CURRENT)/.. -DBX_SMP_PROCESSORS=1 -DVBOX $(addprefix -D,$(DEFS) $(DEFS.$(BUILD_TYPE))) -P $< > $@
1280N/A
1280N/A# 2. compile to intermediate asm file.
6207N/A$(PATH_TARGET)/rombios0.s: $(PATH_TARGET)/_rombios_.c
1280N/A $(call MSG_L1,Compiling $<,=> $@)
1280N/A $(QUIET)$(VBOX_BCC) -o $@ -C-c -D__i86__ -0 -S $^
1280N/A
1280N/A# 3. post process intermediate asm file.
1280N/A$(PATH_TARGET)/rombios1.s: $(PATH_TARGET)/rombios0.s
1280N/A $(call MSG_L1,Adjusting BCC Assembly $<,=> $@)
1280N/A $(QUIET)$(SED) -e 's/^\.text//' -e 's/^\.data//' $^ > $@
1280N/A
6207N/A# 4. assemble the intermediate asm file. (also creates a listing rombios.lst)
2086N/A$(PATH_TARGET)/bios.tmp $(PATH_TARGET)/bios.lst: $(PATH_TARGET)/rombios1.s
1280N/A $(call MSG_L1,Compiling $<,=> $@)
2086N/A $(QUIET)$(VBOX_AS86) -b $(PATH_TARGET)/bios.tmp -u- -w- -g -0 -j -O -l $(PATH_TARGET)/bios.lst - < $^
2086N/A
2086N/A# 5. calculate checksums for the final BIOS image.
2086N/A$(PATH_TARGET)/bios.bin: $(PATH_TARGET)/bios.tmp $(TARGET_biossums)
2086N/A $(call MSG_L1,biossums $@)
2086N/A $(QUIET)$(CP) -f $(PATH_TARGET)/bios.tmp $(PATH_TARGET)/bios.bin
2086N/A $(QUIET)$(TARGET_biossums) $(PATH_TARGET)/bios.bin
2086N/A
2086N/A# 6. create the symbol table.
2086N/A$(PATH_TARGET)/bios-syms.h: $(PATH_TARGET)/bios.lst Makefile
2086N/A $(call MSG_L1,symtable $<,=> $@)
2086N/A $(QUIET)$(SED) \
2086N/A -e '/^[0-9][0-9][0-9][0-9][0-9] 000[0-9A-F]* [[:space:]]*[a-zA-Z0-9_]*:/!d' \
2086N/A -e 's/^[0-9][0-9][0-9][0-9][0-9] \(000[0-9A-F]*\) [[:space:]]*\([a-zA-Z0-9_]*\):.*$$/ DEFSYM(0x\1, "\2"),/' \
2086N/A $(PATH_TARGET)/bios.lst > $@
1280N/A
2086N/A