summaryrefslogtreecommitdiffstats
path: root/src/clean.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/clean.cc')
-rw-r--r--src/clean.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/clean.cc b/src/clean.cc
index d22ac59..033fa96 100644
--- a/src/clean.cc
+++ b/src/clean.cc
@@ -96,7 +96,7 @@ void Cleaner::PrintFooter() {
printf("%d files.\n", cleaned_files_count_);
}
-int Cleaner::CleanAll() {
+int Cleaner::CleanAll(bool generator) {
Reset();
PrintHeader();
for (vector<Edge*>::iterator e = state_->edges_.begin();
@@ -104,6 +104,9 @@ int Cleaner::CleanAll() {
// Do not try to remove phony targets
if ((*e)->rule_ == &State::kPhonyRule)
continue;
+ // Do not remove generator's files unless generator specified.
+ if (!generator && (*e)->rule_->generator_)
+ continue;
for (vector<Node*>::iterator out_node = (*e)->outputs_.begin();
out_node != (*e)->outputs_.end(); ++out_node) {
Remove((*out_node)->file_->path_);