17 self.buildpath = PluginsRootInstance._getBuildPath() |
17 self.buildpath = PluginsRootInstance._getBuildPath() |
18 self.exe_path = os.path.join(self.buildpath, self.exe) |
18 self.exe_path = os.path.join(self.buildpath, self.exe) |
19 self.md5key = None |
19 self.md5key = None |
20 self.srcmd5 = {} |
20 self.srcmd5 = {} |
21 |
21 |
|
22 def getTarget(self): |
|
23 target = self.PluginsRootInstance.BeremizRoot.getTargetType() |
|
24 if target.getcontent() is None: |
|
25 target = self.PluginsRootInstance.GetDefaultTarget() |
|
26 return target |
|
27 |
22 def getBuilderCFLAGS(self): |
28 def getBuilderCFLAGS(self): |
23 """ |
29 """ |
24 Returns list of builder specific CFLAGS |
30 Returns list of builder specific CFLAGS |
25 """ |
31 """ |
26 return [self.PluginsRootInstance.BeremizRoot.getTargetType().getcontent()["value"].getCFLAGS()] |
32 return [self.getTarget().getcontent()["value"].getCFLAGS()] |
27 |
33 |
28 def getBuilderLDFLAGS(self): |
34 def getBuilderLDFLAGS(self): |
29 """ |
35 """ |
30 Returns list of builder specific LDFLAGS |
36 Returns list of builder specific LDFLAGS |
31 """ |
37 """ |
32 return self.PluginsRootInstance.LDFLAGS + \ |
38 return self.PluginsRootInstance.LDFLAGS + \ |
33 [self.PluginsRootInstance.BeremizRoot.getTargetType().getcontent()["value"].getLDFLAGS()] |
39 [self.getTarget().getcontent()["value"].getLDFLAGS()] |
34 |
40 |
35 def GetBinaryCode(self): |
41 def GetBinaryCode(self): |
36 try: |
42 try: |
37 return open(self.exe_path, "rb").read() |
43 return open(self.exe_path, "rb").read() |
38 except Exception, e: |
44 except Exception, e: |
76 # TODO detect cicular deps. |
82 # TODO detect cicular deps. |
77 return reduce(operator.and_, map(self.check_and_update_hash_and_deps, deps), match) |
83 return reduce(operator.and_, map(self.check_and_update_hash_and_deps, deps), match) |
78 |
84 |
79 def build(self): |
85 def build(self): |
80 # Retrieve toolchain user parameters |
86 # Retrieve toolchain user parameters |
81 toolchain_params = self.PluginsRootInstance.BeremizRoot.getTargetType().getcontent()["value"] |
87 toolchain_params = self.getTarget().getcontent()["value"] |
82 self.compiler = toolchain_params.getCompiler() |
88 self.compiler = toolchain_params.getCompiler() |
83 self.linker = toolchain_params.getLinker() |
89 self.linker = toolchain_params.getLinker() |
84 |
90 |
85 Builder_CFLAGS = ' '.join(self.getBuilderCFLAGS()) |
91 Builder_CFLAGS = ' '.join(self.getBuilderCFLAGS()) |
86 |
92 |