X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fanalyzer.cpp;h=984af61be7167b9ad06e47abdd4838e3e4bbb521;hb=87ea54db19306434bac3e765c9bd3464fd53f390;hp=75c08849b39c61fdb222bbdcae8ab981bedfb770;hpb=4e6fd9a7436d61af311ab83b5ec264b37078fe76;p=builder.git diff --git a/source/analyzer.cpp b/source/analyzer.cpp index 75c0884..984af61 100644 --- a/source/analyzer.cpp +++ b/source/analyzer.cpp @@ -48,7 +48,7 @@ void Analyzer::analyze() row.push_back("Rebuild"); table.push_back(row); - const Target &cmdline = *builder.get_target("cmdline"); + Target &cmdline = *builder.get_target("cmdline"); if(mode==RDEPS) { const TargetList &deps = cmdline.get_depends(); @@ -61,19 +61,20 @@ void Analyzer::analyze() print_table(); } -void Analyzer::build_depend_table(const Target &tgt, unsigned depth) +void Analyzer::build_depend_table(Target &tgt, unsigned depth) { + Target *real = tgt.get_real_target(); if(mode==DEPS) { // Skip trivial targets + if(real!=&tgt) + return build_depend_table(*real, depth); if(const ObjectFile *obj = dynamic_cast(&tgt)) return build_depend_table(obj->get_source(), depth); - else if(const Install *inst = dynamic_cast(&tgt)) - return build_depend_table(inst->get_source(), depth); } - else if(mode==REBUILD && !tgt.get_rebuild()) + else if(mode==REBUILD && !tgt.get_rebuild() && !real->get_rebuild()) /* All targets that depend on to-be-built targets will be rebuilt - themselves, so we cn stop here. */ + themselves, so we can stop here. */ return; TableRow row;