X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fanalyzer.cpp;h=70f5f2076f3a68de00f74479f5f36f2565edee14;hb=51d5a0f618faabfce9a0a5d5dd64b0b0d52b97cb;hp=984af61be7167b9ad06e47abdd4838e3e4bbb521;hpb=87ea54db19306434bac3e765c9bd3464fd53f390;p=builder.git diff --git a/source/analyzer.cpp b/source/analyzer.cpp index 984af61..70f5f20 100644 --- a/source/analyzer.cpp +++ b/source/analyzer.cpp @@ -1,19 +1,12 @@ -/* $Id$ - -This file is part of builder -Copyright © 2006-2009 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include #include #include "analyzer.h" #include "builder.h" -#include "install.h" #include "objectfile.h" #include "package.h" #include "sourcefile.h" #include "target.h" +#include "tool.h" using namespace std; using namespace Msp; @@ -30,11 +23,11 @@ void Analyzer::analyze() if(mode==RDEPS) { rdepends.clear(); - const TargetMap &targets = builder.get_targets(); - for(TargetMap::const_iterator i=targets.begin(); i!=targets.end(); ++i) + 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_depends(); + for(Target::Dependencies::const_iterator j=depends.begin(); j!=depends.end(); ++j) rdepends[*j].insert(i->second); } } @@ -45,14 +38,15 @@ void Analyzer::analyze() row.push_back("Name"); row.push_back("Package"); row.push_back("Type"); + row.push_back("Tool"); row.push_back("Rebuild"); table.push_back(row); 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_depends(); + for(Target::Dependencies::const_iterator i=deps.begin(); i!=deps.end(); ++i) build_depend_table(**i, 0); } else @@ -94,7 +88,12 @@ void Analyzer::build_depend_table(Target &tgt, unsigned depth) row.push_back(""); row.push_back(tgt.get_type()); - + const Tool *tool = tgt.get_tool(); + if(tool) + row.push_back(tool->get_tag()); + else + row.push_back(""); + if(tgt.get_rebuild()) { if(tgt.get_rebuild_reason().empty()) @@ -107,7 +106,7 @@ void Analyzer::build_depend_table(Target &tgt, unsigned depth) if(!max_depth || depth &rdeps = rdepends[&tgt]; @@ -118,7 +117,7 @@ void Analyzer::build_depend_table(Target &tgt, unsigned depth) 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); } }