diff --git a/builder/lutinBuilder_binary.py b/builder/lutinBuilder_binary.py index e69de29..909c370 100644 --- a/builder/lutinBuilder_binary.py +++ b/builder/lutinBuilder_binary.py @@ -0,0 +1,54 @@ +## +## Executable/binary builder +## + +## +## Get the current builder type. +## Return the type of builder +## +def getType(): + return "linker" + + +## +## @brief Commands for running gcc to link an executable. +## +def link(self, file, binary, target, depancy, libName=""): + if libName=="": + libName = self.name + file_src, file_dst, file_depend, file_cmd = target.generate_file(binary, libName,self.originFolder,file,"bin") + #create comdLine : + cmdLine=lutinTools.list_to_str([ + target.xx, + target.arch, + target.sysroot, + target.global_sysroot, + "-o", file_dst, + file_src, + depancy.src, + self.flags_ld, + depancy.flags_ld, + target.global_flags_ld]) + # check the dependency for this file : + if dependency.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \ + and dependency.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False: + return file_dst + lutinTools.create_directory_of_file(file_dst) + debug.print_element("Executable", libName, "==>", file_dst) + + lutinMultiprocess.run_command(cmdLine) + if target.config["mode"] == "release"\ + or lutinEnv.get_force_strip_mode() == True: + # get the file size of the non strip file + originSize = lutinTools.file_size(file_dst); + debug.print_element("Executable(strip)", libName, "", "") + cmdLineStrip=lutinTools.list_to_str([ + target.strip, + file_dst]) + lutinMultiprocess.run_command(cmdLineStrip) + # get the stip size of the binary + stripSize = lutinTools.file_size(file_dst) + debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko") + # write cmd line only after to prevent errors ... + lutinMultiprocess.store_command(cmdLine, file_cmd) + \ No newline at end of file diff --git a/builder/lutinBuilder_c.py b/builder/lutinBuilder_c.py index e69de29..da493c6 100644 --- a/builder/lutinBuilder_c.py +++ b/builder/lutinBuilder_c.py @@ -0,0 +1,50 @@ +## +## C builder +## + +## +## Get the current builder type. +## Return the type of builder +## +def getType(): + return "compiler" + +## +## @brief Get builder file type +## @return List of extention supported +## +def getBuildType(): + return ["c", "C"] + +## +## @brief Commands for running gcc to compile a C file in object file. +## +def compile(self, file, binary, target, depancy): + file_src, file_dst, file_depend, file_cmd = target.file_generate_object(binary,self.name,self.originFolder,file) + # create the command line befor requesting start: + cmdLine=lutinTools.list_to_str([ + target.cc, + "-o", file_dst, + target.arch, + target.sysroot, + target.global_include_cc, + lutinTools.add_prefix("-I",self.export_path), + lutinTools.add_prefix("-I",self.local_path), + lutinTools.add_prefix("-I",depancy.path), + self.get_c_version_compilation_flags(depancy.flags_cc_version), + target.global_flags_cc, + depancy.flags_cc, + self.flags_cc, + self.export_flags_cc, + " -c -MMD -MP", + file_src]) + + # check the dependency for this file : + if False==dependency.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine): + return file_dst + lutinTools.create_directory_of_file(file_dst) + comment = ["c", self.name, "<==", file] + # process element + lutinMultiprocess.run_in_pool(cmdLine, comment, file_cmd) + return file_dst + \ No newline at end of file diff --git a/builder/lutinBuilder_cpp.py b/builder/lutinBuilder_cpp.py index e69de29..106e26a 100644 --- a/builder/lutinBuilder_cpp.py +++ b/builder/lutinBuilder_cpp.py @@ -0,0 +1,54 @@ +## +## C++ builder +## + +## +## Get the current builder type. +## Return the type of builder +## +def getType(): + return "compiler" + +## +## @brief Get builder file type +## @return List of extention supported +## +def getBuildType(): + return ["cpp", "CPP", "cxx", "CXX", "xx", "XX", "CC", "cc"] + + +## +## @brief Commands for running gcc to compile a C++ file in object file. +## +def compile(self, file, binary, target, depancy): + file_src, file_dst, file_depend, file_cmd = target.file_generate_object(binary,self.name,self.originFolder,file) + + # create the command line befor requesting start: + cmdLine=lutinTools.list_to_str([ + target.xx, + "-o", file_dst, + target.arch, + target.sysroot, + target.global_include_cc, + lutinTools.add_prefix("-I",self.export_path), + lutinTools.add_prefix("-I",self.local_path), + lutinTools.add_prefix("-I",depancy.path), + self.get_xx_version_compilation_flags(depancy.flags_xx_version), + target.global_flags_cc, + target.global_flags_xx, + depancy.flags_cc, + depancy.flags_xx, + self.flags_xx, + self.flags_cc, + self.export_flags_xx, + self.export_flags_cc, + " -c -MMD -MP", + file_src]) + # check the dependency for this file : + if False==dependency.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine): + return file_dst + lutinTools.create_directory_of_file(file_dst) + comment = ["c++", self.name, "<==", file] + #process element + lutinMultiprocess.run_in_pool(cmdLine, comment, file_cmd) + return file_dst diff --git a/builder/lutinBuilder_java.py b/builder/lutinBuilder_java.py index e69de29..84ae4a8 100644 --- a/builder/lutinBuilder_java.py +++ b/builder/lutinBuilder_java.py @@ -0,0 +1,17 @@ +## +## Java builder +## + +## +## Get the current builder type. +## Return the type of builder +## +def getType(): + return "compiler" + +## +## @brief Get builder file type +## @return List of extention supported +## +def getBuildType(): + return ["java"] diff --git a/builder/lutinBuilder_library.py b/builder/lutinBuilder_library.py deleted file mode 100644 index e69de29..0000000 diff --git a/builder/lutinBuilder_libraryDynamic.py b/builder/lutinBuilder_libraryDynamic.py new file mode 100644 index 0000000..c43667c --- /dev/null +++ b/builder/lutinBuilder_libraryDynamic.py @@ -0,0 +1,54 @@ +## +## Dynamic library builder +## + +## +## Get the current builder type. +## Return the type of builder +## +def getType(): + return "linker" + +## +## @brief Commands for running gcc to link a shared library. +## +def link(self, file, binary, target, depancy, libName=""): + if libName=="": + libName = self.name + file_src, file_dst, file_depend, file_cmd = target.generate_file(binary, libName,self.originFolder,file,"lib-shared") + #create command Line + cmdLine=lutinTools.list_to_str([ + target.xx, + "-o", file_dst, + target.global_sysroot, + target.arch, + "-shared", + file_src, + depancy.src, + self.flags_ld, + depancy.flags_ld, + target.global_flags_ld]) + + # check the dependency for this file : + if dependency.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \ + and dependency.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False: + return tmpList[1] + lutinTools.create_directory_of_file(file_dst) + debug.print_element("SharedLib", libName, "==>", file_dst) + lutinMultiprocess.run_command(cmdLine) + # strip the output file: + if target.config["mode"] == "release" \ + or lutinEnv.get_force_strip_mode() == True: + # get the file size of the non strip file + originSize = lutinTools.file_size(file_dst); + debug.print_element("SharedLib(strip)", libName, "", "") + cmdLineStrip=lutinTools.list_to_str([ + target.strip, + file_dst]) + lutinMultiprocess.run_command(cmdLineStrip) + # get the stip size of the binary + stripSize = lutinTools.file_size(file_dst) + debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko") + # write cmd line only after to prevent errors ... + lutinMultiprocess.store_command(cmdLine, file_cmd) + #debug.print_element("SharedLib", self.name, "==>", tmpList[1]) diff --git a/builder/lutinBuilder_libraryStatic.py b/builder/lutinBuilder_libraryStatic.py new file mode 100644 index 0000000..d30afa8 --- /dev/null +++ b/builder/lutinBuilder_libraryStatic.py @@ -0,0 +1,46 @@ +## +## Static library builder +## + +## +## Get the current builder type. +## Return the type of builder +## +def getType(): + return "linker" + +## +## @brief Commands for running ar. +## +def link(self, file, binary, target, depancy, libName=""): + if libName == "": + libName = self.name + file_src, file_dst, file_depend, file_cmd = target.generate_file(binary, libName,self.originFolder,file,"lib-static") + #$(Q)$(TARGET_AR) $(TARGET_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@ $(PRIVATE_ALL_OBJECTS) + cmdLine=lutinTools.list_to_str([ + target.ar, + target.global_flags_ar, + self.flags_ar, + file_dst, + file_src])#, + #depancy.src]) + + # check the dependency for this file : + if dependency.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \ + and dependency.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False: + return file_dst + lutinTools.create_directory_of_file(file_dst) + debug.print_element("StaticLib", libName, "==>", file_dst) + # explicitly remove the destination to prevent error ... + if os.path.exists(file_dst) and os.path.isfile(file_dst): + os.remove(file_dst) + lutinMultiprocess.run_command(cmdLine) + #$(Q)$(TARGET_RANLIB) $@ + if target.ranlib != "": + cmdLineRanLib=lutinTools.list_to_str([ + target.ranlib, + file_dst ]) + lutinMultiprocess.run_command(cmdLineRanLib) + # write cmd line only after to prevent errors ... + lutinMultiprocess.store_command(cmdLine, file_cmd) + return file_dst diff --git a/builder/lutinBuilder_m.py b/builder/lutinBuilder_m.py index e69de29..e86a796 100644 --- a/builder/lutinBuilder_m.py +++ b/builder/lutinBuilder_m.py @@ -0,0 +1,54 @@ +## +## Objective-C builder +## + +## +## Get the current builder type. +## Return the type of builder +## +def getType(): + return "compiler" + +## +## @brief Get builder file type +## @return List of extention supported +## +def getBuildType(): + return ["m", "M"] + +## +## @brief Commands for running gcc to compile a m file in object file. +## +def compile(self, file, binary, target, depancy): + file_src, file_dst, file_depend, file_cmd = target.file_generate_object(binary,self.name,self.originFolder,file) + # create the command line befor requesting start: + cmdLine=lutinTools.list_to_str([ + target.cc, + "-o", file_dst , + target.arch, + target.sysroot, + target.global_include_cc, + lutinTools.add_prefix("-I",self.export_path), + lutinTools.add_prefix("-I",self.local_path), + lutinTools.add_prefix("-I",depancy.path), + self.get_c_version_compilation_flags(depancy.flags_cc_version), + target.global_flags_cc, + target.global_flags_m, + depancy.flags_cc, + depancy.flags_m, + self.flags_m, + self.flags_cc, + self.export_flags_m, + self.export_flags_cc, + "-c -MMD -MP", + "-x objective-c", + file_src]) + # check the dependency for this file : + if False==dependency.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine): + return file_dst + lutinTools.create_directory_of_file(file_dst) + comment = ["m", self.name, "<==", file] + #process element + lutinMultiprocess.run_in_pool(cmdLine, comment, file_cmd) + return file_dst + diff --git a/builder/lutinBuilder_mm.py b/builder/lutinBuilder_mm.py index e69de29..327a709 100644 --- a/builder/lutinBuilder_mm.py +++ b/builder/lutinBuilder_mm.py @@ -0,0 +1,53 @@ +## +## Objective C++ builder +## + +## +## Get the current builder type. +## Return the type of builder +## +def getType(): + return "compiler" + +## +## @brief Get builder file type +## @return List of extention supported +## +def getBuildType(): + return ["mm", "MM"] + +## +## @brief Commands for running gcc to compile a m++ file in object file. +## +def compile(self, file, binary, target, depancy): + file_src, file_dst, file_depend, file_cmd = target.file_generate_object(binary,self.name,self.originFolder,file) + # create the command line befor requesting start: + cmdLine=lutinTools.list_to_str([ + target.xx, + "-o", file_dst, + target.arch, + target.sysroot, + target.global_include_cc, + lutinTools.add_prefix("-I",self.export_path), + lutinTools.add_prefix("-I",self.local_path), + lutinTools.add_prefix("-I",depancy.path), + self.get_xx_version_compilation_flags(depancy.flags_xx_version), + target.global_flags_cc, + target.global_flags_mm, + depancy.flags_cc, + depancy.flags_mm, + self.flags_mm, + self.flags_cc, + self.export_flags_mm, + self.export_flags_cc, + "-c -MMD -MP", + "-x objective-c++", + file_src]) + # check the dependency for this file : + if False==dependency.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine): + return file_dst + lutinTools.create_directory_of_file(file_dst) + comment = ["m++", self.name, "<==", file] + #process element + lutinMultiprocess.run_in_pool(cmdLine, comment, file_cmd) + return file_dst diff --git a/builder/lutinBuilder_s.py b/builder/lutinBuilder_s.py index e69de29..3fb52b8 100644 --- a/builder/lutinBuilder_s.py +++ b/builder/lutinBuilder_s.py @@ -0,0 +1,17 @@ +## +## ASM builder +## + +## +## Get the current builder type. +## Return the type of builder +## +def getType(): + return "compiler" + +## +## @brief Get builder file type +## @return List of extention supported +## +def getBuildType(): + return ["s", "S"] diff --git a/lutin.py b/lutin.py index 1b01bc0..2825245 100755 --- a/lutin.py +++ b/lutin.py @@ -126,6 +126,7 @@ if __name__ == "__main__": # now import other standard module (must be done here and not before ... import lutinTarget +import lutinBuilder import lutinSystem import lutinHost import lutinTools @@ -228,10 +229,12 @@ if __name__ == '__main__': and folder.lower()!="archive" \ and folder.lower()!="out" : debug.debug("Automatic load path: '" + folder + "'") + lutinBuilder.import_path(folder) lutinModule.import_path(folder) lutinSystem.import_path(folder) lutinTarget.import_path(folder) #lutinSystem.display() + exit(-1) Start() diff --git a/lutinBuilder.py b/lutinBuilder.py new file mode 100644 index 0000000..bb04692 --- /dev/null +++ b/lutinBuilder.py @@ -0,0 +1,48 @@ +#!/usr/bin/python +## +## @author Edouard DUPIN +## +## @copyright 2012, Edouard DUPIN, all right reserved +## +## @license APACHE v2.0 (see license file) +## + +import sys +import os +import inspect +import fnmatch +import lutinDebug as debug +import lutinHeritage as heritage +import datetime +import lutinTools +import lutinModule +import lutinSystem +import lutinImage +import lutinHost + +## +## constitution of dictionnary: +## - "type": "compiler", "linker" +## - "in": input type file +## - "out": extention of the files +## - "builder": pointer on the element +## +builder_list=[] +__start_builder_name="lutinBuilder_" + + +def import_path(path): + global builder_list + matches = [] + debug.debug('BUILDER: Start find sub File : "%s"' %path) + for root, dirnames, filenames in os.walk(path): + tmpList = fnmatch.filter(filenames, __start_builder_name + "*.py") + # Import the module : + for filename in tmpList: + debug.debug('BUILDER: Find a file : "%s"' %os.path.join(root, filename)) + #matches.append(os.path.join(root, filename)) + sys.path.append(os.path.dirname(os.path.join(root, filename)) ) + builder_name = filename.replace('.py', '') + the_builder = __import__(builder_name) + builder_list.append({"name":builder_name, "element":the_builder}) + diff --git a/lutinModule.py b/lutinModule.py index ea7fae3..05fe7a0 100644 --- a/lutinModule.py +++ b/lutinModule.py @@ -189,266 +189,10 @@ class Module: else: local_xx_version_flags=["-std=c++98", "-D__CPP_VERSION__=1999"] return local_xx_version_flags - ## - ## @brief Commands for running gcc to compile a m++ file. - ## - def compile_mm_to_o(self, file, binary, target, depancy): - file_src, file_dst, file_depend, file_cmd = target.file_generate_object(binary,self.name,self.originFolder,file) - # create the command line befor requesting start: - cmdLine=lutinTools.list_to_str([ - target.xx, - "-o", file_dst, - target.arch, - target.sysroot, - target.global_include_cc, - lutinTools.add_prefix("-I",self.export_path), - lutinTools.add_prefix("-I",self.local_path), - lutinTools.add_prefix("-I",depancy.path), - self.get_xx_version_compilation_flags(depancy.flags_xx_version), - target.global_flags_cc, - target.global_flags_mm, - depancy.flags_cc, - depancy.flags_mm, - self.flags_mm, - self.flags_cc, - self.export_flags_mm, - self.export_flags_cc, - "-c -MMD -MP", - "-x objective-c++", - file_src]) - # check the dependency for this file : - if False==dependency.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine): - return file_dst - lutinTools.create_directory_of_file(file_dst) - comment = ["m++", self.name, "<==", file] - #process element - lutinMultiprocess.run_in_pool(cmdLine, comment, file_cmd) - return file_dst - - ## - ## @brief Commands for running gcc to compile a m file. - ## - def compile_m_to_o(self, file, binary, target, depancy): - file_src, file_dst, file_depend, file_cmd = target.file_generate_object(binary,self.name,self.originFolder,file) - # create the command line befor requesting start: - cmdLine=lutinTools.list_to_str([ - target.cc, - "-o", file_dst , - target.arch, - target.sysroot, - target.global_include_cc, - lutinTools.add_prefix("-I",self.export_path), - lutinTools.add_prefix("-I",self.local_path), - lutinTools.add_prefix("-I",depancy.path), - self.get_c_version_compilation_flags(depancy.flags_cc_version), - target.global_flags_cc, - target.global_flags_m, - depancy.flags_cc, - depancy.flags_m, - self.flags_m, - self.flags_cc, - self.export_flags_m, - self.export_flags_cc, - "-c -MMD -MP", - "-x objective-c", - file_src]) - # check the dependency for this file : - if False==dependency.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine): - return file_dst - lutinTools.create_directory_of_file(file_dst) - comment = ["m", self.name, "<==", file] - #process element - lutinMultiprocess.run_in_pool(cmdLine, comment, file_cmd) - return file_dst - - ## - ## @brief Commands for running gcc to compile a C++ file. - ## - def compile_xx_to_o(self, file, binary, target, depancy): - file_src, file_dst, file_depend, file_cmd = target.file_generate_object(binary,self.name,self.originFolder,file) - - # create the command line befor requesting start: - cmdLine=lutinTools.list_to_str([ - target.xx, - "-o", file_dst, - target.arch, - target.sysroot, - target.global_include_cc, - lutinTools.add_prefix("-I",self.export_path), - lutinTools.add_prefix("-I",self.local_path), - lutinTools.add_prefix("-I",depancy.path), - self.get_xx_version_compilation_flags(depancy.flags_xx_version), - target.global_flags_cc, - target.global_flags_xx, - depancy.flags_cc, - depancy.flags_xx, - self.flags_xx, - self.flags_cc, - self.export_flags_xx, - self.export_flags_cc, - " -c -MMD -MP", - file_src]) - # check the dependency for this file : - if False==dependency.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine): - return file_dst - lutinTools.create_directory_of_file(file_dst) - comment = ["c++", self.name, "<==", file] - #process element - lutinMultiprocess.run_in_pool(cmdLine, comment, file_cmd) - return file_dst - - ## - ## @brief Commands for running gcc to compile a C file. - ## - def compile_cc_to_o(self, file, binary, target, depancy): - file_src, file_dst, file_depend, file_cmd = target.file_generate_object(binary,self.name,self.originFolder,file) - # create the command line befor requesting start: - cmdLine=lutinTools.list_to_str([ - target.cc, - "-o", file_dst, - target.arch, - target.sysroot, - target.global_include_cc, - lutinTools.add_prefix("-I",self.export_path), - lutinTools.add_prefix("-I",self.local_path), - lutinTools.add_prefix("-I",depancy.path), - self.get_c_version_compilation_flags(depancy.flags_cc_version), - target.global_flags_cc, - depancy.flags_cc, - self.flags_cc, - self.export_flags_cc, - " -c -MMD -MP", - file_src]) - - # check the dependency for this file : - if False==dependency.need_re_build(file_dst, file_src, file_depend, file_cmd, cmdLine): - return file_dst - lutinTools.create_directory_of_file(file_dst) - comment = ["c", self.name, "<==", file] - # process element - lutinMultiprocess.run_in_pool(cmdLine, comment, file_cmd) - return file_dst - ## - ## @brief Commands for running ar. - ## - def link_to_a(self, file, binary, target, depancy): - file_src, file_dst, file_depend, file_cmd = target.generate_file(binary, self.name,self.originFolder,file,"lib-static") - #$(Q)$(TARGET_AR) $(TARGET_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@ $(PRIVATE_ALL_OBJECTS) - cmdLine=lutinTools.list_to_str([ - target.ar, - target.global_flags_ar, - self.flags_ar, - file_dst, - file_src])#, - #depancy.src]) - - # check the dependency for this file : - if False==dependency.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) \ - and False==dependency.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine): - return file_dst - lutinTools.create_directory_of_file(file_dst) - debug.print_element("StaticLib", self.name, "==>", file_dst) - # explicitly remove the destination to prevent error ... - if os.path.exists(file_dst) and os.path.isfile(file_dst): - os.remove(file_dst) - lutinMultiprocess.run_command(cmdLine) - #$(Q)$(TARGET_RANLIB) $@ - if target.ranlib != "": - cmdLineRanLib=lutinTools.list_to_str([ - target.ranlib, - file_dst ]) - lutinMultiprocess.run_command(cmdLineRanLib) - # write cmd line only after to prevent errors ... - lutinMultiprocess.store_command(cmdLine, file_cmd) - return file_dst - ## - ## @brief Commands for running gcc to link a shared library. - ## - def link_to_so(self, file, binary, target, depancy, libName=""): - if libName=="": - libName = self.name - file_src, file_dst, file_depend, file_cmd = target.generate_file(binary, libName,self.originFolder,file,"lib-shared") - #create command Line - cmdLine=lutinTools.list_to_str([ - target.xx, - "-o", file_dst, - target.global_sysroot, - target.arch, - "-shared", - file_src, - depancy.src, - self.flags_ld, - depancy.flags_ld, - target.global_flags_ld]) - - # check the dependency for this file : - if dependency.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \ - and dependency.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False: - return tmpList[1] - lutinTools.create_directory_of_file(file_dst) - debug.print_element("SharedLib", libName, "==>", file_dst) - lutinMultiprocess.run_command(cmdLine) - if target.config["mode"] == "release" \ - or lutinEnv.get_force_strip_mode()==True: - # get the file size of the non strip file - originSize = lutinTools.file_size(file_dst); - debug.print_element("SharedLib(strip)", libName, "", "") - cmdLineStrip=lutinTools.list_to_str([ - target.strip, - file_dst]) - lutinMultiprocess.run_command(cmdLineStrip) - # get the stip size of the binary - stripSize = lutinTools.file_size(file_dst) - debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko") - # write cmd line only after to prevent errors ... - lutinMultiprocess.store_command(cmdLine, file_cmd) - #debug.print_element("SharedLib", self.name, "==>", tmpList[1]) - - - ## - ## @brief Commands for running gcc to link an executable. - ## - def link_to_bin(self, file, binary, target, depancy): - file_src, file_dst, file_depend, file_cmd = target.generate_file(binary, self.name,self.originFolder,file,"bin") - #create comdLine : - cmdLine=lutinTools.list_to_str([ - target.xx, - target.arch, - target.sysroot, - target.global_sysroot, - "-o", file_dst, - file_src, - depancy.src, - self.flags_ld, - depancy.flags_ld, - target.global_flags_ld]) - # check the dependency for this file : - if False==dependency.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) \ - and False==dependency.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine): - return file_dst - lutinTools.create_directory_of_file(file_dst) - debug.print_element("Executable", self.name, "==>", file_dst) - - lutinMultiprocess.run_command(cmdLine) - if "release"==target.config["mode"] \ - or lutinEnv.get_force_strip_mode()==True: - # get the file size of the non strip file - originSize = lutinTools.file_size(file_dst); - debug.print_element("Executable(strip)", self.name, "", "") - cmdLineStrip=lutinTools.list_to_str([ - target.strip, - file_dst]) - lutinMultiprocess.run_command(cmdLineStrip) - # get the stip size of the binary - stripSize = lutinTools.file_size(file_dst) - debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko") - # write cmd line only after to prevent errors ... - lutinMultiprocess.store_command(cmdLine, file_cmd) - ## ## @brief Commands for copying files @@ -860,17 +604,17 @@ __startModuleName="lutin_" def import_path(path): global moduleList matches = [] - debug.debug('Start find sub File : "%s"' %path) + debug.debug('MODULE: Start find sub File : "%s"' %path) for root, dirnames, filenames in os.walk(path): tmpList = fnmatch.filter(filenames, __startModuleName + "*.py") # Import the module : for filename in tmpList: - debug.debug(' Find a file : "%s"' %os.path.join(root, filename)) + debug.debug('Module: Find a file : "%s"' %os.path.join(root, filename)) #matches.append(os.path.join(root, filename)) sys.path.append(os.path.dirname(os.path.join(root, filename)) ) moduleName = filename.replace('.py', '') moduleName = moduleName.replace(__startModuleName, '') - debug.debug("integrate module: '" + moduleName + "' from '" + os.path.join(root, filename) + "'") + debug.debug("MODULE: Integrate module: '" + moduleName + "' from '" + os.path.join(root, filename) + "'") moduleList.append([moduleName,os.path.join(root, filename)]) def exist(target, name): diff --git a/lutinTarget.py b/lutinTarget.py index 934af0f..26a730a 100644 --- a/lutinTarget.py +++ b/lutinTarget.py @@ -407,17 +407,17 @@ __startTargetName="lutinTarget_" def import_path(path): global targetList matches = [] - debug.debug('Start find sub File : "%s"' %path) + debug.debug('TARGET: Start find sub File : "%s"' %path) for root, dirnames, filenames in os.walk(path): tmpList = fnmatch.filter(filenames, __startTargetName + "*.py") # Import the module : for filename in tmpList: - debug.debug(' Find a file : "%s"' %os.path.join(root, filename)) + debug.debug('TARGET: Find a file : "%s"' %os.path.join(root, filename)) #matches.append(os.path.join(root, filename)) sys.path.append(os.path.dirname(os.path.join(root, filename)) ) targetName = filename.replace('.py', '') targetName = targetName.replace(__startTargetName, '') - debug.debug("integrate module: '" + targetName + "' from '" + os.path.join(root, filename) + "'") + debug.debug("TARGET: integrate module: '" + targetName + "' from '" + os.path.join(root, filename) + "'") targetList.append([targetName,os.path.join(root, filename)])