]>
git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/ResetVector/Build.py
2 # Automate the process of building the various reset vector types
4 # Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
6 # This program and the accompanying materials
7 # are licensed and made available under the terms and conditions of the BSD License
8 # which accompanies this distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 def RunCommand(commandLine
):
21 #print ' '.join(commandLine)
22 return subprocess
.call(commandLine
)
24 for filename
in glob
.glob(os
.path
.join('Bin', '*.raw')):
27 ThisDir
= os
.path
.realpath(os
.path
.split(sys
.argv
[0])[0])
28 WorkspaceDir
= os
.path
.realpath(os
.path
.join(ThisDir
, '..', '..'))
29 UefiCpuPkgVtf0Dir
= os
.path
.join(WorkspaceDir
, 'UefiCpuPkg', 'ResetVector', 'Vtf0')
32 for debugType
in (None,):
33 output
= os
.path
.join('Bin', 'ResetVector')
35 if debugType
is not None:
36 output
+= '.' + debugType
40 '-D', 'ARCH_%s' % arch
.upper(),
41 '-D', 'DEBUG_%s' % str(debugType
).upper(),
42 '-I', UefiCpuPkgVtf0Dir
+ os
.path
.sep
,
44 'ResetVectorCode.asm',
46 ret
= RunCommand(commandLine
)
47 print '\tASM\t' + output
48 if ret
!= 0: sys
.exit(ret
)
52 'Tools/FixupForRawSection.py',
55 print '\tFIXUP\t' + output
56 ret
= RunCommand(commandLine
)
57 if ret
!= 0: sys
.exit(ret
)