]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFsp2Pkg/FspSecCore/Vtf0/Build.py
IntelFsp2Pkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFsp2Pkg / FspSecCore / Vtf0 / Build.py
1 ## @file
2 # Automate the process of building the various reset vector types
3 #
4 # Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
5 #
6 # SPDX-License-Identifier: BSD-2-Clause-Patent
7 #
8
9 import glob
10 import os
11 import subprocess
12 import sys
13
14 def RunCommand(commandLine):
15 #print ' '.join(commandLine)
16 return subprocess.call(commandLine)
17
18 for filename in glob.glob(os.path.join('Bin', '*.raw')):
19 os.remove(filename)
20
21 arch = 'ia32'
22 debugType = None
23 output = os.path.join('Bin', 'ResetVec')
24 output += '.' + arch
25 if debugType is not None:
26 output += '.' + debugType
27 output += '.raw'
28 commandLine = (
29 'nasm',
30 '-D', 'ARCH_%s' % arch.upper(),
31 '-D', 'DEBUG_%s' % str(debugType).upper(),
32 '-o', output,
33 'ResetVectorCode.asm',
34 )
35 ret = RunCommand(commandLine)
36 print '\tASM\t' + output
37 if ret != 0: sys.exit(ret)
38
39 commandLine = (
40 'python',
41 'Tools/FixupForRawSection.py',
42 output,
43 )
44 print '\tFIXUP\t' + output
45 ret = RunCommand(commandLine)
46 if ret != 0: sys.exit(ret)
47