[DEV] add remove of generating end package when requested by the user (usefull in debug mode)

This commit is contained in:
Edouard DUPIN 2013-05-08 12:17:45 +02:00
parent a51dda4879
commit d699557711
8 changed files with 37 additions and 22 deletions

View File

@ -40,6 +40,8 @@ def usage():
print " (clang/gcc) Compile with clang or Gcc mode (by default gcc will be used)"
print " -m=... / --mode=..."
print " (debug/release) Compile in release or debug mode (default release)"
print " -p / --package"
print " disable the package generation (usefull when just compile for test on linux ...)"
print " [cible] : generate in order set"
print " all"
print " Build all (only for the current selected board) (bynary and packages)"
@ -131,6 +133,8 @@ def Start():
compilator="gcc"
# build mode
mode="release"
# package generationMode
generatePackage=True
# load the default target :
target = None
actionDone=False
@ -138,14 +142,19 @@ def Start():
for argument in sys.argv[1:]:
if True==parseGenericArg(argument, False):
None # nothing to do ...
elif argument[:13] == "--compilator=" or argument[:3] == "-C=":
elif argument == "--package" \
or argument == "-p":
generatePackage=False
elif argument[:13] == "--compilator=" \
or argument[:3] == "-C=":
tmpArg=""
if argument[:3] == "-C=":
tmpArg=argument[3:]
else:
tmpArg=argument[13:]
# check input ...
if tmpArg=="gcc" or tmpArg=="clang":
if tmpArg=="gcc" \
or tmpArg=="clang":
if compilator!=tmpArg:
debug.debug("change compilator ==> " + tmpArg)
compilator=tmpArg
@ -153,7 +162,8 @@ def Start():
target = None
else:
debug.error("Set --compilator/-C: '" + tmpArg + "' but only availlable : [gcc/clang]")
elif argument[:9] == "--target=" or argument[:3] == "-t=":
elif argument[:9] == "--target=" \
or argument[:3] == "-t=":
tmpArg=""
if argument[:3] == "-t=":
tmpArg=argument[3:]
@ -166,9 +176,11 @@ def Start():
#reset properties by defauult:
compilator="gcc"
mode="release"
generatePackage=True
#remove previous target
target = None
elif argument[:7] == "--mode=" or argument[:3] == "-m=":
elif argument[:7] == "--mode=" \
or argument[:3] == "-m=":
tmpArg=""
if argument[:3] == "-m=":
tmpArg=argument[3:]
@ -185,14 +197,14 @@ def Start():
else:
#load the target if needed :
if target == None:
target = lutinTarget.TargetLoad(targetName, compilator, mode)
target = lutinTarget.TargetLoad(targetName, compilator, mode, generatePackage)
target.Build(argument)
actionDone=True
# if no action done : we do "all" ...
if actionDone==False:
#load the target if needed :
if target == None:
target = lutinTarget.TargetLoad(targetName, compilator, mode)
target = lutinTarget.TargetLoad(targetName, compilator, mode, generatePackage)
target.Build("all")
# stop all started threads
lutinMultiprocess.UnInit()

View File

@ -73,7 +73,7 @@ def warning(input):
print(color_purple + "[WARNING] " + input + color_default)
debugLock.release()
def error(input):
def error(input, threadID=-1):
global debugLock
global debugLevel
if debugLevel >= 1:
@ -81,7 +81,8 @@ def error(input):
print(color_red + "[ERROR] " + input + color_default)
debugLock.release()
lutinMultiprocess.ErrorOccured()
thread.interrupt_main()
if threadID != -1:
thread.interrupt_main()
exit(-1)
#os_exit(-1)
#raise "error happend"

View File

@ -431,8 +431,9 @@ class module:
resFile = self.Link_to_bin(listSubFileNeededToBuild, packageName, target, subHeritage)
# generate tree for this special binary
self.BuildTree(target, self.name)
# generate the package with his properties ...
target.MakePackage(self.name, self.packageProp)
if target.endGeneratePackage==True:
# generate the package with his properties ...
target.MakePackage(self.name, self.packageProp)
else:
debug.error("Dit not know the element type ... (impossible case) type=" + self.type)
@ -492,7 +493,7 @@ class module:
self.AppendAndCheck(listout, elem, order)
def AddModuleDepend(self, list):
self.AppendToInternalList(self.depends, list)
self.AppendToInternalList(self.depends, list, True)
def AddExportPath(self, list):
self.AppendToInternalList(self.export_path, list)

