summaryrefslogtreecommitdiffstats
path: root/src/graph.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/graph.cc')
-rw-r--r--src/graph.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/graph.cc b/src/graph.cc
index 82716aa..c43cf70 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -70,10 +70,19 @@ bool Edge::RecomputeDirty(State* state, DiskInterface* disk_interface,
assert(!outputs_.empty());
for (vector<Node*>::iterator i = outputs_.begin(); i != outputs_.end(); ++i) {
- // We may have other outputs, that our input-recursive traversal hasn't hit
- // yet (or never will). Stat them if we haven't already.
+ // We may have other outputs that our input-recursive traversal hasn't hit
+ // yet (or never will). Stat them if we haven't already to mark that we've
+ // visited their dependents.
(*i)->file_->StatIfNecessary(disk_interface);
+ if (is_phony()) {
+ // Phony edges don't write any output.
+ // They're only dirty if an input is dirty.
+ if (dirty)
+ (*i)->dirty_ = true;
+ continue;
+ }
+
// Output is dirty if we're dirty, we're missing the output,
// or if it's older than the most recent input mtime.
if (dirty || !(*i)->file_->exists() ||