]>
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 | |
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 | |
15 | import glob\r | |
16 | import os\r | |
17 | import subprocess\r | |
18 | import sys\r | |
19 | \r | |
20 | def RunCommand(commandLine):\r | |
21 | #print ' '.join(commandLine)\r | |
22 | return subprocess.call(commandLine)\r | |
23 | \r | |
24 | for filename in glob.glob(os.path.join('Bin', '*.raw')):\r | |
25 | os.remove(filename)\r | |
26 | \r | |
27 | for arch in ('ia32', 'x64'):\r | |
28 | for debugType in (None, 'port80', 'serial'):\r | |
29 | output = os.path.join('Bin', 'ResetVector')\r | |
30 | output += '.' + arch\r | |
31 | if debugType is not None:\r | |
32 | output += '.' + debugType\r | |
33 | output += '.raw'\r | |
34 | commandLine = (\r | |
35 | 'nasm',\r | |
36 | '-D', 'ARCH_%s' % arch.upper(),\r | |
37 | '-D', 'DEBUG_%s' % str(debugType).upper(),\r | |
38 | '-o', output,\r | |
5a1f324d | 39 | 'Vtf0.nasmb',\r |
7798fb83 HT |
40 | )\r |
41 | ret = RunCommand(commandLine)\r | |
42 | print '\tASM\t' + output\r | |
43 | if ret != 0: sys.exit(ret)\r | |
44 | \r | |
45 | commandLine = (\r | |
46 | 'python',\r | |
47 | 'Tools/FixupForRawSection.py',\r | |
48 | output,\r | |
49 | )\r | |
50 | print '\tFIXUP\t' + output\r | |
51 | ret = RunCommand(commandLine)\r | |
52 | if ret != 0: sys.exit(ret)\r | |
53 | \r |