]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFspWrapperPkg/FspWrapperSecCore/Vtf0/Build.py
IntelFspWrapperPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFspWrapperPkg / FspWrapperSecCore / Vtf0 / Build.py
CommitLineData
a33a2f62
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
19486360 6# SPDX-License-Identifier: BSD-2-Clause-Patent\r
a33a2f62
JY
7#\r
8\r
9import glob\r
10import os\r
11import subprocess\r
12import sys\r
13\r
14def RunCommand(commandLine):\r
15 #print ' '.join(commandLine)\r
16 return subprocess.call(commandLine)\r
17\r
18for filename in glob.glob(os.path.join('Bin', '*.raw')):\r
19 os.remove(filename)\r
20\r
21arch = 'ia32'\r
22debugType = None\r
23output = os.path.join('Bin', 'ResetVec')\r
24output += '.' + arch\r
25if debugType is not None:\r
26 output += '.' + debugType\r
27output += '.raw'\r
28commandLine = (\r
29 'nasm',\r
30 '-D', 'ARCH_%s' % arch.upper(),\r
31 '-D', 'DEBUG_%s' % str(debugType).upper(),\r
32 '-o', output,\r
33 'ResetVectorCode.asm',\r
34 )\r
35ret = RunCommand(commandLine)\r
36print '\tASM\t' + output\r
37if ret != 0: sys.exit(ret)\r
38\r
39commandLine = (\r
40 'python',\r
41 'Tools/FixupForRawSection.py',\r
42 output,\r
43 )\r
44print '\tFIXUP\t' + output\r
45ret = RunCommand(commandLine)\r
46if ret != 0: sys.exit(ret)\r
47\r