summaryrefslogtreecommitdiffstats
path: root/src/clean.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/clean.cc')
-rw-r--r--src/clean.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/clean.cc b/src/clean.cc
index e86793e..d6436ad 100644
--- a/src/clean.cc
+++ b/src/clean.cc
@@ -102,12 +102,15 @@ int Cleaner::CleanAll() {
Reset();
PrintHeader();
for (vector<Edge*>::iterator e = state_->edges_.begin();
- e != state_->edges_.end();
- ++e)
+ e != state_->edges_.end(); ++e) {
+ // Do not try to remove phony targets
+ if ((*e)->rule_ == &State::kPhonyRule)
+ continue;
for (vector<Node*>::iterator out_node = (*e)->outputs_.begin();
- out_node != (*e)->outputs_.end();
- ++out_node)
+ out_node != (*e)->outputs_.end(); ++out_node) {
Remove((*out_node)->file_->path_);
+ }
+ }
PrintFooter();
return status_;
}