1 | # $Id: Config.kmk 58460 2015-10-28 20:34:41Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # kBuild configuration for the VBox EFI firmware.
|
---|
4 | #
|
---|
5 | # Note! kBuild is only used for the build tools, the rest is handled by the
|
---|
6 | # very custom EFI build system.
|
---|
7 | #
|
---|
8 |
|
---|
9 | #
|
---|
10 | # Copyright (C) 2013-2015 Oracle Corporation
|
---|
11 | #
|
---|
12 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
13 | # available from http://www.virtualbox.org. This file is free software;
|
---|
14 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
15 | # General Public License (GPL) as published by the Free Software
|
---|
16 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
17 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
18 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
19 | #
|
---|
20 | # The contents of this file may alternatively be used under the terms
|
---|
21 | # of the Common Development and Distribution License Version 1.0
|
---|
22 | # (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
23 | # VirtualBox OSE distribution, in which case the provisions of the
|
---|
24 | # CDDL are applicable instead of those of the GPL.
|
---|
25 | #
|
---|
26 | # You may elect to license modified versions of this file under the
|
---|
27 | # terms and conditions of either the GPL or the CDDL or both.
|
---|
28 | #
|
---|
29 |
|
---|
30 | VBOX_EFI_FIRMWARE_CONFIG_KMK_INCLUDED = 1
|
---|
31 |
|
---|
32 | # Include the next configure file above us.
|
---|
33 | ifndef VBOX_DEVICES_CONFIG_KMK_INCLUDED
|
---|
34 | include $(PATH_ROOT)/src/VBox/Devices/Config.kmk
|
---|
35 | endif
|
---|
36 |
|
---|
37 | #
|
---|
38 | # Globals.
|
---|
39 | #
|
---|
40 | VBOX_PATH_EFI_FIRMWARE = $(PATH_ROOT)/src/VBox/Devices/EFI/Firmware
|
---|
41 | VBOX_PATH_STAGE_EFI_BLDPROGS = $(PATH_STAGE)/EfiBldProgs
|
---|
42 | VBOX_EFI_BUILD_TARGET = $(if-expr $(intersects release profile, $(KBUILD_TYPE)),RELEASE,DEBUG)
|
---|
43 | VBOX_EFI_OUTPUT_SUBDIR = $(VBOX_EFI_BUILD_TARGET)_$(VBOX_EFI_TOOL_CHAIN)
|
---|
44 |
|
---|
45 | # VBox Yasm command
|
---|
46 | VBOX_YASMCMD ?= $(firstword $(wildcard $(KBUILD_DEVTOOLS_HST)/bin/yasm$(HOSTSUFF_EXE)) yasm$(HOSTSUFF_EXE))
|
---|
47 |
|
---|
48 | #
|
---|
49 | # Decide which tool chain to use for the EFI binaries.
|
---|
50 | # Note! We're using our own stripped down tools_def.txt: vbox-tools_def.txt.
|
---|
51 | #
|
---|
52 | ifeq ($(KBUILD_HOST),win)
|
---|
53 | VBOX_EFI_TOOL_CHAIN := VS2010
|
---|
54 | else
|
---|
55 | VBOX_EFI_TOOL_CHAIN = UNIXGCC
|
---|
56 | if !defined(VBOX_PATH_PREFIX_MINGW32) && !defined(VBOX_PATH_PREFIX_MINGW64)
|
---|
57 | $(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.)
|
---|
58 | $(info )
|
---|
59 | $(info Recent Fedora: sudo yum install mingw64-gcc mingw64-gcc-c++ mingw64-binutils mingw32-gcc mingw32-gcc-c++ mingw32-binutils)
|
---|
60 | $(info )
|
---|
61 | $(info Newer Debian and forks: sudo apt-get install binutils-mingw-w64 gcc-mingw-w64 g++-mingw-w64 )
|
---|
62 | $(info Older Debian and forks: sudo apt-get install mingw32-binutils mingw32 mingw32-runtime )
|
---|
63 | $(info )
|
---|
64 | $(info Gentoo: crossdev -S -P -v -t i686-pc-mingw32 && crossdev -S -P -v -t x86_64-pc-mingw32)
|
---|
65 | $(info )
|
---|
66 | $(error Needs mingw32/64)
|
---|
67 | endif
|
---|
68 | endif
|
---|
69 |
|
---|
70 |
|
---|
71 | #
|
---|
72 | # Make a build program template of our own.
|
---|
73 | #
|
---|
74 | TEMPLATE_VBoxEfiBldProg = EFI build program.
|
---|
75 | TEMPLATE_VBoxEfiBldProg_EXTENDS = VBoxBldProg
|
---|
76 | TEMPLATE_VBoxEfiBldProg_INST = EfiBldProgs/
|
---|
77 | TEMPLATE_VBoxEfiBldProg_INSTTYPE = stage
|
---|
78 | TEMPLATE_VBoxEfiBldProg_INCS = $(TEMPLATE_VBoxBldProg_INCS) \
|
---|
79 | $(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/C/Include/IndustryStandard \
|
---|
80 | $(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/C/Common \
|
---|
81 | $(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/C/Include \
|
---|
82 | $(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/C
|
---|
83 |
|
---|
84 | TEMPLATE_VBoxEfiBldProg_INCS.x86 = $(TEMPLATE_VBoxBldProg_INCS.x86) \
|
---|
85 | $(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/C/Include/IA32
|
---|
86 |
|
---|
87 | TEMPLATE_VBoxEfiBldProg_INCS.amd64 = $(TEMPLATE_VBoxBldProg_INCS.amd64) \
|
---|
88 | $(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/C/Include/X64
|
---|
89 |
|
---|
90 | TEMPLATE_VBoxEfiBldProg_LIBS = \
|
---|
91 | $(VBOX_PATH_STAGE_EFI_BLDPROGS)/EfiBldCommonLib$(VBOX_SUFF_LIB) \
|
---|
92 | $(TEMPLATE_VBoxBldProg_LIBS)
|
---|
93 | ifn1of ($(KBUILD_HOST),win) # This stuff isn't up to our standard at all! :/
|
---|
94 | TEMPLATE_VBoxEfiBldProg_CFLAGS = $(filter-out -pedantic,$(TEMPLATE_VBoxBldProg_CFLAGS)) \
|
---|
95 | -Wno-sign-compare -Wno-missing-prototypes -Wno-strict-prototypes \
|
---|
96 | -Wno-implicit-function-declaration -Wno-missing-declarations -Wno-shadow -Wno-format -Wno-empty-body
|
---|
97 | TEMPLATE_VBoxEfiBldProg_CXXFLAGS = $(filter-out -pedantic,$(TEMPLATE_VBoxBldProg_CXXFLAGS)) \
|
---|
98 | -Wno-all -Wno-shadow -Wno-empty-body
|
---|
99 | endif
|
---|
100 |
|
---|
101 |
|
---|
102 | # There isn't a BLDLIBRARIES target group, so we have to override the build
|
---|
103 | # target for libraries used by build programs and keep them in LIBRARIES.
|
---|
104 | TEMPLATE_VBoxEfiBldLib = Library for an EFI build program.
|
---|
105 | TEMPLATE_VBoxEfiBldLib_EXTENDS = VBoxEfiBldProg
|
---|
106 | TEMPLATE_VBoxEfiBldLib_BLD_TRG := $(KBUILD_HOST)
|
---|
107 | TEMPLATE_VBoxEfiBldLib_BLD_TRG_ARCH := $(KBUILD_HOST_ARCH)
|
---|
108 | TEMPLATE_VBoxEfiBldLib_BLD_TRG_CPU := $(KBUILD_HOST_CPU)
|
---|
109 |
|
---|
110 |
|
---|
111 | #
|
---|
112 | # The name of the subdirectory which the .pdb, .efi and other output files ends
|
---|
113 | # up in, apparently. In the generated makefiles, DEBUG_DIR points to them.
|
---|
114 | #
|
---|
115 | VBOX_EFI_DEBUG_DIR = DEBUG
|
---|
116 |
|
---|
117 | #
|
---|
118 | # List of modules that ends up producing .efi, .debug and .pdb files.
|
---|
119 | #
|
---|
120 | VBOX_EFI_MODULES = \
|
---|
121 | IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe/$(VBOX_EFI_DEBUG_DIR)/IsaBusDxe \
|
---|
122 | IntelFrameworkModulePkg/Bus/Isa/IsaFloppyDxe/IsaFloppyDxe/$(VBOX_EFI_DEBUG_DIR)/IsaFloppyDxe \
|
---|
123 | IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe/$(VBOX_EFI_DEBUG_DIR)/IsaIoDxe \
|
---|
124 | IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe/$(VBOX_EFI_DEBUG_DIR)/IsaSerialDxe \
|
---|
125 | IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe/$(VBOX_EFI_DEBUG_DIR)/Ps2KeyboardDxe \
|
---|
126 | IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe/$(VBOX_EFI_DEBUG_DIR)/IdeBusDxe \
|
---|
127 | IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe/$(VBOX_EFI_DEBUG_DIR)/BdsDxe \
|
---|
128 | IntelFrameworkModulePkg/Universal/DataHubDxe/DataHubDxe/$(VBOX_EFI_DEBUG_DIR)/DataHubDxe \
|
---|
129 | IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei/$(VBOX_EFI_DEBUG_DIR)/StatusCodePei \
|
---|
130 | IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/StatusCodeRuntimeDxe \
|
---|
131 | MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru/$(VBOX_EFI_DEBUG_DIR)/AtaAtapiPassThruDxe \
|
---|
132 | MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe/$(VBOX_EFI_DEBUG_DIR)/AtaBusDxe \
|
---|
133 | MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe/$(VBOX_EFI_DEBUG_DIR)/EhciDxe \
|
---|
134 | MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe/$(VBOX_EFI_DEBUG_DIR)/PciBusDxe \
|
---|
135 | MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe/$(VBOX_EFI_DEBUG_DIR)/ScsiBus \
|
---|
136 | MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe/$(VBOX_EFI_DEBUG_DIR)/ScsiDisk \
|
---|
137 | MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe/$(VBOX_EFI_DEBUG_DIR)/UsbBusDxe \
|
---|
138 | MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe/$(VBOX_EFI_DEBUG_DIR)/UsbKbDxe \
|
---|
139 | MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe/$(VBOX_EFI_DEBUG_DIR)/UsbMassStorageDxe \
|
---|
140 | MdeModulePkg/Core/Dxe/DxeMain/$(VBOX_EFI_DEBUG_DIR)/DxeCore \
|
---|
141 | MdeModulePkg/Core/DxeIplPeim/DxeIpl/$(VBOX_EFI_DEBUG_DIR)/DxeIpl \
|
---|
142 | MdeModulePkg/Core/Pei/PeiMain/$(VBOX_EFI_DEBUG_DIR)/PeiCore \
|
---|
143 | MdeModulePkg/Core/RuntimeDxe/RuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/RuntimeDxe \
|
---|
144 | MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe/$(VBOX_EFI_DEBUG_DIR)/AcpiPlatform \
|
---|
145 | MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe/$(VBOX_EFI_DEBUG_DIR)/AcpiTableDxe \
|
---|
146 | MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/CapsuleRuntimeDxe \
|
---|
147 | MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe/$(VBOX_EFI_DEBUG_DIR)/ConPlatformDxe \
|
---|
148 | MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe/$(VBOX_EFI_DEBUG_DIR)/ConSplitterDxe \
|
---|
149 | MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe/$(VBOX_EFI_DEBUG_DIR)/GraphicsConsoleDxe \
|
---|
150 | MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe/$(VBOX_EFI_DEBUG_DIR)/TerminalDxe \
|
---|
151 | MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe/$(VBOX_EFI_DEBUG_DIR)/DevicePathDxe \
|
---|
152 | MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe/$(VBOX_EFI_DEBUG_DIR)/DiskIoDxe \
|
---|
153 | MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe/$(VBOX_EFI_DEBUG_DIR)/PartitionDxe \
|
---|
154 | MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe/$(VBOX_EFI_DEBUG_DIR)/EnglishDxe \
|
---|
155 | MdeModulePkg/Universal/EbcDxe/EbcDxe/$(VBOX_EFI_DEBUG_DIR)/EbcDxe \
|
---|
156 | MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe/$(VBOX_EFI_DEBUG_DIR)/FaultTolerantWriteDxe \
|
---|
157 | MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe/$(VBOX_EFI_DEBUG_DIR)/HiiDatabase \
|
---|
158 | MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe/$(VBOX_EFI_DEBUG_DIR)/NullMemoryTestDxe \
|
---|
159 | MdeModulePkg/Universal/Metronome/Metronome/$(VBOX_EFI_DEBUG_DIR)/Metronome \
|
---|
160 | MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/MonotonicCounterRuntimeDxe \
|
---|
161 | MdeModulePkg/Universal/PCD/Dxe/Pcd/$(VBOX_EFI_DEBUG_DIR)/PcdDxe \
|
---|
162 | MdeModulePkg/Universal/PCD/Pei/Pcd/$(VBOX_EFI_DEBUG_DIR)/PcdPeim \
|
---|
163 | MdeModulePkg/Universal/PrintDxe/PrintDxe/$(VBOX_EFI_DEBUG_DIR)/PrintDxe \
|
---|
164 | MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/ReportStatusCodeRouterRuntimeDxe \
|
---|
165 | MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe/$(VBOX_EFI_DEBUG_DIR)/SecurityStubDxe \
|
---|
166 | MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe/$(VBOX_EFI_DEBUG_DIR)/SetupBrowser \
|
---|
167 | MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe/$(VBOX_EFI_DEBUG_DIR)/SmbiosDxe \
|
---|
168 | MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/StatusCodeHandlerRuntimeDxe \
|
---|
169 | MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer/$(VBOX_EFI_DEBUG_DIR)/WatchdogTimer \
|
---|
170 | OvmfPkg/BlockMmioToBlockIoDxe/BlockIo/$(VBOX_EFI_DEBUG_DIR)/BlockMmioToBlockIoDxe \
|
---|
171 | OvmfPkg/PlatformPei/PlatformPei/$(VBOX_EFI_DEBUG_DIR)/PlatformPei \
|
---|
172 | OvmfPkg/Sec/SecMain/$(VBOX_EFI_DEBUG_DIR)/SecMain \
|
---|
173 | OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe/$(VBOX_EFI_DEBUG_DIR)/SmbiosPlatformDxe \
|
---|
174 | PcAtChipsetPkg/8254TimerDxe/8254Timer/$(VBOX_EFI_DEBUG_DIR)/Timer \
|
---|
175 | PcAtChipsetPkg/8259InterruptControllerDxe/8259/$(VBOX_EFI_DEBUG_DIR)/Legacy8259 \
|
---|
176 | PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/IdeControllerDxe/$(VBOX_EFI_DEBUG_DIR)/IdeController \
|
---|
177 | PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi/$(VBOX_EFI_DEBUG_DIR)/IsaAcpi \
|
---|
178 | PcAtChipsetPkg/KbcResetDxe/Reset/$(VBOX_EFI_DEBUG_DIR)/KbcReset \
|
---|
179 | PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/PcRtc \
|
---|
180 | PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe/$(VBOX_EFI_DEBUG_DIR)/PciHostBridge \
|
---|
181 | ShellPkg/Application/Shell/Shell/$(VBOX_EFI_DEBUG_DIR)/Shell \
|
---|
182 | UefiCpuPkg/CpuDxe/CpuDxe/$(VBOX_EFI_DEBUG_DIR)/CpuDxe \
|
---|
183 | UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe/$(VBOX_EFI_DEBUG_DIR)/CpuIo2Dxe \
|
---|
184 | VBoxPkg/VBoxAppleSim/VBoxAppleSim/$(VBOX_EFI_DEBUG_DIR)/VBoxAppleSim \
|
---|
185 | VBoxPkg/VBoxFsDxe/VBoxHfs/$(VBOX_EFI_DEBUG_DIR)/VBoxHfs \
|
---|
186 | VBoxPkg/VBoxFsDxe/VBoxIso9660/$(VBOX_EFI_DEBUG_DIR)/VBoxIso9600 \
|
---|
187 | VBoxPkg/VBoxSysTables/VBoxSysTables/$(VBOX_EFI_DEBUG_DIR)/VBoxSysTables \
|
---|
188 | VBoxPkg/VBoxVgaDxe/VBoxVgaDxe/$(VBOX_EFI_DEBUG_DIR)/VBoxVgaDxe \
|
---|
189 | VBoxPkg/VBoxVgaMiniPortDxe/VBoxVgaMiniPortDxe/$(VBOX_EFI_DEBUG_DIR)/VBoxVgaMiniPortDxe
|
---|
190 |
|
---|
191 | # Version of VBOX_EFI_MODULES without directories. (Using $(value ) to avoid
|
---|
192 | # expanding all the build target macros and then immediately discarding them.)
|
---|
193 | VBOX_EFI_MODULES_FLAT = $(notdir $(value VBOX_EFI_MODULES))
|
---|
194 |
|
---|