]> git.tdb.fi Git - builder.git/blobdiff - source/analyzer.cpp
Rework the Target class hierarchy
[builder.git] / source / analyzer.cpp
index 3481ec823309523fce9f78e171c3ff9df7374382..6664477598d653aa3d4a05950a08c62a808e6a42 100644 (file)
@@ -14,6 +14,7 @@ Distributed under the LGPL
 #include "install.h"
 #include "objectfile.h"
 #include "package.h"
+#include "sourcefile.h"
 #include "target.h"
 
 using namespace std;
@@ -45,10 +46,10 @@ void Analyzer::build_depend_table(Target &tgt, unsigned depth)
        if(mode!=REBUILD && mode!=ALLDEPS)
        {
                // Skip trivial targets
-               if(dynamic_cast<ObjectFile *>(&tgt))
-                       return build_depend_table(*tgt.get_depends().front(), depth);
-               else if(dynamic_cast<Install *>(&tgt))
-                       return build_depend_table(*tgt.get_depends().front(), depth);
+               if(ObjectFile *obj=dynamic_cast<ObjectFile *>(&tgt))
+                       return build_depend_table(obj->get_source(), depth);
+               else if(Install *inst=dynamic_cast<Install *>(&tgt))
+                       return build_depend_table(inst->get_source(), depth);
        }
        else if(mode==REBUILD && !tgt.get_rebuild())
                /* All targets that depend on to-be-built targets will be rebuilt