# HG changeset patch # User Edouard Tisserant # Date 1329614424 -3600 # Node ID 96fcadb6a7a001a8db01c8694e7ea7120254585b # Parent 8b1ed486f3747db88113fed0395b4f2bbde1e588 Added support for object files as a result of PlugGenerate_C diff -r 8b1ed486f374 -r 96fcadb6a7a0 targets/toolchain_gcc.py --- a/targets/toolchain_gcc.py Thu Feb 16 22:54:44 2012 +0100 +++ b/targets/toolchain_gcc.py Sun Feb 19 02:20:24 2012 +0100 @@ -106,32 +106,35 @@ self.PluginsRootInstance.logger.write(_("PLC :\n")) for CFile, CFLAGS in CFilesAndCFLAGS: - bn = os.path.basename(CFile) - obn = os.path.splitext(bn)[0]+".o" - objectfilename = os.path.splitext(CFile)[0]+".o" + if CFile.endswith(".c"): + bn = os.path.basename(CFile) + obn = os.path.splitext(bn)[0]+".o" + objectfilename = os.path.splitext(CFile)[0]+".o" - match = self.check_and_update_hash_and_deps(bn) - - if match: - self.PluginsRootInstance.logger.write(" [pass] "+bn+" -> "+obn+"\n") - else: - relink = True + match = self.check_and_update_hash_and_deps(bn) + + if match: + self.PluginsRootInstance.logger.write(" [pass] "+bn+" -> "+obn+"\n") + else: + relink = True - self.PluginsRootInstance.logger.write(" [CC] "+bn+" -> "+obn+"\n") - - status, result, err_result = ProcessLogger( - self.PluginsRootInstance.logger, - "\"%s\" -c \"%s\" -o \"%s\" %s %s"% - (self.compiler, CFile, objectfilename, Builder_CFLAGS, CFLAGS) - ).spin() + self.PluginsRootInstance.logger.write(" [CC] "+bn+" -> "+obn+"\n") + + status, result, err_result = ProcessLogger( + self.PluginsRootInstance.logger, + "\"%s\" -c \"%s\" -o \"%s\" %s %s"% + (self.compiler, CFile, objectfilename, Builder_CFLAGS, CFLAGS) + ).spin() - if status : - self.srcmd5.pop(bn) - self.PluginsRootInstance.logger.write_error(_("C compilation of %s failed.\n")%bn) - return False - - obns.append(obn) - objs.append(objectfilename) + if status : + self.srcmd5.pop(bn) + self.PluginsRootInstance.logger.write_error(_("C compilation of %s failed.\n")%bn) + return False + obns.append(obn) + objs.append(objectfilename) + elif CFile.endswith(".o"): + obns.append(os.path.basename(CFile)) + objs.append(CFile) ######### GENERATE library FILE ######################################## # Link all the object files into one binary file