X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fanalyzer.cpp;h=2c9cf058d7a565d3849acca028e150d878f4e85c;hb=c75c89d2425ab0c69e94d45a5d956286838bbc67;hp=39cc7e183974ff6e2894289386127bd5c902bebc;hpb=373e9bb43c24d38316c5bb0393f4a369563319d3;p=builder.git diff --git a/source/analyzer.cpp b/source/analyzer.cpp index 39cc7e1..2c9cf05 100644 --- a/source/analyzer.cpp +++ b/source/analyzer.cpp @@ -30,6 +30,9 @@ void Analyzer::analyze() const Target::Dependencies &depends = i->second->get_dependencies(); for(Target::Dependencies::const_iterator j=depends.begin(); j!=depends.end(); ++j) rdepends[*j].insert(i->second); + const Target::Dependencies &tdepends = i->second->get_transitive_dependencies(); + for(Target::Dependencies::const_iterator j=tdepends.begin(); j!=tdepends.end(); ++j) + rdepends[*j].insert(i->second); } } @@ -43,15 +46,15 @@ void Analyzer::analyze() row.push_back("Rebuild"); table.push_back(row); - Target &cmdline = *builder.get_build_graph().get_target("cmdline"); + Target &goals = builder.get_build_graph().get_goals(); if(mode==RDEPS) { - const Target::Dependencies &deps = cmdline.get_dependencies(); + const Target::Dependencies &deps = goals.get_dependencies(); for(Target::Dependencies::const_iterator i=deps.begin(); i!=deps.end(); ++i) build_depend_table(**i, 0); } else - build_depend_table(cmdline, 0); + build_depend_table(goals, 0); print_table(); } @@ -109,7 +112,11 @@ void Analyzer::build_depend_table(Target &tgt, unsigned depth) depends.assign(rdeps.begin(), rdeps.end()); } else + { depends = tgt.get_dependencies(); + const Target::Dependencies &tdeps = tgt.get_transitive_dependencies(); + depends.insert(depends.end(), tdeps.begin(), tdeps.end()); + } depends.sort(full_paths ? target_order_full : target_order);