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