X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuildgraph.h;h=1636e27ae714b3706f78605c16e008708bd19787;hb=69cd5cc73f466181420711fb907979de58687a4c;hp=54409c0c061c648c8bb2c5e9c44f9ba6f201425d;hpb=373e9bb43c24d38316c5bb0393f4a369563319d3;p=builder.git diff --git a/source/buildgraph.h b/source/buildgraph.h index 54409c0..1636e27 100644 --- a/source/buildgraph.h +++ b/source/buildgraph.h @@ -1,7 +1,8 @@ #ifndef BUILDGRAPH_H_ #define BUILDGRAPH_H_ -#include "virtualfilesystem.h" +#include +#include class Builder; class Target; @@ -17,6 +18,7 @@ public: private: Builder &builder; TargetMap targets; + Target *goals; public: BuildGraph(Builder &); @@ -40,6 +42,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