View File

@ -5,10 +5,11 @@ import lutinTools
import lutinModule
class Target:
def __init__(self, name, typeCompilator, debugMode, arch, cross):
def __init__(self, name, typeCompilator, debugMode, generatePackage, arch, cross):
self.arch = arch
self.cross = cross
self.name=name
self.endGeneratePackage = generatePackage
debug.info("create board target : "+self.name);
if "clang"==typeCompilator:
self.cc=self.cross + "clang"
@ -219,10 +220,10 @@ class Target:
__startTargetName="lutinTarget"
def TargetLoad(targetName, compilator, mode):
def TargetLoad(targetName, compilator, mode, generatePackage):
theTarget = __import__(__startTargetName + targetName)
#try:
tmpTarget = theTarget.Target(compilator, mode)
tmpTarget = theTarget.Target(compilator, mode, generatePackage)
return tmpTarget
#except:
# debug.error("Can not create the Target : '" + targetName + "'")

View File

@ -17,7 +17,7 @@ def RunCommand(cmdLine):
class Target(lutinTarget.Target):
def __init__(self, typeCompilator, debugMode):
def __init__(self, typeCompilator, debugMode, generatePackage):
self.folder_ndk = os.getenv('PROJECT_NDK', lutinTools.GetRunFolder() + "/../android/ndk/")
self.folder_sdk = os.getenv('PROJECT_SDK', lutinTools.GetRunFolder() + "/../android/sdk/")
@ -27,7 +27,7 @@ class Target(lutinTarget.Target):
if typeCompilator!="gcc":
debug.error("Android does not support '" + typeCompilator + "' compilator ... availlable : [gcc]")
lutinTarget.Target.__init__(self, "Android", "gcc", debugMode, arch, cross)
lutinTarget.Target.__init__(self, "Android", "gcc", debugMode, generatePackage, arch, cross)
self.folder_bin="/mustNotCreateBinary"

View File

@ -6,8 +6,8 @@ import os
import stat
class Target(lutinTarget.Target):
def __init__(self, typeCompilator, debugMode):
lutinTarget.Target.__init__(self, "Linux", typeCompilator, debugMode, "", "")
def __init__(self, typeCompilator, debugMode, generatePackage):
lutinTarget.Target.__init__(self, "Linux", typeCompilator, debugMode, generatePackage, "", "")
def generateListSeparateComa(self, list):
result = ""

View File

@ -6,12 +6,12 @@ import os
import stat
class Target(lutinTarget.Target):
def __init__(self, typeCompilator, debugMode):
def __init__(self, typeCompilator, debugMode, generatePackage):
cross = ""
# http://biolpc22.york.ac.uk/pub/linux-mac-cross/
# http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt
lutinTarget.Target.__init__(self, "MacOs", typeCompilator, debugMode, "", cross)
lutinTarget.Target.__init__(self, "MacOs", typeCompilator, debugMode, generatePackage, "", cross)
self.folder_bin="/MacOS"
self.folder_lib="/lib"

View File

@ -8,7 +8,7 @@ import lutinHost
import sys
class Target(lutinTarget.Target):
def __init__(self, typeCompilator, debugMode):
def __init__(self, typeCompilator, debugMode, generatePackage):
# on windows board the basic path is not correct
# TODO : get external PATH for the minGW path
# TODO : Set the cyngwin path ...
@ -22,7 +22,7 @@ class Target(lutinTarget.Target):
if typeCompilator!="gcc":
debug.error("Android does not support '" + typeCompilator + "' compilator ... availlable : [gcc]")
lutinTarget.Target.__init__(self, "Windows", typeCompilator, debugMode, "", cross)
lutinTarget.Target.__init__(self, "Windows", typeCompilator, debugMode, generatePackage, "", cross)
self.folder_bin=""
self.folder_lib="/lib"