Fix missing dependencies in extract-dependencies-from-makefile
https://bugs.webkit.org/show_bug.cgi?id=193783
<rdar://problem/47201571>
Reviewed by Alex Christensen.
The extract-dependencies-from-makefile script generates .xcfilelists
for XCBuild by invoking a makefile in --debug mode, parsing the
dependency information in the output, and extracting information
regarding targets and dependents. However, the way `make` emits this
dependency information is not rigorous, and so we need to determine
what lines to look for and parse by trial and error. This approach
didn't coriginally atch all the information we needed to collect, so
update the script to look for the additional lines we now know to look
for.
* Scripts/extract-dependencies-from-makefile:
(Parser):
(Parser.addTarget):
(Parser.addPrereq):
(Parser.doParse):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@240503 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Tools/Scripts/extract-dependencies-from-makefile b/Tools/Scripts/extract-dependencies-from-makefile
index 780737b..e07fbc9 100755
--- a/Tools/Scripts/extract-dependencies-from-makefile
+++ b/Tools/Scripts/extract-dependencies-from-makefile
@@ -45,6 +45,7 @@
fileNamePattern = r"`([^']+)'"
rePrerequisite = re.compile(r"Prerequisite {} is .* than target {}".format(fileNamePattern, fileNamePattern))
+ reMustRemakeTarget = re.compile(r"Must remake target {}".format(fileNamePattern))
reWasConsideredAlready = re.compile(r"{} was considered already.".format(fileNamePattern))
rePruningFile = re.compile(r"Pruning file {}.".format(fileNamePattern))
@@ -60,10 +61,12 @@
if line: yield line
def addTarget(self, target):
- self.targets[target] = 1
+ if target != 'all' and target != 'force':
+ self.targets[target] = 1
def addPrereq(self, prereq):
- self.prereqs[prereq] = 1
+ if prereq != 'all' and prereq != 'force':
+ self.prereqs[prereq] = 1
def doParse(self, input):
@@ -76,6 +79,11 @@
self.addPrereq(m.group(1))
continue
+ m = Parser.reMustRemakeTarget.search(line)
+ if m:
+ self.addTarget(m.group(1))
+ continue
+
m = Parser.reWasConsideredAlready.search(line)
if m:
self.addTarget(m.group(1))