X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuildgraph.h;h=e702b51eb765328da30773c4c4c40943235d6835;hb=09366b5da31707942f66e386cd0c07e5ece17b7f;hp=54409c0c061c648c8bb2c5e9c44f9ba6f201425d;hpb=373e9bb43c24d38316c5bb0393f4a369563319d3;p=builder.git diff --git a/source/buildgraph.h b/source/buildgraph.h index 54409c0..e702b51 100644 --- a/source/buildgraph.h +++ b/source/buildgraph.h @@ -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