]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFsp2Pkg/FspSecCore/Vtf0/Build.py
IntelFsp2Pkg: Add missing OEM status code defines.
[mirror_edk2.git] / IntelFsp2Pkg / FspSecCore / Vtf0 / Build.py
CommitLineData
cf1d4549
JY
1## @file\r
2# Automate the process of building the various reset vector types\r
3#\r
4# Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
5#\r
6# This program and the accompanying materials\r
7# are licensed and made available under the terms and conditions of the BSD License\r
8# which accompanies this distribution. The full text of the license may be found at\r
9# http://opensource.org/licenses/bsd-license.php\r
10#\r
11# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13#\r
14\r
15import glob\r
16import os\r
17import subprocess\r
18import sys\r
19\r
20def RunCommand(commandLine):\r
21 #print ' '.join(commandLine)\r
22 return subprocess.call(commandLine)\r
23\r
24for filename in glob.glob(os.path.join('Bin', '*.raw')):\r
25 os.remove(filename)\r
26\r
27arch = 'ia32'\r
28debugType = None\r
29output = os.path.join('Bin', 'ResetVec')\r
30output += '.' + arch\r
31if debugType is not None:\r
32 output += '.' + debugType\r
33output += '.raw'\r
34commandLine = (\r
35 'nasm',\r
36 '-D', 'ARCH_%s' % arch.upper(),\r
37 '-D', 'DEBUG_%s' % str(debugType).upper(),\r
38 '-o', output,\r
39 'ResetVectorCode.asm',\r
40 )\r
41ret = RunCommand(commandLine)\r
42print '\tASM\t' + output\r
43if ret != 0: sys.exit(ret)\r
44\r
45commandLine = (\r
46 'python',\r
47 'Tools/FixupForRawSection.py',\r
48 output,\r
49 )\r
50print '\tFIXUP\t' + output\r
51ret = RunCommand(commandLine)\r
52if ret != 0: sys.exit(ret)\r
53\r