X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuildgraph.h;h=1636e27ae714b3706f78605c16e008708bd19787;hb=HEAD;hp=e702b51eb765328da30773c4c4c40943235d6835;hpb=09366b5da31707942f66e386cd0c07e5ece17b7f;p=builder.git diff --git a/source/buildgraph.h b/source/buildgraph.h deleted file mode 100644 index e702b51..0000000 --- a/source/buildgraph.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef BUILDGRAPH_H_ -#define BUILDGRAPH_H_ - -#include "virtualfilesystem.h" - -class Builder; -class Target; - -/** -Manages a graph of targets. -*/ -class BuildGraph -{ -public: - typedef std::map TargetMap; - -private: - Builder &builder; - TargetMap targets; - Target *goals; - -public: - BuildGraph(Builder &); - ~BuildGraph(); - - /** Looks up a target by name. Returns 0 if no such target exists. */ - Target *get_target(const std::string &) const; - - const TargetMap &get_targets() const { return targets; } - - /** Adds a target. It can later be retrieved by name. Called from Target - constructor. */ - void add_target(Target *); - - /** Adds a target that is a primary build goal. Such targets will be added - as dependencies of the "world" virtual target. If the target belongs to a - default component of the main package, it's also added to the "default" - virtual target. */ - void add_primary_target(Target &); - - /** 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