summaryrefslogtreecommitdiffstats
path: root/src/graph.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/graph.cc')
-rw-r--r--src/graph.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/graph.cc b/src/graph.cc
index 5c37ac0..9c99b3d 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -77,9 +77,12 @@ bool Edge::RecomputeDirty(State* state, DiskInterface* disk_interface,
if (is_phony()) {
// Phony edges don't write any output.
- // They're only dirty if an input is dirty.
+ // They're only dirty if an input is dirty, or if there are no inputs
+ // and we're missing the output.
if (dirty)
(*i)->dirty_ = true;
+ else if (inputs_.empty() && !(*i)->file_->exists())
+ (*i)->dirty_ = true;
continue;
}