[DEBUG] set back target optimisation

This commit is contained in:
Edouard DUPIN 2016-03-17 21:45:22 +01:00
parent 87a4106101
commit 1fa860e5b3
3 changed files with 22 additions and 10 deletions

View File

@ -312,6 +312,8 @@ config = {
"gcov":False, "gcov":False,
"compilator-version":"" "compilator-version":""
} }
# load the default target :
my_target = None
actionDone=False actionDone=False
# parse all argument # parse all argument
for argument in localArgument: for argument in localArgument:
@ -333,6 +335,8 @@ for argument in localArgument:
if config["compilator"] != argument.get_arg(): if config["compilator"] != argument.get_arg():
debug.debug("change compilator ==> " + argument.get_arg()) debug.debug("change compilator ==> " + argument.get_arg())
config["compilator"] = argument.get_arg() config["compilator"] = argument.get_arg()
#remove previous target
my_target = None
elif argument.get_option_name() == "target": elif argument.get_option_name() == "target":
# No check input ==> this will be verify automaticly chen the target will be loaded # No check input ==> this will be verify automaticly chen the target will be loaded
if targetName != argument.get_arg(): if targetName != argument.get_arg():
@ -349,10 +353,14 @@ for argument in localArgument:
"gcov":False, "gcov":False,
"compilator-version":"" "compilator-version":""
} }
#remove previous target
my_target = None
elif argument.get_option_name() == "mode": elif argument.get_option_name() == "mode":
if config["mode"] != argument.get_arg(): if config["mode"] != argument.get_arg():
config["mode"] = argument.get_arg() config["mode"] = argument.get_arg()
debug.debug("change mode ==> " + config["mode"]) debug.debug("change mode ==> " + config["mode"])
#remove previous target
my_target = None
else: else:
argument_value = argument.get_arg() argument_value = argument.get_arg()
debug.debug("something request : '" + argument_value + "'") debug.debug("something request : '" + argument_value + "'")
@ -378,7 +386,8 @@ for argument in localArgument:
multiple_module_list.append(module_name) multiple_module_list.append(module_name)
debug.debug("Will do: '" + str(multiple_module_list) + "' ? actions:'" + str(action_list) + "'") debug.debug("Will do: '" + str(multiple_module_list) + "' ? actions:'" + str(action_list) + "'")
for module_name in multiple_module_list: for module_name in multiple_module_list:
#Load target with specific configuration: #load the target if needed :
if my_target == None:
my_target = target.load_target(targetName, copy.deepcopy(config)) my_target = target.load_target(targetName, copy.deepcopy(config))
my_target.build(module_name, actions=action_list) my_target.build(module_name, actions=action_list)
actionDone=True actionDone=True

View File

@ -10,6 +10,7 @@
import sys import sys
import os import os
import copy
import inspect import inspect
import fnmatch import fnmatch
# Local import # Local import
@ -413,7 +414,8 @@ class Module:
if target.is_module_build(self.name) == True: if target.is_module_build(self.name) == True:
if self.sub_heritage_list == None: if self.sub_heritage_list == None:
self.local_heritage = heritage.heritage(self, target) self.local_heritage = heritage.heritage(self, target)
return self.sub_heritage_list debug.warning("plop " + str(self.local_heritage));
return copy.deepcopy(self.sub_heritage_list)
# create the package heritage # create the package heritage
self.local_heritage = heritage.heritage(self, target) self.local_heritage = heritage.heritage(self, target)
@ -548,6 +550,7 @@ 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()
# ---------------------------------------------------- # ----------------------------------------------------
# -- Generation point -- # -- Generation point --
# ---------------------------------------------------- # ----------------------------------------------------
@ -761,7 +764,7 @@ class Module:
target.make_package(self.name, self.package_prop, os.path.join(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)
# return local dependency ... # return local dependency ...
return self.sub_heritage_list return copy.deepcopy(self.sub_heritage_list)
# call here to clean the module # call here to clean the module
def clean(self, target): def clean(self, target):
@ -887,7 +890,7 @@ class Module:
print(' ' + str(description)) print(' ' + str(description))
print(' ' + str(input_list)) print(' ' + str(input_list))
def display(self, target): def display(self):
print('-----------------------------------------------') print('-----------------------------------------------')
print(' package : "' + self.name + "'") print(' package : "' + self.name + "'")
print('-----------------------------------------------') print('-----------------------------------------------')
@ -911,11 +914,11 @@ class Module:
self.print_list('paths',self.paths) self.print_list('paths',self.paths)
for element in self.path["local"]: for element in self.path["local"]:
value = self.path["local"][element] value = self.path["local"][element]
self.print_list('local path ' + str(element), value) self.print_list('local path "' + str(element) + '" ' + str(len(value)), value)
for element in self.path["export"]: for element in self.path["export"]:
value = self.path["export"][element] value = self.path["export"][element]
self.print_list('export path ' + str(element), value) self.print_list('export path "' + str(element) + '" ' + str(len(value)), value)
return True return True

View File

@ -475,7 +475,7 @@ class Target:
if actions == []: if actions == []:
actions = ["build"] actions = ["build"]
if type(actions) == str: if type(actions) == str:
actions = [action] actions = [actions]
if name == "gcov": if name == "gcov":
debug.info("gcov all") debug.info("gcov all")
debug.error("must set the gcov parsing on a specific library or binary ==> not supported now for all") debug.error("must set the gcov parsing on a specific library or binary ==> not supported now for all")
@ -483,7 +483,7 @@ class Target:
debug.info("dump all") debug.info("dump all")
self.load_all() self.load_all()
for mod in self.module_list: for mod in self.module_list:
mod.display(self) mod.display()
return return
if name == "all": if name == "all":
debug.info("build all") debug.info("build all")
@ -553,7 +553,7 @@ class Target:
debug.info("dump module '" + module_name + "'") debug.info("dump module '" + module_name + "'")
if len(action_name) > 4: if len(action_name) > 4:
debug.warning("action 'dump' does not support options ... : '" + action_name + "'") debug.warning("action 'dump' does not support options ... : '" + action_name + "'")
ret = mod.display(self) ret = mod.display()
break break
elif action_name[:5] == "clean": elif action_name[:5] == "clean":
debug.info("clean module '" + module_name + "'") debug.info("clean module '" + module_name + "'")