]> git.tdb.fi Git - builder.git/blobdiff - source/analyzer.cpp
Move the bpk files into a subdirectory and install them
[builder.git] / source / analyzer.cpp
index 39cc7e183974ff6e2894289386127bd5c902bebc..2c9cf058d7a565d3849acca028e150d878f4e85c 100644 (file)
@@ -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);