targets/toolchain_makefile.py
changeset 725 31dade089db5
parent 722 a94f361fc42e
child 726 ae63ccc29444
--- a/targets/toolchain_makefile.py	Tue May 08 22:27:49 2012 +0200
+++ b/targets/toolchain_makefile.py	Wed May 09 00:00:50 2012 +0200
@@ -7,11 +7,11 @@
 includes_re =  re.compile('\s*#include\s*["<]([^">]*)[">].*')
 
 class toolchain_makefile():
-    def __init__(self, ConfigTreeRootInstance):
-        self.ConfigTreeRootInstance = ConfigTreeRootInstance
+    def __init__(self, CTRInstance):
+        self.CTRInstance = CTRInstance
         self.md5key = None 
         self.buildpath = None
-        self.SetBuildPath(self.ConfigTreeRootInstance._getBuildPath())
+        self.SetBuildPath(self.CTRInstance._getBuildPath())
 
     def SetBuildPath(self, buildpath):
         if self.buildpath != buildpath:
@@ -60,7 +60,7 @@
         srcfiles= []
         cflags = []
         wholesrcdata = "" 
-        for Location, CFilesAndCFLAGS, DoCalls in self.ConfigTreeRootInstance.LocationCFilesAndCFLAGS:
+        for Location, CFilesAndCFLAGS, DoCalls in self.CTRInstance.LocationCFilesAndCFLAGS:
             # Get CFiles list to give it to makefile
             for CFile, CFLAGS in CFilesAndCFLAGS:
                 CFileName = os.path.basename(CFile)
@@ -72,7 +72,7 @@
                         
         oldmd5 = self.md5key
         self.md5key = hashlib.md5(wholesrcdata).hexdigest()
-        props = self.ConfigTreeRootInstance.GetProjectProperties()
+        props = self.CTRInstance.GetProjectProperties()
         self.md5key += '#'.join([props[key] for key in ['companyName',
                                                         'projectName',
                                                         'productName']])
@@ -88,21 +88,21 @@
                               "md5": '"'+self.md5key+'"'
                              }
             
-            target = self.ConfigTreeRootInstance.GetTarget().getcontent()["value"]
+            target = self.CTRInstance.GetTarget().getcontent()["value"]
             command = target.getCommand().split(' ') +\
                       [target.getBuildPath()] +\
                       [arg % beremizcommand for arg in target.getArguments().split(' ')] +\
                       target.getRule().split(' ')
             
             # Call Makefile to build PLC code and link it with target specific code
-            status, result, err_result = ProcessLogger(self.ConfigTreeRootInstance.logger,
+            status, result, err_result = ProcessLogger(self.CTRInstance.logger,
                                                        command).spin()
             if status :
                 self.md5key = None
-                self.ConfigTreeRootInstance.logger.write_error(_("C compilation failed.\n"))
+                self.CTRInstance.logger.write_error(_("C compilation failed.\n"))
                 return False
             return True
         else :
-            self.ConfigTreeRootInstance.logger.write(_("Source didn't change, no build.\n"))
+            self.CTRInstance.logger.write(_("Source didn't change, no build.\n"))
             return True