[DEV] coorection of the copy of ewol element on the appl element

This commit is contained in:
Edouard DUPIN 2013-07-02 21:30:16 +02:00
parent adc8336597
commit 422cc3d78d
3 changed files with 47 additions and 45 deletions

View File

@ -284,25 +284,6 @@ class module:
tmpList[1]])
RunCommand(cmdLine)
#debug.printElement("SharedLib", self.name, "==>", tmpList[1])
"""$(Q)$(TARGET_CXX) \
-o $@ \
target.global_sysroot,
$(TARGET_GLOBAL_LDFLAGS_SHARED) \
-Wl,-Map -Wl,$(basename $@).map \
-shared \
-Wl,-soname -Wl,$(notdir $@) \
-Wl,--no-undefined \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_ALL_OBJECTS) \
-Wl,--whole-archive \
$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
-Wl,--no-whole-archive \
-Wl,--as-needed \
$(PRIVATE_ALL_STATIC_LIBRARIES) \
$(PRIVATE_ALL_SHARED_LIBRARIES) \
$(PRIVATE_LDLIBS) \
$(TARGET_GLOBAL_LDLIBS_SHARED)
"""
###############################################################################
@ -334,43 +315,22 @@ class module:
tmpList[1]])
RunCommand(cmdLine)
"""
$(TARGET_CXX) \
-o $@ \
$(TARGET_GLOBAL_LDFLAGS) \
-Wl,-Map -Wl,$(basename $@).map \
-Wl,-rpath-link=$(TARGET_OUT_STAGING)/lib \
-Wl,-rpath-link=$(TARGET_OUT_STAGING)/usr/lib \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_ALL_OBJECTS) \
-Wl,--whole-archive \
$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
-Wl,--no-whole-archive \
-Wl,--as-needed \
$(PRIVATE_ALL_STATIC_LIBRARIES) \
$(PRIVATE_ALL_SHARED_LIBRARIES) \
$(PRIVATE_LDLIBS) \
$(TARGET_GLOBAL_LDLIBS)
"""
#$(call strip- )
###############################################################################
## Commands for copying files
###############################################################################
def files_to_staging(self, binaryName, target):
baseFolder = target.GetStagingFolderData(binaryName)
for element in self.files:
debug.verbose("Might copy file : " + element[0] + " ==> " + element[1])
lutinTools.CopyFile(self.originFolder+"/"+element[0], baseFolder+"/"+element[1])
target.AddFileStaging(self.originFolder+"/"+element[0], element[1])
###############################################################################
## Commands for copying files
###############################################################################
def folders_to_staging(self, binaryName, target):
baseFolder = target.GetStagingFolderData(binaryName)
for element in self.folders:
debug.verbose("Might copy folder : " + element[0] + "==>" + element[1])
lutinTools.CopyAnything(self.originFolder+"/"+element[0], baseFolder+"/"+element[1])
lutinTools.CopyAnythingTarget(target, self.originFolder+"/"+element[0],element[1])
# call here to build the module
def Build(self, target, packageName):
@ -423,14 +383,18 @@ class module:
elif self.type=='BINARY':
resFile = self.Link_to_bin(listSubFileNeededToBuild, packageName, target, subHeritage)
# generate tree for this special binary
target.CleanModuleTree()
self.BuildTree(target, self.name)
target.copyToStaging(self.name)
elif self.type=="PACKAGE":
if target.name=="Android":
resFile = self.Link_to_so(listSubFileNeededToBuild, packageName, target, subHeritage)
else:
resFile = self.Link_to_bin(listSubFileNeededToBuild, packageName, target, subHeritage)
target.CleanModuleTree()
# generate tree for this special binary
self.BuildTree(target, self.name)
target.copyToStaging(self.name)
if target.endGeneratePackage==True:
# generate the package with his properties ...
target.MakePackage(self.name, self.packageProp)
@ -446,12 +410,13 @@ class module:
# ckeck if not previously build
if target.IsModuleBuildTree(self.name)==True:
return
debug.verbose("build tree of " + self.name)
# add all the elements (first added only one keep ==> permit to everload sublib element)
self.files_to_staging(packageName, target)
self.folders_to_staging(packageName, target)
#build tree of all submodules
for dep in self.depends:
inherit = target.BuildTree(dep, packageName)
# add all the elements
self.files_to_staging(packageName, target)
self.folders_to_staging(packageName, target)
# call here to Clean the module

View File

@ -64,6 +64,29 @@ class Target:
self.buildDone=[]
self.buildTreeDone=[]
self.moduleList=[]
# output staging files list :
self.listFinalFile=[]
def AddFileStaging(self, inputFile, outputFile):
for source, dst in self.listFinalFile:
if dst == outputFile :
debug.verbose("already added : " + outputFile)
return
debug.verbose("add file : '" + inputFile + "' ==> '" + outputFile + "'");
self.listFinalFile.append([inputFile,outputFile])
def copyToStaging(self, binaryName):
baseFolder = self.GetStagingFolderData(binaryName)
for source, dst in self.listFinalFile:
debug.verbose("must copy file : '" + source + "' ==> '" + dst + "'");
lutinTools.CopyFile(source, baseFolder+"/"+dst)
def CleanModuleTree(self):
self.buildTreeDone = []
self.listFinalFile = []
# TODO : Remove this hack ... ==> really bad ... but usefull
def SetEwolFolder(self, folder):

View File

@ -84,3 +84,17 @@ def CopyAnything(src, dst):
#for cycleFile in filenames:
#debug.info("Might copy : '" + tmpPath+cycleFile + "' ==> '" + dst + "'")
CopyFile(tmpPath+"/"+cycleFile,dst+"/"+cycleFile)
def CopyAnythingTarget(target, src, dst):
tmpPath = os.path.dirname(os.path.realpath(src))
tmpRule = os.path.basename(src)
for root, dirnames, filenames in os.walk(tmpPath):
tmpList = filenames
if len(tmpRule)>0:
tmpList = fnmatch.filter(filenames, tmpRule)
# Import the module :
for cycleFile in tmpList:
#for cycleFile in filenames:
#debug.info("Might copy : '" + tmpPath+cycleFile + "' ==> '" + dst + "'")
target.AddFileStaging(tmpPath+"/"+cycleFile,dst+"/"+cycleFile)