Dependency bug in refactored version.

This commit is contained in:
Josh Yelon 2007-05-17 18:44:15 +00:00
parent e86f9470b2
commit 2c7d1a8f60

View File

@ -850,7 +850,7 @@ def CxxFindSource(name, ipath):
exit("Could not find source file: "+name) exit("Could not find source file: "+name)
def CxxFindHeader(srcfile, incfile, ipath): def CxxFindHeader(srcfile, incfile, ipath):
if (incfile[:1]=="."): if (incfile.startswith(".")):
last = srcfile.rfind("/") last = srcfile.rfind("/")
if (last < 0): exit("CxxFindHeader cannot handle this case #1") if (last < 0): exit("CxxFindHeader cannot handle this case #1")
srcdir = srcfile[:last+1] srcdir = srcfile[:last+1]
@ -866,10 +866,9 @@ def CxxFindHeader(srcfile, incfile, ipath):
full = srcdir + incfile full = srcdir + incfile
if GetTimestamp(full) > 0: return full if GetTimestamp(full) > 0: return full
return 0 return 0
else: else:
for dir in ipath: for dir in ipath:
if (dir == "."): full = srcfile full = dir + "/" + incfile
else: full = dir + "/" + srcfile
if GetTimestamp(full) > 0: return full if GetTimestamp(full) > 0: return full
return 0 return 0
@ -970,11 +969,12 @@ def SDependencyQueue(ipath, call, targets, sources):
xipath = ["built/tmp"] + ipath + ["built/include"] xipath = ["built/tmp"] + ipath + ["built/include"]
osources = {} osources = {}
for x in sources: for x in sources:
file = FindLocation(x, xipath)
if (x.endswith(".cxx")) or (x.endswith(".I")) or (x.endswith(".h")) or (x.endswith(".c")): if (x.endswith(".cxx")) or (x.endswith(".I")) or (x.endswith(".h")) or (x.endswith(".c")):
for dep in CxxCalcDependencies(CxxFindSource(x, xipath), xipath, []): for dep in CxxCalcDependencies(file, xipath, []):
osources[dep] = 1 osources[dep] = 1
else: else:
osources[FindLocation(x, xipath)] = 1 osources[file] = 1
osources = osources.keys() osources = osources.keys()
osources.sort() osources.sort()
otargets = FindLocations(targets, xipath) otargets = FindLocations(targets, xipath)