summaryrefslogtreecommitdiff
path: root/src/VBox/Devices/EFI/Firmware/Config.kmk
blob: 015d348e5ed6378ccac238a0881832eb81c28846 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# $Id: Config.kmk $
## @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 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)


#
# 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 name of the subdirectory which the .pdb, .efi and other output files ends
# up in, apparently.  In the generated makefiles, DEBUG_DIR points to them.
#
VBOX_EFI_DEBUG_DIR = DEBUG

#
# List of modules that ends up producing .efi, .debug and .pdb files.
#
VBOX_EFI_MODULES = \
	IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe/$(VBOX_EFI_DEBUG_DIR)/IsaBusDxe \
	IntelFrameworkModulePkg/Bus/Isa/IsaFloppyDxe/IsaFloppyDxe/$(VBOX_EFI_DEBUG_DIR)/IsaFloppyDxe \
	IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe/$(VBOX_EFI_DEBUG_DIR)/IsaIoDxe \
	IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe/$(VBOX_EFI_DEBUG_DIR)/IsaSerialDxe \
	IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe/$(VBOX_EFI_DEBUG_DIR)/Ps2KeyboardDxe \
	IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe/$(VBOX_EFI_DEBUG_DIR)/IdeBusDxe \
	IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe/$(VBOX_EFI_DEBUG_DIR)/BdsDxe \
	IntelFrameworkModulePkg/Universal/DataHubDxe/DataHubDxe/$(VBOX_EFI_DEBUG_DIR)/DataHubDxe \
	IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei/$(VBOX_EFI_DEBUG_DIR)/StatusCodePei \
	IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/StatusCodeRuntimeDxe \
	MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru/$(VBOX_EFI_DEBUG_DIR)/AtaAtapiPassThruDxe \
	MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe/$(VBOX_EFI_DEBUG_DIR)/AtaBusDxe \
	MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe/$(VBOX_EFI_DEBUG_DIR)/EhciDxe \
	MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe/$(VBOX_EFI_DEBUG_DIR)/PciBusDxe \
	MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe/$(VBOX_EFI_DEBUG_DIR)/ScsiBus \
	MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe/$(VBOX_EFI_DEBUG_DIR)/ScsiDisk \
	MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe/$(VBOX_EFI_DEBUG_DIR)/UsbBusDxe \
	MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe/$(VBOX_EFI_DEBUG_DIR)/UsbKbDxe \
	MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe/$(VBOX_EFI_DEBUG_DIR)/UsbMassStorageDxe \
	MdeModulePkg/Core/Dxe/DxeMain/$(VBOX_EFI_DEBUG_DIR)/DxeCore \
	MdeModulePkg/Core/DxeIplPeim/DxeIpl/$(VBOX_EFI_DEBUG_DIR)/DxeIpl \
	MdeModulePkg/Core/Pei/PeiMain/$(VBOX_EFI_DEBUG_DIR)/PeiCore \
	MdeModulePkg/Core/RuntimeDxe/RuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/RuntimeDxe \
	MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe/$(VBOX_EFI_DEBUG_DIR)/AcpiTableDxe \
	MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/CapsuleRuntimeDxe \
	MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe/$(VBOX_EFI_DEBUG_DIR)/ConPlatformDxe \
	MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe/$(VBOX_EFI_DEBUG_DIR)/ConSplitterDxe \
	MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe/$(VBOX_EFI_DEBUG_DIR)/GraphicsConsoleDxe \
	MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe/$(VBOX_EFI_DEBUG_DIR)/TerminalDxe \
	MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe/$(VBOX_EFI_DEBUG_DIR)/DevicePathDxe \
	MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe/$(VBOX_EFI_DEBUG_DIR)/DiskIoDxe \
	MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe/$(VBOX_EFI_DEBUG_DIR)/EnglishDxe \
	MdeModulePkg/Universal/EbcDxe/EbcDxe/$(VBOX_EFI_DEBUG_DIR)/EbcDxe \
	MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe/$(VBOX_EFI_DEBUG_DIR)/FaultTolerantWriteDxe \
	MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe/$(VBOX_EFI_DEBUG_DIR)/HiiDatabase \
	MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe/$(VBOX_EFI_DEBUG_DIR)/NullMemoryTestDxe \
	MdeModulePkg/Universal/Metronome/Metronome/$(VBOX_EFI_DEBUG_DIR)/Metronome \
	MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/MonotonicCounterRuntimeDxe \
	MdeModulePkg/Universal/PCD/Dxe/Pcd/$(VBOX_EFI_DEBUG_DIR)/PcdDxe \
	MdeModulePkg/Universal/PCD/Pei/Pcd/$(VBOX_EFI_DEBUG_DIR)/PcdPeim \
	MdeModulePkg/Universal/PrintDxe/PrintDxe/$(VBOX_EFI_DEBUG_DIR)/PrintDxe \
	MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/ReportStatusCodeRouterRuntimeDxe \
	MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe/$(VBOX_EFI_DEBUG_DIR)/SecurityStubDxe \
	MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe/$(VBOX_EFI_DEBUG_DIR)/SetupBrowser \
	MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe/$(VBOX_EFI_DEBUG_DIR)/SmbiosDxe \
	MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/StatusCodeHandlerRuntimeDxe \
	MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer/$(VBOX_EFI_DEBUG_DIR)/WatchdogTimer \
	OvmfPkg/BlockMmioToBlockIoDxe/BlockIo/$(VBOX_EFI_DEBUG_DIR)/BlockMmioToBlockIoDxe \
	OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb/$(VBOX_EFI_DEBUG_DIR)/EmuVariableFvbRuntimeDxe \
	OvmfPkg/Sec/SecMain/$(VBOX_EFI_DEBUG_DIR)/SecMain \
	OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe/$(VBOX_EFI_DEBUG_DIR)/SmbiosPlatformDxe \
	PcAtChipsetPkg/8254TimerDxe/8254Timer/$(VBOX_EFI_DEBUG_DIR)/Timer \
	PcAtChipsetPkg/8259InterruptControllerDxe/8259/$(VBOX_EFI_DEBUG_DIR)/Legacy8259 \
	PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/IdeControllerDxe/$(VBOX_EFI_DEBUG_DIR)/IdeController \
	PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi/$(VBOX_EFI_DEBUG_DIR)/IsaAcpi \
	PcAtChipsetPkg/KbcResetDxe/Reset/$(VBOX_EFI_DEBUG_DIR)/KbcReset \
	PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/PcRtc \
	PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe/$(VBOX_EFI_DEBUG_DIR)/PciHostBridge \
	ShellPkg/Application/Shell/Shell/$(VBOX_EFI_DEBUG_DIR)/Shell \
	UefiCpuPkg/CpuDxe/CpuDxe/$(VBOX_EFI_DEBUG_DIR)/CpuDxe \
	UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe/$(VBOX_EFI_DEBUG_DIR)/CpuIo2Dxe \
	VBoxPkg/AcpiPlatformDxe/AcpiPlatformDxe/$(VBOX_EFI_DEBUG_DIR)/AcpiPlatform \
	VBoxPkg/PartitionDxe/PartitionDxe/$(VBOX_EFI_DEBUG_DIR)/PartitionDxe \
	VBoxPkg/PlatformPei/PlatformPei/$(VBOX_EFI_DEBUG_DIR)/PlatformPei \
	VBoxPkg/VBoxAppleSim/VBoxAppleSim/$(VBOX_EFI_DEBUG_DIR)/VBoxAppleSim \
	VBoxPkg/VBoxFsDxe/VBoxHfs/$(VBOX_EFI_DEBUG_DIR)/VBoxHfs \
	VBoxPkg/VBoxFsDxe/VBoxIso9660/$(VBOX_EFI_DEBUG_DIR)/VBoxIso9600 \
	VBoxPkg/VBoxSysTables/VBoxSysTables/$(VBOX_EFI_DEBUG_DIR)/VBoxSysTables \
	VBoxPkg/VBoxVariable/VBoxVariableRuntimeDxe/$(VBOX_EFI_DEBUG_DIR)/EmuVariableRuntimeDxe \
	VBoxPkg/VBoxVgaDxe/VBoxVgaDxe/$(VBOX_EFI_DEBUG_DIR)/VBoxVgaDxe \
	VBoxPkg/VBoxVgaMiniPortDxe/VBoxVgaMiniPortDxe/$(VBOX_EFI_DEBUG_DIR)/VBoxVgaMiniPortDxe \

# Version of VBOX_EFI_MODULES without directories. (Using $(value ) to avoid
# expanding all the build target macros and then immediately discarding them.)
VBOX_EFI_MODULES_FLAT = $(notdir $(value VBOX_EFI_MODULES))