Mercurial > lcfOS
comparison python/ppci/buildtasks.py @ 335:582a1aaa3983
Added long branch format
author | Windel Bouwman |
---|---|
date | Mon, 17 Feb 2014 20:41:30 +0100 |
parents | 6f4753202b9a |
children | d1ecc493384e |
comparison
equal
deleted
inserted
replaced
334:6f4753202b9a | 335:582a1aaa3983 |
---|---|
14 from . import DiagnosticsManager | 14 from . import DiagnosticsManager |
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 | 20 |
20 class BuildTask(Task): | 21 class BuildTask(Task): |
21 """ Base task for all kind of weird build tasks """ | 22 """ Base task for all kind of weird build tasks """ |
22 def __init__(self, name): | 23 def __init__(self, name): |
23 super().__init__(name) | 24 super().__init__(name) |
69 Verifier().verify(ircode) | 70 Verifier().verify(ircode) |
70 | 71 |
71 # Code generation: | 72 # Code generation: |
72 d = {'ircode':ircode} | 73 d = {'ircode':ircode} |
73 self.logger.debug('Starting code generation for {}'.format(ircode), extra=d) | 74 self.logger.debug('Starting code generation for {}'.format(ircode), extra=d) |
74 o = outstream.TextOutputStream() | 75 o = outstream.BinaryOutputStream(self.output) |
75 cg.generate(ircode, o) | 76 cg.generate(ircode, o) |
76 | 77 |
77 if not c3b.ok: | 78 if not c3b.ok: |
78 diag.printErrors() | 79 diag.printErrors() |
79 raise TaskError('Compile errors') | 80 raise TaskError('Compile errors') |
86 self.objects = objects | 87 self.objects = objects |
87 self.linker = Linker() | 88 self.linker = Linker() |
88 self.duration = 0.1337 | 89 self.duration = 0.1337 |
89 | 90 |
90 def run(self): | 91 def run(self): |
91 print('LNK') | |
92 print('LNK', self.objects) | |
93 print('LNK') | |
94 print('LNK') | |
95 self.linker.link(self.objects) | 92 self.linker.link(self.objects) |
96 | 93 |
97 | 94 |
98 class ObjCopy(Task): | 95 class ObjCopy(Task): |
99 pass | 96 pass |