]> git.tdb.fi Git - builder.git/blobdiff - source/buildgraph.h
Move some more functionality into BuildGraph
[builder.git] / source / buildgraph.h
index 54409c0c061c648c8bb2c5e9c44f9ba6f201425d..e702b51eb765328da30773c4c4c40943235d6835 100644 (file)
@@ -17,6 +17,7 @@ public:
 private:
        Builder &builder;
        TargetMap targets;
+       Target *goals;
 
 public:
        BuildGraph(Builder &);
@@ -40,6 +41,28 @@ public:
        /** Adds a target that will be installed.  A new InstalledFile target is
        created and added as a dependency to the "install" virtual target. */
        void add_installed_target(Target &);
+
+       /** Adds a target as a toplevel goal.  These are stored as dependencies of
+       the "goals" virtual target. */
+       void add_goal(Target &);
+
+       Target &get_goals() const { return *goals; }
+
+       /** Prepares all toplevel goals for building.  If no goals are defined, the
+       "default" target is added as a goal. */
+       void prepare();
+
+       /** Marks all buildable targets to be rebuilt.  The graph must be prepared
+       first. */
+       void force_full_rebuild();
+
+       /** Returns the number of targets that are going to be rebuilt.  The graph
+       must be prepared first. */
+       unsigned count_rebuild_targets() const;
+
+       /** Returns a target that can be built and is needed for building the goal
+       targets.  Null */
+       Target *get_buildable_target() const;
 };
 
 #endif