[DEV] try better check for .a files
This commit is contained in:
parent
06d1dcf576
commit
04ebd5ce2e
@ -86,7 +86,7 @@ def NeedReBuild(dst, src, dependFile, file_cmd="", cmdLine=""):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def NeedRePackage(dst, srcList, mustHaveSrc):
|
def NeedRePackage(dst, srcList, mustHaveSrc, file_cmd="", cmdLine=""):
|
||||||
debug.verbose("Resuest check of dependency of :")
|
debug.verbose("Resuest check of dependency of :")
|
||||||
debug.verbose(" dst='" + dst + "'")
|
debug.verbose(" dst='" + dst + "'")
|
||||||
debug.verbose(" src()=")
|
debug.verbose(" src()=")
|
||||||
@ -114,6 +114,22 @@ def NeedRePackage(dst, srcList, mustHaveSrc):
|
|||||||
debug.verbose(" ==> must re-package (source time greater) : '" + src + "'")
|
debug.verbose(" ==> must re-package (source time greater) : '" + src + "'")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
if ""!=file_cmd:
|
||||||
|
if False==os.path.exists(file_cmd):
|
||||||
|
debug.verbose(" ==> must rebuild (no commandLine file)")
|
||||||
|
return True
|
||||||
|
# check if the 2 cmdline are similar :
|
||||||
|
file2 = open(file_cmd, "r")
|
||||||
|
firstAndUniqueLine = file2.read()
|
||||||
|
if firstAndUniqueLine != cmdLine:
|
||||||
|
debug.verbose(" ==> must rebuild (cmdLines are not identical)")
|
||||||
|
debug.verbose(" ==> '" + cmdLine + "'")
|
||||||
|
debug.verbose(" ==> '" + firstAndUniqueLine + "'")
|
||||||
|
file2.close()
|
||||||
|
return True
|
||||||
|
# the cmdfile is correct ...
|
||||||
|
file2.close()
|
||||||
|
|
||||||
debug.verbose(" ==> Not re-package (all dependency is OK)")
|
debug.verbose(" ==> Not re-package (all dependency is OK)")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -227,31 +227,32 @@ class module:
|
|||||||
## Commands for running ar.
|
## Commands for running ar.
|
||||||
###############################################################################
|
###############################################################################
|
||||||
def Link_to_a(self, file, binary, target, depancy):
|
def Link_to_a(self, file, binary, target, depancy):
|
||||||
tmpList = target.GenerateFile(binary, self.name,self.originFolder,file,"lib-static")
|
file_src, file_dst, file_depend, file_cmd = target.GenerateFile(binary, self.name,self.originFolder,file,"lib-static")
|
||||||
# check the dependency for this file :
|
|
||||||
if False==dependency.NeedRePackage(tmpList[1], tmpList[0], True) \
|
|
||||||
and False==dependency.NeedRePackage(tmpList[1], depancy.src, False):
|
|
||||||
return tmpList[1]
|
|
||||||
lutinTools.CreateDirectoryOfFile(tmpList[1])
|
|
||||||
debug.printElement("StaticLib", self.name, "==>", tmpList[1])
|
|
||||||
# explicitly remove the destination to prevent error ...
|
|
||||||
if os.path.exists(tmpList[1]) and os.path.isfile(tmpList[1]):
|
|
||||||
os.remove(tmpList[1])
|
|
||||||
#$(Q)$(TARGET_AR) $(TARGET_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@ $(PRIVATE_ALL_OBJECTS)
|
#$(Q)$(TARGET_AR) $(TARGET_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@ $(PRIVATE_ALL_OBJECTS)
|
||||||
cmdLine=lutinTools.ListToStr([
|
cmdLine=lutinTools.ListToStr([
|
||||||
target.ar,
|
target.ar,
|
||||||
target.global_flags_ar,
|
target.global_flags_ar,
|
||||||
self.flags_ar,
|
self.flags_ar,
|
||||||
tmpList[1],
|
file_dst,
|
||||||
tmpList[0]])#,
|
file_src])#,
|
||||||
#depancy.src])
|
#depancy.src])
|
||||||
|
|
||||||
|
# check the dependency for this file :
|
||||||
|
if False==dependency.NeedRePackage(file_dst, file_src, True, file_cmd, cmdLine) \
|
||||||
|
and False==dependency.NeedRePackage(file_dst, depancy.src, Falsefile_cmd, cmdLine):
|
||||||
|
return file_dst
|
||||||
|
lutinTools.CreateDirectoryOfFile(file_dst)
|
||||||
|
debug.printElement("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)
|
||||||
RunCommand(cmdLine)
|
RunCommand(cmdLine)
|
||||||
#$(Q)$(TARGET_RANLIB) $@
|
#$(Q)$(TARGET_RANLIB) $@
|
||||||
cmdLine=lutinTools.ListToStr([
|
cmdLine=lutinTools.ListToStr([
|
||||||
target.ranlib,
|
target.ranlib,
|
||||||
tmpList[1] ])
|
file_dst ])
|
||||||
RunCommand(cmdLine)
|
RunCommand(cmdLine)
|
||||||
return tmpList[1]
|
return file_dst
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -120,6 +120,7 @@ class Target:
|
|||||||
list.append(file)
|
list.append(file)
|
||||||
list.append(self.GetBuildFolder(moduleName) + "/" + moduleName + self.suffix_lib_static)
|
list.append(self.GetBuildFolder(moduleName) + "/" + moduleName + self.suffix_lib_static)
|
||||||
list.append(self.GetBuildFolder(moduleName) + "/" + moduleName + self.suffix_dependence)
|
list.append(self.GetBuildFolder(moduleName) + "/" + moduleName + self.suffix_dependence)
|
||||||
|
list.append(self.GetBuildFolder(moduleName) + "/" + moduleName + self.suffix_cmdLine)
|
||||||
else:
|
else:
|
||||||
debug.error("unknow type : " + type)
|
debug.error("unknow type : " + type)
|
||||||
return list
|
return list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user