71 return self.CTRInstance.GetTarget().getcontent().getLinker() |
71 return self.CTRInstance.GetTarget().getcontent().getLinker() |
72 |
72 |
73 def GetBinaryCode(self): |
73 def GetBinaryCode(self): |
74 try: |
74 try: |
75 return open(self.exe_path, "rb").read() |
75 return open(self.exe_path, "rb").read() |
76 except Exception, e: |
76 except Exception: |
77 return None |
77 return None |
78 |
78 |
79 def _GetMD5FileName(self): |
79 def _GetMD5FileName(self): |
80 return os.path.join(self.buildpath, "lastbuildPLC.md5") |
80 return os.path.join(self.buildpath, "lastbuildPLC.md5") |
81 |
81 |
82 def ResetBinaryCodeMD5(self): |
82 def ResetBinaryCodeMD5(self): |
83 self.md5key = None |
83 self.md5key = None |
84 try: |
84 try: |
85 os.remove(self._GetMD5FileName()) |
85 os.remove(self._GetMD5FileName()) |
86 except Exception, e: |
86 except Exception: |
87 pass |
87 pass |
88 |
88 |
89 def GetBinaryCodeMD5(self): |
89 def GetBinaryCodeMD5(self): |
90 if self.md5key is not None: |
90 if self.md5key is not None: |
91 return self.md5key |
91 return self.md5key |
92 else: |
92 else: |
93 try: |
93 try: |
94 return open(self._GetMD5FileName(), "r").read() |
94 return open(self._GetMD5FileName(), "r").read() |
95 except Exception, e: |
95 except Exception: |
96 return None |
96 return None |
97 |
97 |
98 def SetBuildPath(self, buildpath): |
98 def SetBuildPath(self, buildpath): |
99 if self.buildpath != buildpath: |
99 if self.buildpath != buildpath: |
100 self.buildpath = buildpath |
100 self.buildpath = buildpath |
204 |
204 |
205 # ---------------- GENERATE OUTPUT FILE -------------------------- |
205 # ---------------- GENERATE OUTPUT FILE -------------------------- |
206 # Link all the object files into one binary file |
206 # Link all the object files into one binary file |
207 self.CTRInstance.logger.write(_("Linking :\n")) |
207 self.CTRInstance.logger.write(_("Linking :\n")) |
208 if relink: |
208 if relink: |
209 objstring = [] |
|
210 |
|
211 # Generate list .o files |
209 # Generate list .o files |
212 listobjstring = '"' + '" "'.join(objs) + '"' |
210 listobjstring = '"' + '" "'.join(objs) + '"' |
213 |
211 |
214 ALLldflags = ' '.join(self.getBuilderLDFLAGS()) |
212 ALLldflags = ' '.join(self.getBuilderLDFLAGS()) |
215 |
213 |