comparison python/ppci/buildtasks.py @ 337:b00219172a42

Added cool lm3s811 qemu project
author Windel Bouwman
date Thu, 20 Feb 2014 20:04:52 +0100
parents d1ecc493384e
children 86b02c98a717
comparison
equal deleted inserted replaced
336:d1ecc493384e 337:b00219172a42
8 8
9 from .c3 import Builder 9 from .c3 import Builder
10 from .irutils import Verifier 10 from .irutils import Verifier
11 from .codegen import CodeGenerator 11 from .codegen import CodeGenerator
12 from .transform import CleanPass, RemoveAddZero 12 from .transform import CleanPass, RemoveAddZero
13 from .tasks import Task 13 from .tasks import Task, TaskError
14 from . import DiagnosticsManager 14 from . import DiagnosticsManager, CompilerError
15 from .assembler import Assembler 15 from .assembler import Assembler
16 from .objectfile import ObjectFile 16 from .objectfile import ObjectFile
17 from .linker import Linker 17 from .linker import Linker
18 import outstream 18 import outstream
19 19
91 self.duration = 0.1337 91 self.duration = 0.1337
92 self.layout = layout 92 self.layout = layout
93 self.output_file = output_file 93 self.output_file = output_file
94 94
95 def run(self): 95 def run(self):
96 output_obj = self.linker.link(self.objects, self.layout) 96 try:
97 output_obj = self.linker.link(self.objects, self.layout)
98 except CompilerError as e:
99 raise TaskError(e.msg)
97 code = output_obj.get_section('code').data 100 code = output_obj.get_section('code').data
98 with open(self.output_file, 'wb') as f: 101 with open(self.output_file, 'wb') as f:
99 f.write(code) 102 f.write(code)
100 103
101 104