targets/toolchain_gcc.py
changeset 693 96fcadb6a7a0
parent 677 607731b33026
child 717 1c23952dbde1
equal deleted inserted replaced
692:8b1ed486f374 693:96fcadb6a7a0
   104                 self.PluginsRootInstance.logger.write(_("Plugin : ") + self.PluginsRootInstance.GetChildByIECLocation(Location).GetCurrentName() + " " + str(Location)+"\n")
   104                 self.PluginsRootInstance.logger.write(_("Plugin : ") + self.PluginsRootInstance.GetChildByIECLocation(Location).GetCurrentName() + " " + str(Location)+"\n")
   105             else:
   105             else:
   106                 self.PluginsRootInstance.logger.write(_("PLC :\n"))
   106                 self.PluginsRootInstance.logger.write(_("PLC :\n"))
   107                 
   107                 
   108             for CFile, CFLAGS in CFilesAndCFLAGS:
   108             for CFile, CFLAGS in CFilesAndCFLAGS:
   109                 bn = os.path.basename(CFile)
   109                 if CFile.endswith(".c"):
   110                 obn = os.path.splitext(bn)[0]+".o"
   110                     bn = os.path.basename(CFile)
   111                 objectfilename = os.path.splitext(CFile)[0]+".o"
   111                     obn = os.path.splitext(bn)[0]+".o"
       
   112                     objectfilename = os.path.splitext(CFile)[0]+".o"
   112 
   113 
   113                 match = self.check_and_update_hash_and_deps(bn)
   114                     match = self.check_and_update_hash_and_deps(bn)
   114                 
   115                     
   115                 if match:
   116                     if match:
   116                     self.PluginsRootInstance.logger.write("   [pass]  "+bn+" -> "+obn+"\n")
   117                         self.PluginsRootInstance.logger.write("   [pass]  "+bn+" -> "+obn+"\n")
   117                 else:
   118                     else:
   118                     relink = True
   119                         relink = True
   119 
   120 
   120                     self.PluginsRootInstance.logger.write("   [CC]  "+bn+" -> "+obn+"\n")
   121                         self.PluginsRootInstance.logger.write("   [CC]  "+bn+" -> "+obn+"\n")
   121                     
   122                         
   122                     status, result, err_result = ProcessLogger(
   123                         status, result, err_result = ProcessLogger(
   123                            self.PluginsRootInstance.logger,
   124                                self.PluginsRootInstance.logger,
   124                            "\"%s\" -c \"%s\" -o \"%s\" %s %s"%
   125                                "\"%s\" -c \"%s\" -o \"%s\" %s %s"%
   125                                (self.compiler, CFile, objectfilename, Builder_CFLAGS, CFLAGS)
   126                                    (self.compiler, CFile, objectfilename, Builder_CFLAGS, CFLAGS)
   126                            ).spin()
   127                                ).spin()
   127 
   128 
   128                     if status :
   129                         if status :
   129                         self.srcmd5.pop(bn)
   130                             self.srcmd5.pop(bn)
   130                         self.PluginsRootInstance.logger.write_error(_("C compilation of %s failed.\n")%bn)
   131                             self.PluginsRootInstance.logger.write_error(_("C compilation of %s failed.\n")%bn)
   131                         return False
   132                             return False
   132 
   133                     obns.append(obn)
   133                 obns.append(obn)
   134                     objs.append(objectfilename)
   134                 objs.append(objectfilename)
   135                 elif CFile.endswith(".o"):
       
   136                     obns.append(os.path.basename(CFile))
       
   137                     objs.append(CFile)
   135 
   138 
   136         ######### GENERATE library FILE ########################################
   139         ######### GENERATE library FILE ########################################
   137         # Link all the object files into one binary file
   140         # Link all the object files into one binary file
   138         self.PluginsRootInstance.logger.write(_("Linking :\n"))
   141         self.PluginsRootInstance.logger.write(_("Linking :\n"))
   139         if relink:
   142         if relink: