[DEV] rework the entire build directory (no package generated)

This commit is contained in:
Edouard DUPIN 2015-09-10 21:32:50 +02:00
parent 22965f5a57
commit a9f8ab7ea2
5 changed files with 228 additions and 75 deletions

View File

@ -56,15 +56,19 @@ class Module:
self.extention_order_build = ["java", "javah"] # all is not set here is done in the provided order ... self.extention_order_build = ["java", "javah"] # all is not set here is done in the provided order ...
# sources list: # sources list:
self.src = [] self.src = []
self.header = []
# copy files and paths: # copy files and paths:
self.image_to_copy = [] self.image_to_copy = []
self.files = [] self.files = []
self.paths = [] self.paths = []
# The module has been already build ...
self.isbuild = False self.isbuild = False
## end of basic INIT ... ## end of basic INIT ...
if moduleType == 'BINARY' \ if moduleType == 'BINARY' \
or moduleType == 'LIBRARY' \ or moduleType == 'LIBRARY' \
or moduleType == 'LIBRARY_DYNAMIC' \
or moduleType == 'LIBRARY_STATIC' \
or moduleType == 'PACKAGE' \ or moduleType == 'PACKAGE' \
or moduleType == 'PREBUILD': or moduleType == 'PREBUILD':
self.type=moduleType self.type=moduleType
@ -123,8 +127,86 @@ class Module:
]) ])
# only for gcc :"-Wno-unused-but-set-variable" # only for gcc :"-Wno-unused-but-set-variable"
##
## @brief Send image in the build data directory
## @param[in] target Target object
##
def image_to_build(self, target):
for source, destination, sizeX, sizeY in self.image_to_copy:
extension = source[source.rfind('.'):]
if extension != ".png" \
and extension != ".jpg" \
and sizeX > 0:
debug.error("Can not manage image other than .png and jpg to resize : " + source);
display_source = source
source = self.origin_path + "/" + source
if destination == "":
destination = source[source.rfind('/')+1:]
debug.verbose("Regenerate Destination : '" + destination + "'")
# TODO : set it back : file_cmd = target.get_build_path_data(self.name)
file_cmd = ""
if sizeX > 0:
debug.verbose("Image file : " + display_source + " ==> " + destination + " resize=(" + str(sizeX) + "," + str(sizeY) + ")")
fileName, fileExtension = os.path.splitext(os.path.join(self.origin_path,source))
image.resize(source, os.path.join(target.get_build_path_data(self.name), dst), sizeX, sizeY, file_cmd)
else:
debug.verbose("Might copy file : " + display_source + " ==> " + destination)
tools.copy_file(source, os.path.join(target.get_build_path_data(self.name), destination), file_cmd)
##
## @brief Send files in the build data directory
## @param[in] target Target object
##
def files_to_build(self, target):
for source, destination in self.files:
display_source = source
source = os.path.join(self.origin_path, source)
if destination == "":
destination = source[source.rfind('/')+1:]
debug.verbose("Regenerate Destination : '" + destination + "'")
# TODO : set it back : file_cmd = target.get_build_path_data(self.name)
file_cmd = ""
debug.verbose("Might copy file : " + display_source + " ==> " + destination)
tools.copy_file(source, os.path.join(target.get_build_path_data(self.name), destination), file_cmd)
##
## @brief Send compleate folder in the build data directory
## @param[in] target Target object
##
def paths_to_build(self, target):
for source, destination in self.paths:
debug.debug("Might copy path : " + source + "==>" + destination)
tmp_path = os.path.dirname(os.path.realpath(os.path.join(self.origin_path, source)))
tmp_rule = os.path.basename(source)
for root, dirnames, filenames in os.walk(tmp_path):
debug.extreme_verbose(" root='" + str(root) + "' tmp_path='" + str(tmp_path))
if root != tmp_path:
break
debug.verbose(" root='" + str(root) + "' dir='" + str(dirnames) + "' filenames=" + str(filenames))
list_files = filenames
if len(tmp_rule)>0:
list_files = fnmatch.filter(filenames, tmp_rule)
debug.verbose(" filenames=" + str(filenames))
# Import the module :
for cycle_file in list_files:
#for cycle_file in filenames:
new_destination = destination
# TODO : maybe an error when changing subdirectory ...
#if root[len(source)-1:] != "":
# new_destination = os.path.join(new_destination, root[len(source)-1:])
debug.verbose("Might copy : '" + os.path.join(root, cycle_file) + "' ==> '" + os.path.join(target.get_build_path_data(self.name), new_destination, cycle_file) + "'" )
file_cmd = "" # TODO : ...
tools.copy_file(os.path.join(root, cycle_file), os.path.join(target.get_build_path_data(self.name), new_destination, cycle_file), file_cmd)
# TODO : REMOVE ........................
# TODO : REMOVE ........................
# TODO : REMOVE ........................
## ##
## @brief Commands for copying files ## @brief Commands for copying files
## @deprecated
## ##
def image_to_staging(self, binary_name, target): def image_to_staging(self, binary_name, target):
for source, destination, sizeX, sizeY in self.image_to_copy: for source, destination, sizeX, sizeY in self.image_to_copy:
@ -133,37 +215,45 @@ class Module:
and extension != ".jpg" \ and extension != ".jpg" \
and sizeX > 0: and sizeX > 0:
debug.error("Can not manage image other than .png and jpg to resize : " + source); debug.error("Can not manage image other than .png and jpg to resize : " + source);
displaySource = source display_source = source
source = self.origin_path + "/" + source source = self.origin_path + "/" + source
if destination == "": if destination == "":
destination = source[source.rfind('/')+1:] destination = source[source.rfind('/')+1:]
debug.verbose("Regenerate Destination : '" + destination + "'") debug.verbose("Regenerate Destination : '" + destination + "'")
file_cmd = target.generate_file(binary_name, self.name, self.origin_path, destination, "image")[0] file_cmd = target.generate_file(binary_name, self.name, self.origin_path, destination, "image")[0]
if sizeX > 0: if sizeX > 0:
debug.verbose("Image file : " + displaySource + " ==> " + destination + " resize=(" + str(sizeX) + "," + str(sizeY) + ")") debug.verbose("Image file : " + display_source + " ==> " + destination + " resize=(" + str(sizeX) + "," + str(sizeY) + ")")
fileName, fileExtension = os.path.splitext(self.origin_path+"/" + source) fileName, fileExtension = os.path.splitext(self.origin_path+"/" + source)
target.add_image_staging(source, destination, sizeX, sizeY, file_cmd) target.add_image_staging(source, destination, sizeX, sizeY, file_cmd)
else: else:
debug.verbose("Might copy file : " + displaySource + " ==> " + destination) debug.verbose("Might copy file : " + display_source + " ==> " + destination)
target.add_file_staging(source, destination, file_cmd) target.add_file_staging(source, destination, file_cmd)
# TODO : REMOVE ........................
# TODO : REMOVE ........................
# TODO : REMOVE ........................
## ##
## @brief Commands for copying files ## @brief Commands for copying files
## @deprecated
## ##
def files_to_staging(self, binary_name, target): def files_to_staging(self, binary_name, target):
for source, destination in self.files: for source, destination in self.files:
displaySource = source display_source = source
source = self.origin_path + "/" + source source = self.origin_path + "/" + source
if destination == "": if destination == "":
destination = source[source.rfind('/')+1:] destination = source[source.rfind('/')+1:]
debug.verbose("Regenerate Destination : '" + destination + "'") debug.verbose("Regenerate Destination : '" + destination + "'")
file_cmd = target.generate_file(binary_name, self.name, self.origin_path, destination, "image")[0] file_cmd = target.generate_file(binary_name, self.name, self.origin_path, destination, "image")[0]
# TODO : when destination is missing ... # TODO : when destination is missing ...
debug.verbose("Might copy file : " + displaySource + " ==> " + destination) debug.verbose("Might copy file : " + display_source + " ==> " + destination)
target.add_file_staging(source, destination, file_cmd) target.add_file_staging(source, destination, file_cmd)
# TODO : REMOVE ........................
# TODO : REMOVE ........................
# TODO : REMOVE ........................
## ##
## @brief Commands for copying files ## @brief Commands for copying files
## @deprecated
## ##
def paths_to_staging(self, binary_name, target): def paths_to_staging(self, binary_name, target):
for source, destination in self.paths: for source, destination in self.paths:
@ -289,8 +379,7 @@ class Module:
# this is the endpoint binary ... # this is the endpoint binary ...
package_name = self.name package_name = self.name
else : else :
# TODO : Set it better ... pass
None
# build dependency before # build dependency before
list_sub_file_needed_to_build = [] list_sub_file_needed_to_build = []
self.sub_heritage_list = heritage.HeritageList() self.sub_heritage_list = heritage.HeritageList()
@ -319,7 +408,24 @@ class Module:
if level == lvl: if level == lvl:
debug.debug("level=" + str(level) + " Do Action : " + action_name) debug.debug("level=" + str(level) + " Do Action : " + action_name)
elem = action(target, self, package_name); elem = action(target, self, package_name);
# ----------------------------------------------------
# -- Generic library help --
# ----------------------------------------------------
if self.type=='PREBUILD':
debug.print_element("Prebuild", self.name, "", "")
if self.type=='LIBRARY':
debug.print_element("Library", self.name, "", "")
if self.type=='LIBRARY_DYNAMIC':
debug.print_element("Library(dynamic)", self.name, "", "")
if self.type=='LIBRARY_STATIC':
debug.print_element("Library(static)", self.name, "", "")
if self.type=='BINARY':
debug.print_element("Binary", self.name, "", "")
if self.type=='PACKAGE':
debug.print_element("Package", self.name, "", "")
# ----------------------------------------------------
# -- Sources compilation --
# ----------------------------------------------------
if self.type != 'PREBUILD': if self.type != 'PREBUILD':
# build local sources in a specific order : # build local sources in a specific order :
for extention_local in self.extention_order_build: for extention_local in self.extention_order_build:
@ -370,12 +476,16 @@ class Module:
debug.warning(" UN-SUPPORTED file format: '" + self.origin_path + "/" + file + "'") debug.warning(" UN-SUPPORTED file format: '" + self.origin_path + "/" + file + "'")
# when multiprocess availlable, we need to synchronize here ... # when multiprocess availlable, we need to synchronize here ...
multiprocess.pool_synchrosize() multiprocess.pool_synchrosize()
# ----------------------------------------------------
# generate end point: # -- Generation point --
# ----------------------------------------------------
if self.type=='PREBUILD': if self.type=='PREBUILD':
debug.print_element("Prebuild", self.name, "==>", "find")
self.local_heritage.add_sources(self.src) self.local_heritage.add_sources(self.src)
elif self.type=='LIBRARY': elif self.type=='LIBRARY' \
or self.type=='LIBRARY_DYNAMIC' \
or self.type=='LIBRARY_STATIC':
if self.type=='LIBRARY' \
or self.type=='LIBRARY_STATIC':
try: try:
tmp_builder = builder.get_builder_with_output("a"); tmp_builder = builder.get_builder_with_output("a");
list_file = tools.filter_extention(list_sub_file_needed_to_build, tmp_builder.get_input_type()) list_file = tools.filter_extention(list_sub_file_needed_to_build, tmp_builder.get_input_type())
@ -387,6 +497,11 @@ class Module:
name = self.name, name = self.name,
basic_path = self.origin_path) basic_path = self.origin_path)
self.local_heritage.add_sources(res_file) self.local_heritage.add_sources(res_file)
except ValueError:
debug.error(" UN-SUPPORTED link format: '.a'")
if self.type=='LIBRARY' \
or self.type=='LIBRARY_DYNAMIC':
try:
tmp_builder = builder.get_builder_with_output("so"); tmp_builder = builder.get_builder_with_output("so");
list_file = tools.filter_extention(list_sub_file_needed_to_build, tmp_builder.get_input_type()) list_file = tools.filter_extention(list_sub_file_needed_to_build, tmp_builder.get_input_type())
if len(list_file) > 0: if len(list_file) > 0:
@ -398,7 +513,7 @@ class Module:
basic_path = self.origin_path) basic_path = self.origin_path)
# TODO : self.local_heritage.add_sources(res_file) # TODO : self.local_heritage.add_sources(res_file)
except ValueError: except ValueError:
debug.error(" UN-SUPPORTED link format: '.a'") debug.error(" UN-SUPPORTED link format: '.so'/'.dynlib'/'.dll'")
try: try:
tmp_builder = builder.get_builder_with_output("jar"); tmp_builder = builder.get_builder_with_output("jar");
list_file = tools.filter_extention(list_sub_file_needed_to_build, tmp_builder.get_input_type()) list_file = tools.filter_extention(list_sub_file_needed_to_build, tmp_builder.get_input_type())
@ -423,10 +538,6 @@ class Module:
basic_path = self.origin_path) basic_path = self.origin_path)
except ValueError: except ValueError:
debug.error(" UN-SUPPORTED link format: '.bin'") debug.error(" UN-SUPPORTED link format: '.bin'")
# generate tree for this special binary
target.clean_module_tree()
self.build_tree(target, self.name)
target.copy_to_staging(self.name)
elif self.type=="PACKAGE": elif self.type=="PACKAGE":
if target.name=="Android": if target.name=="Android":
# special case for android wrapper: # special case for android wrapper:
@ -466,24 +577,49 @@ class Module:
basic_path = self.origin_path) basic_path = self.origin_path)
except ValueError: except ValueError:
debug.error(" UN-SUPPORTED link format: 'binary'") debug.error(" UN-SUPPORTED link format: 'binary'")
target.clean_module_tree() else:
# generate tree for this special binary debug.error("Dit not know the element type ... (impossible case) type=" + self.type)
self.build_tree(target, self.name) self.sub_heritage_list.add_heritage(self.local_heritage)
target.copy_to_staging(self.name)
# ----------------------------------------------------
# -- install header --
# ----------------------------------------------------
debug.debug("install headers ...")
for file in self.header:
src_path = os.path.join(self.origin_path, file)
dst_path = os.path.join(target.get_build_path_include(self.name), file)
tools.copy_file(src_path, dst_path);
# ----------------------------------------------------
# -- install data --
# ----------------------------------------------------
debug.debug("install datas")
self.image_to_build(target)
self.files_to_build(target)
self.paths_to_build(target)
# TODO : do sothing that create a list of file set in this directory and remove it if necessary ... ==> if not needed anymore ...&
# ----------------------------------------------------
# -- create package --
# ----------------------------------------------------
if self.type=='BINARY' \
or self.type=="PACKAGE":
if target.end_generate_package == True: if target.end_generate_package == True:
# generate the package with his properties ... # generate the package with his properties ...
if target.name=="Android": if target.name=="Android":
self.sub_heritage_list.add_heritage(self.local_heritage) self.sub_heritage_list.add_heritage(self.local_heritage)
target.make_package(self.name, self.package_prop, self.origin_path + "/..", self.sub_heritage_list) target.make_package(self.name, self.package_prop, os.path.join(self.origin_path, ".."), self.sub_heritage_list)
else: else:
target.make_package(self.name, self.package_prop, self.origin_path + "/..") target.make_package(self.name, self.package_prop, os.path.join(self.origin_path, ".."))
else:
debug.error("Dit not know the element type ... (impossible case) type=" + self.type)
self.sub_heritage_list.add_heritage(self.local_heritage)
# return local dependency ... # return local dependency ...
return self.sub_heritage_list return self.sub_heritage_list
# TODO : REMOVE ........................
# TODO : REMOVE ........................
# TODO : REMOVE ........................
# call here to build the module # call here to build the module
def build_tree(self, target, package_name): def build_tree(self, target, package_name):
# ckeck if not previously build # ckeck if not previously build
@ -504,7 +640,9 @@ class Module:
if self.type=='PREBUILD': if self.type=='PREBUILD':
# nothing to add ==> just dependence # nothing to add ==> just dependence
None None
elif self.type=='LIBRARY': elif self.type=='LIBRARY' \
or self.type=='LIBRARY_DYNAMIC' \
or self.type=='LIBRARY_STATIC':
# remove path of the lib ... for this targer # remove path of the lib ... for this targer
pathbuild = target.get_build_path(self.name) pathbuild = target.get_build_path(self.name)
debug.info("remove path : '" + pathbuild + "'") debug.info("remove path : '" + pathbuild + "'")
@ -596,6 +734,9 @@ class Module:
def add_src_file(self, list): def add_src_file(self, list):
self.append_to_internal_list(self.src, list, True) self.append_to_internal_list(self.src, list, True)
def add_header_file(self, list):
self.append_to_internal_list(self.header, list, True)
def copy_image(self, source, destination='', sizeX=-1, sizeY=-1): def copy_image(self, source, destination='', sizeX=-1, sizeY=-1):
self.image_to_copy.append([source, destination, sizeX, sizeY]) self.image_to_copy.append([source, destination, sizeX, sizeY])

View File

@ -112,7 +112,8 @@ class Target:
self.path_lib="lib" self.path_lib="lib"
self.path_data="share" self.path_data="share"
self.path_doc="doc" self.path_doc="doc"
self.path_doc="include" self.path_include="include"
self.path_object="obj"
self.build_done=[] self.build_done=[]
@ -185,6 +186,7 @@ class Target:
def get_build_mode(self): def get_build_mode(self):
return self.config["mode"] return self.config["mode"]
## @deprecated ...
def add_image_staging(self, inputFile, outputFile, sizeX, sizeY, cmdFile=None): def add_image_staging(self, inputFile, outputFile, sizeX, sizeY, cmdFile=None):
for source, dst, x, y, cmdFile2 in self.list_final_file: for source, dst, x, y, cmdFile2 in self.list_final_file:
if dst == outputFile : if dst == outputFile :
@ -193,6 +195,7 @@ class Target:
debug.verbose("add file : '" + inputFile + "' ==> '" + outputFile + "'") debug.verbose("add file : '" + inputFile + "' ==> '" + outputFile + "'")
self.list_final_file.append([inputFile,outputFile, sizeX, sizeY, cmdFile]) self.list_final_file.append([inputFile,outputFile, sizeX, sizeY, cmdFile])
## @deprecated ...
def add_file_staging(self, inputFile, outputFile, cmdFile=None): def add_file_staging(self, inputFile, outputFile, cmdFile=None):
for source, dst, x, y, cmdFile2 in self.list_final_file: for source, dst, x, y, cmdFile2 in self.list_final_file:
if dst == outputFile : if dst == outputFile :
@ -201,6 +204,7 @@ class Target:
debug.verbose("add file : '" + inputFile + "' ==> '" + outputFile + "'"); debug.verbose("add file : '" + inputFile + "' ==> '" + outputFile + "'");
self.list_final_file.append([inputFile, outputFile, -1, -1, cmdFile]) self.list_final_file.append([inputFile, outputFile, -1, -1, cmdFile])
## @deprecated ...
def copy_to_staging(self, binary_name): def copy_to_staging(self, binary_name):
base_path = self.get_staging_path_data(binary_name) base_path = self.get_staging_path_data(binary_name)
for source, dst, x, y, cmdFile in self.list_final_file: for source, dst, x, y, cmdFile in self.list_final_file:
@ -229,10 +233,10 @@ class Target:
if file[0] == '/': if file[0] == '/':
if tools.os.path.isfile(file): if tools.os.path.isfile(file):
return file + self.suffix_cmd_line return file + self.suffix_cmd_line
return self.get_build_path(module_name) + "/" + file + self.suffix_cmd_line return self.get_build_path_object(module_name) + "/" + file + self.suffix_cmd_line
def get_full_name_warning(self, module_name, basePath, file): def get_full_name_warning(self, module_name, basePath, file):
return self.get_build_path(module_name) + "/" + file + self.suffix_warning; return self.get_build_path_object(module_name) + "/" + file + self.suffix_warning;
def get_full_name_destination(self, module_name, basePath, file, suffix, remove_suffix=False): def get_full_name_destination(self, module_name, basePath, file, suffix, remove_suffix=False):
# special patch for java file: # special patch for java file:
@ -249,10 +253,10 @@ class Target:
suffix = suffix[0] suffix = suffix[0]
else: else:
suffix = "" suffix = ""
return self.get_build_path(module_name) + "/" + file + suffix return self.get_build_path_object(module_name) + "/" + file + suffix
def get_full_dependency(self, module_name, basePath, file): def get_full_dependency(self, module_name, basePath, file):
return self.get_build_path(module_name) + "/" + file + self.suffix_dependence return self.get_build_path_object(module_name) + "/" + file + self.suffix_dependence
""" """
return a list of 3 elements : return a list of 3 elements :
@ -266,6 +270,7 @@ class Target:
basePath, basePath,
file, file,
type): type):
#debug.warning("genrate_file(" + str(binary_name) + "," + str(module_name) + "," + str(basePath) + "," + str(file) + "," + str(type) + ")")
list=[] list=[]
if (type=="bin"): if (type=="bin"):
list.append(file) list.append(file)
@ -275,16 +280,16 @@ class Target:
list.append(os.path.join(self.get_build_path(binary_name), self.path_bin, module_name + self.suffix_binary + self.suffix_warning)) list.append(os.path.join(self.get_build_path(binary_name), self.path_bin, module_name + self.suffix_binary + self.suffix_warning))
elif (type=="lib-shared"): elif (type=="lib-shared"):
list.append(file) list.append(file)
list.append(os.path.join(self.get_build_path(binary_name), self.path_lib, module_name + self.suffix_lib_dynamic)) list.append(os.path.join(self.get_build_path(module_name), self.path_lib, module_name + self.suffix_lib_dynamic))
list.append(os.path.join(self.get_build_path(module_name), module_name + self.suffix_dependence)) list.append(os.path.join(self.get_build_path(module_name), self.path_lib, module_name + self.suffix_dependence))
list.append(os.path.join(self.get_build_path(binary_name), self.path_lib, module_name + self.suffix_lib_dynamic + self.suffix_cmd_line)) list.append(os.path.join(self.get_build_path(module_name), self.path_lib, module_name + self.suffix_lib_dynamic + self.suffix_cmd_line))
list.append(os.path.join(self.get_build_path(binary_name), self.path_lib, module_name + self.suffix_lib_dynamic + self.suffix_warning)) list.append(os.path.join(self.get_build_path(module_name), self.path_lib, module_name + self.suffix_lib_dynamic + self.suffix_warning))
elif (type=="lib-static"): elif (type=="lib-static"):
list.append(file) list.append(file)
list.append(os.path.join(self.get_build_path(module_name), module_name + self.suffix_lib_static)) list.append(os.path.join(self.get_build_path(module_name), self.path_lib, module_name + self.suffix_lib_static))
list.append(os.path.join(self.get_build_path(module_name), module_name + self.suffix_dependence)) list.append(os.path.join(self.get_build_path(module_name), self.path_lib, module_name + self.suffix_dependence))
list.append(os.path.join(self.get_build_path(module_name), module_name + self.suffix_lib_static + self.suffix_cmd_line)) list.append(os.path.join(self.get_build_path(module_name), self.path_lib, module_name + self.suffix_lib_static + self.suffix_cmd_line))
list.append(os.path.join(self.get_build_path(module_name), module_name + self.suffix_lib_static + self.suffix_warning)) list.append(os.path.join(self.get_build_path(module_name), self.path_lib, module_name + self.suffix_lib_static + self.suffix_warning))
elif (type=="jar"): elif (type=="jar"):
list.append(file) list.append(file)
list.append(os.path.join(self.get_build_path(module_name), module_name + ".jar")) list.append(os.path.join(self.get_build_path(module_name), module_name + ".jar"))
@ -308,21 +313,24 @@ class Target:
return os.path.join(tools.get_run_path(), self.path_out, self.path_staging, binary_name) return os.path.join(tools.get_run_path(), self.path_out, self.path_staging, binary_name)
def get_build_path(self, module_name): def get_build_path(self, module_name):
debug.warning("A=" + str(tools.get_run_path()) + " " + str(self.path_out) + " " + str(self.path_build) + " " + str(module_name)) #debug.warning("A=" + str(tools.get_run_path()) + " " + str(self.path_out) + " " + str(self.path_build) + " " + str(module_name))
return os.path.join(tools.get_run_path(), self.path_out, self.path_build, module_name) return os.path.join(tools.get_run_path(), self.path_out, self.path_build, module_name)
def get_build_path_object(self, binary_name):
return os.path.join(self.get_build_path(binary_name), self.path_object)
def get_build_path_bin(self, binary_name): def get_build_path_bin(self, binary_name):
return os.path.join(self.get_staging_path(binary_name), self.path_bin, binary_name) return os.path.join(self.get_build_path(binary_name), self.path_bin, binary_name)
def get_build_path_lib(self, binary_name): def get_build_path_lib(self, binary_name):
return os.path.join(self.get_staging_path(binary_name), self.path_lib, binary_name) return os.path.join(self.get_build_path(binary_name), self.path_lib, binary_name)
def get_build_path_data(self, binary_name): def get_build_path_data(self, binary_name):
return os.path.join(self.get_staging_path(binary_name), self.path_data, binary_name) return os.path.join(self.get_build_path(binary_name), self.path_data, binary_name)
def get_build_path_include(self, binary_name): def get_build_path_include(self, binary_name):
return os.path.join(self.get_staging_path(binary_name), self.path_include, binary_name) return os.path.join(self.get_build_path(binary_name), self.path_include)
def get_staging_path_bin(self, binary_name): def get_staging_path_bin(self, binary_name):
@ -335,7 +343,7 @@ class Target:
return os.path.join(self.get_staging_path(binary_name), self.path_data, binary_name) return os.path.join(self.get_staging_path(binary_name), self.path_data, binary_name)
def get_staging_path_include(self, binary_name): def get_staging_path_include(self, binary_name):
return os.path.join(self.get_staging_path(binary_name), self.path_include, binary_name) return os.path.join(self.get_staging_path(binary_name), self.path_include)
def get_doc_path(self, module_name): def get_doc_path(self, module_name):

