X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fanalyzer.cpp;h=7ea1fff8c58aa0d1dbcb2e25ffca4e93b1d68e3e;hb=93c0466ccf46aa3d43541a1aa6a75192d237b3eb;hp=dd8894c61b4d61a122c236c8c9116091658a0f2f;hpb=338eefb513953ae55e8e3614c009c242ba8ad74e;p=builder.git diff --git a/source/analyzer.cpp b/source/analyzer.cpp index dd8894c..7ea1fff 100644 --- a/source/analyzer.cpp +++ b/source/analyzer.cpp @@ -2,10 +2,9 @@ #include #include "analyzer.h" #include "builder.h" -#include "install.h" #include "objectfile.h" -#include "package.h" #include "sourcefile.h" +#include "sourcepackage.h" #include "target.h" #include "tool.h" @@ -27,8 +26,8 @@ void Analyzer::analyze() const Builder::TargetMap &targets = builder.get_targets(); for(Builder::TargetMap::const_iterator i=targets.begin(); i!=targets.end(); ++i) { - const TargetList &depends = i->second->get_depends(); - for(TargetList::const_iterator j=depends.begin(); j!=depends.end(); ++j) + 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); } } @@ -46,8 +45,8 @@ void Analyzer::analyze() Target &cmdline = *builder.get_target("cmdline"); if(mode==RDEPS) { - const TargetList &deps = cmdline.get_depends(); - for(TargetList::const_iterator i=deps.begin(); i!=deps.end(); ++i) + const Target::Dependencies &deps = cmdline.get_dependencies(); + for(Target::Dependencies::const_iterator i=deps.begin(); i!=deps.end(); ++i) build_depend_table(**i, 0); } else @@ -67,7 +66,7 @@ void Analyzer::build_depend_table(Target &tgt, unsigned depth) if(const ObjectFile *obj = dynamic_cast(&tgt)) return build_depend_table(obj->get_source(), depth); } - else if(mode==REBUILD && !tgt.get_rebuild() && !real->get_rebuild()) + else if(mode==REBUILD && !tgt.needs_rebuild()) /* All targets that depend on to-be-built targets will be rebuilt themselves, so we can stop here. */ return; @@ -95,30 +94,25 @@ void Analyzer::build_depend_table(Target &tgt, unsigned depth) else row.push_back(""); - if(tgt.get_rebuild()) - { - if(tgt.get_rebuild_reason().empty()) - row.push_back("Yes (no reason)"); - else - row.push_back(tgt.get_rebuild_reason()); - } + if(tgt.needs_rebuild()) + row.push_back(tgt.get_rebuild_reason()); table.push_back(row); if(!max_depth || depth &rdeps = rdepends[&tgt]; depends.assign(rdeps.begin(), rdeps.end()); } else - depends = tgt.get_depends(); + depends = tgt.get_dependencies(); depends.sort(full_paths ? target_order_full : target_order); - for(TargetList::const_iterator i=depends.begin(); i!=depends.end(); ++i) + for(Target::Dependencies::const_iterator i=depends.begin(); i!=depends.end(); ++i) build_depend_table(**i, depth+1); } }