--- a/targets/toolchain_gcc.py Tue May 08 22:27:49 2012 +0200
+++ b/targets/toolchain_gcc.py Wed May 09 00:00:50 2012 +0200
@@ -10,23 +10,23 @@
It cannot be used as this and should be inherited in a target specific
class such as target_linux or target_win32
"""
- def __init__(self, ConfigTreeRootInstance):
- self.ConfigTreeRootInstance = ConfigTreeRootInstance
+ def __init__(self, CTRInstance):
+ self.CTRInstance = CTRInstance
self.buildpath = None
- self.SetBuildPath(self.ConfigTreeRootInstance._getBuildPath())
+ self.SetBuildPath(self.CTRInstance._getBuildPath())
def getBuilderCFLAGS(self):
"""
Returns list of builder specific CFLAGS
"""
- return [self.ConfigTreeRootInstance.GetTarget().getcontent()["value"].getCFLAGS()]
+ return [self.CTRInstance.GetTarget().getcontent()["value"].getCFLAGS()]
def getBuilderLDFLAGS(self):
"""
Returns list of builder specific LDFLAGS
"""
- return self.ConfigTreeRootInstance.LDFLAGS + \
- [self.ConfigTreeRootInstance.GetTarget().getcontent()["value"].getLDFLAGS()]
+ return self.CTRInstance.LDFLAGS + \
+ [self.CTRInstance.GetTarget().getcontent()["value"].getLDFLAGS()]
def GetBinaryCode(self):
try:
@@ -56,7 +56,7 @@
def SetBuildPath(self, buildpath):
if self.buildpath != buildpath:
self.buildpath = buildpath
- self.exe = self.ConfigTreeRootInstance.GetProjectName() + self.extension
+ self.exe = self.CTRInstance.GetProjectName() + self.extension
self.exe_path = os.path.join(self.buildpath, self.exe)
self.md5key = None
self.srcmd5 = {}
@@ -89,7 +89,7 @@
def build(self):
# Retrieve toolchain user parameters
- toolchain_params = self.ConfigTreeRootInstance.GetTarget().getcontent()["value"]
+ toolchain_params = self.CTRInstance.GetTarget().getcontent()["value"]
self.compiler = toolchain_params.getCompiler()
self.linker = toolchain_params.getLinker()
@@ -99,11 +99,11 @@
obns = []
objs = []
relink = False
- for Location, CFilesAndCFLAGS, DoCalls in self.ConfigTreeRootInstance.LocationCFilesAndCFLAGS:
+ for Location, CFilesAndCFLAGS, DoCalls in self.CTRInstance.LocationCFilesAndCFLAGS:
if Location:
- self.ConfigTreeRootInstance.logger.write(_("ConfNode : ") + self.ConfigTreeRootInstance.GetChildByIECLocation(Location).GetCurrentName() + " " + str(Location)+"\n")
+ self.CTRInstance.logger.write(_("ConfNode : ") + self.CTRInstance.GetChildByIECLocation(Location).GetCurrentName() + " " + str(Location)+"\n")
else:
- self.ConfigTreeRootInstance.logger.write(_("PLC :\n"))
+ self.CTRInstance.logger.write(_("PLC :\n"))
for CFile, CFLAGS in CFilesAndCFLAGS:
if CFile.endswith(".c"):
@@ -114,21 +114,21 @@
match = self.check_and_update_hash_and_deps(bn)
if match:
- self.ConfigTreeRootInstance.logger.write(" [pass] "+bn+" -> "+obn+"\n")
+ self.CTRInstance.logger.write(" [pass] "+bn+" -> "+obn+"\n")
else:
relink = True
- self.ConfigTreeRootInstance.logger.write(" [CC] "+bn+" -> "+obn+"\n")
+ self.CTRInstance.logger.write(" [CC] "+bn+" -> "+obn+"\n")
status, result, err_result = ProcessLogger(
- self.ConfigTreeRootInstance.logger,
+ self.CTRInstance.logger,
"\"%s\" -c \"%s\" -o \"%s\" %s %s"%
(self.compiler, CFile, objectfilename, Builder_CFLAGS, CFLAGS)
).spin()
if status :
self.srcmd5.pop(bn)
- self.ConfigTreeRootInstance.logger.write_error(_("C compilation of %s failed.\n")%bn)
+ self.CTRInstance.logger.write_error(_("C compilation of %s failed.\n")%bn)
return False
obns.append(obn)
objs.append(objectfilename)
@@ -138,7 +138,7 @@
######### GENERATE library FILE ########################################
# Link all the object files into one binary file
- self.ConfigTreeRootInstance.logger.write(_("Linking :\n"))
+ self.CTRInstance.logger.write(_("Linking :\n"))
if relink:
objstring = []
@@ -147,10 +147,10 @@
ALLldflags = ' '.join(self.getBuilderLDFLAGS())
- self.ConfigTreeRootInstance.logger.write(" [CC] " + ' '.join(obns)+" -> " + self.exe + "\n")
+ self.CTRInstance.logger.write(" [CC] " + ' '.join(obns)+" -> " + self.exe + "\n")
status, result, err_result = ProcessLogger(
- self.ConfigTreeRootInstance.logger,
+ self.CTRInstance.logger,
"\"%s\" %s -o \"%s\" %s"%
(self.linker,
listobjstring,
@@ -162,7 +162,7 @@
return False
else:
- self.ConfigTreeRootInstance.logger.write(" [pass] " + ' '.join(obns)+" -> " + self.exe + "\n")
+ self.CTRInstance.logger.write(" [pass] " + ' '.join(obns)+" -> " + self.exe + "\n")
# Calculate md5 key and get data for the new created PLC
data=self.GetBinaryCode()