View File

@ -120,7 +120,8 @@ def copy_anything(src, dst, recursive = False, executable=False):
debug.verbose(" " + str(tmpPath) + ":") debug.verbose(" " + str(tmpPath) + ":")
for root, dirnames, filenames in os.walk(tmpPath): for root, dirnames, filenames in os.walk(tmpPath):
deltaRoot = root[len(tmpPath):] deltaRoot = root[len(tmpPath):]
if recursive == False and deltaRoot != "": if recursive == False \
and deltaRoot != "":
return return
debug.verbose(" root='" + str(deltaRoot) + "'") # dir='" + str(dirnames) + "' filenames=" + str(filenames)) debug.verbose(" root='" + str(deltaRoot) + "'") # dir='" + str(dirnames) + "' filenames=" + str(filenames))
tmpList = filenames tmpList = filenames
@ -135,7 +136,7 @@ def copy_anything(src, dst, recursive = False, executable=False):
dst + "/" + deltaRoot + "/" + cycleFile, dst + "/" + deltaRoot + "/" + cycleFile,
executable=True) executable=True)
## @deprecated ...
def copy_anything_target(target, src, dst): def copy_anything_target(target, src, dst):
tmpPath = os.path.dirname(os.path.realpath(src)) tmpPath = os.path.dirname(os.path.realpath(src))
tmpRule = os.path.basename(src) tmpRule = os.path.basename(src)
@ -148,11 +149,13 @@ def copy_anything_target(target, src, dst):
for cycleFile in tmpList: for cycleFile in tmpList:
#for cycleFile in filenames: #for cycleFile in filenames:
newDst = dst newDst = dst
if len(newDst) != 0 and newDst[-1] != "/": if len(newDst) != 0 \
and newDst[-1] != "/":
newDst += "/" newDst += "/"
if root[len(src)-1:] != "": if root[len(src)-1:] != "":
newDst += root[len(src)-1:] newDst += root[len(src)-1:]
if len(newDst) != 0 and newDst[-1] != "/": if len(newDst) != 0 \
and newDst[-1] != "/":
newDst += "/" newDst += "/"
debug.verbose("Might copy : '" + root+"/"+cycleFile + "' ==> '" + newDst+cycleFile + "'" ) debug.verbose("Might copy : '" + root+"/"+cycleFile + "' ==> '" + newDst+cycleFile + "'" )
target.add_file_staging(root+"/"+cycleFile, newDst+cycleFile) target.add_file_staging(root+"/"+cycleFile, newDst+cycleFile)

View File

@ -79,7 +79,7 @@ def link(file, binary, target, depancy, name, basic_path):
# check the dependency for this file : # check the dependency for this file :
if depend.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \ if depend.need_re_package(file_dst, file_src, True, file_cmd, cmdLine) == False \
and depend.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False: and depend.need_re_package(file_dst, depancy.src, False, file_cmd, cmdLine) == False:
return tmpList[1] return file_dst
tools.create_directory_of_file(file_dst) tools.create_directory_of_file(file_dst)
debug.print_element("SharedLib", name, "==>", file_dst) debug.print_element("SharedLib", name, "==>", file_dst)
multiprocess.run_command(cmdLine, store_output_file=file_warning) multiprocess.run_command(cmdLine, store_output_file=file_warning)

View File

@ -34,6 +34,7 @@ class Target(target.Target):
if host.BUS_SIZE != 32: if host.BUS_SIZE != 32:
self.global_flags_cc.append("-m32") self.global_flags_cc.append("-m32")
self.global_flags_cc.append("-fpic")
self.global_flags_cc.append("-D__STDCPP_GNU__") self.global_flags_cc.append("-D__STDCPP_GNU__")
def generate_list_separate_coma(self, list): def generate_list_separate_coma(self, list):