# $Id: Config.kmk 58529 2015-10-30 12:48:44Z vboxsync $ ## @file # kBuild configuration for the VBox EFI firmware. # # Note! kBuild is only used for the build tools, the rest is handled by the # very custom EFI build system. # # # Copyright (C) 2013-2015 Oracle Corporation # # 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. # # The contents of this file may alternatively be used under the terms # of the Common Development and Distribution License Version 1.0 # (CDDL) only, as it comes in the "COPYING.CDDL" file of the # VirtualBox OSE distribution, in which case the provisions of the # CDDL are applicable instead of those of the GPL. # # You may elect to license modified versions of this file under the # terms and conditions of either the GPL or the CDDL or both. # VBOX_EFI_FIRMWARE_CONFIG_KMK_INCLUDED = 1 # Include the next configure file above us. ifndef VBOX_DEVICES_CONFIG_KMK_INCLUDED include $(PATH_ROOT)/src/VBox/Devices/Config.kmk endif # # Globals. # VBOX_PATH_EFI_FIRMWARE = $(PATH_ROOT)/src/VBox/Devices/EFI/Firmware VBOX_PATH_STAGE_EFI_BLDPROGS = $(PATH_STAGE)/EfiBldProgs VBOX_EFI_BUILD_TARGET = $(if-expr $(intersects release profile, $(KBUILD_TYPE)),RELEASE,DEBUG) VBOX_EFI_OUTPUT_SUBDIR = $(VBOX_EFI_BUILD_TARGET)_$(VBOX_EFI_TOOL_CHAIN) # VBox Yasm command VBOX_YASMCMD ?= $(firstword $(wildcard $(KBUILD_DEVTOOLS_HST)/bin/yasm$(HOSTSUFF_EXE)) yasm$(HOSTSUFF_EXE)) # # Decide which tool chain to use for the EFI binaries. # Note! We're using our own stripped down tools_def.txt: vbox-tools_def.txt. # ifeq ($(KBUILD_HOST),win) VBOX_EFI_TOOL_CHAIN := VS2010 else VBOX_EFI_TOOL_CHAIN = UNIXGCC if !defined(VBOX_PATH_PREFIX_MINGW32) && !defined(VBOX_PATH_PREFIX_MINGW64) $(info Requires VBOX_PATH_PREFIX_MINGW32 and/or VBOX_PATH_PREFIX_MINGW64 to point something mingw like or there must be some mingw like in the PATH.) $(info ) $(info Recent Fedora: sudo yum install mingw64-gcc mingw64-gcc-c++ mingw64-binutils mingw32-gcc mingw32-gcc-c++ mingw32-binutils) $(info ) $(info Newer Debian and forks: sudo apt-get install binutils-mingw-w64 gcc-mingw-w64 g++-mingw-w64 ) $(info Older Debian and forks: sudo apt-get install mingw32-binutils mingw32 mingw32-runtime ) $(info ) $(info Gentoo: crossdev -S -P -v -t i686-pc-mingw32 && crossdev -S -P -v -t x86_64-pc-mingw32) $(info ) $(error Needs mingw32/64) endif endif # # Make a build program template of our own. # TEMPLATE_VBoxEfiBldProg = EFI build program. TEMPLATE_VBoxEfiBldProg_EXTENDS = VBoxBldProg TEMPLATE_VBoxEfiBldProg_INST = EfiBldProgs/ TEMPLATE_VBoxEfiBldProg_INSTTYPE = stage TEMPLATE_VBoxEfiBldProg_INCS = $(TEMPLATE_VBoxBldProg_INCS) \ $(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/C/Include/IndustryStandard \ $(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/C/Common \ $(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/C/Include \ $(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/C TEMPLATE_VBoxEfiBldProg_INCS.x86 = $(TEMPLATE_VBoxBldProg_INCS.x86) \ $(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/C/Include/IA32 TEMPLATE_VBoxEfiBldProg_INCS.amd64 = $(TEMPLATE_VBoxBldProg_INCS.amd64) \ $(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/C/Include/X64 TEMPLATE_VBoxEfiBldProg_LIBS = \ $(VBOX_PATH_STAGE_EFI_BLDPROGS)/EfiBldCommonLib$(VBOX_SUFF_LIB) \ $(TEMPLATE_VBoxBldProg_LIBS) ifn1of ($(KBUILD_HOST),win) # This stuff isn't up to our standard at all! :/ TEMPLATE_VBoxEfiBldProg_CFLAGS = $(filter-out -pedantic,$(TEMPLATE_VBoxBldProg_CFLAGS)) \ -Wno-sign-compare -Wno-missing-prototypes -Wno-strict-prototypes \ -Wno-implicit-function-declaration -Wno-missing-declarations -Wno-shadow -Wno-format -Wno-empty-body TEMPLATE_VBoxEfiBldProg_CXXFLAGS = $(filter-out -pedantic,$(TEMPLATE_VBoxBldProg_CXXFLAGS)) \ -Wno-all -Wno-shadow -Wno-empty-body endif # There isn't a BLDLIBRARIES target group, so we have to override the build # target for libraries used by build programs and keep them in LIBRARIES. TEMPLATE_VBoxEfiBldLib = Library for an EFI build program. TEMPLATE_VBoxEfiBldLib_EXTENDS = VBoxEfiBldProg TEMPLATE_VBoxEfiBldLib_BLD_TRG := $(KBUILD_HOST) TEMPLATE_VBoxEfiBldLib_BLD_TRG_ARCH := $(KBUILD_HOST_ARCH) TEMPLATE_VBoxEfiBldLib_BLD_TRG_CPU := $(KBUILD_HOST_CPU) # # The debug info suffix. # if1of ($(KBUILD_TARGET), win) VBOX_EFI_DBG_SUFF := .pdb else VBOX_EFI_DBG_SUFF := .debug endif include $(VBOX_PATH_EFI_FIRMWARE)/EfiModules.kmk