X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftarget.h;h=a47eb756f868cc0663939f7d255c6b31f3f15d8d;hb=3e8bf5032e744b5fc3e7680af48f2abacc67addc;hp=d971a55bbd46f7dd8a444903a3477c69c02a8a2b;hpb=a176997a1377cf8260ab362d9df8f975035da0f5;p=builder.git diff --git a/source/target.h b/source/target.h index d971a55..a47eb75 100644 --- a/source/target.h +++ b/source/target.h @@ -7,12 +7,12 @@ #include #include -class Action; class Builder; class Package; +class Task; +class Tool; class Target; -typedef std::list TargetList; /** Targets make up the build graph. This class is a base for all target types and @@ -20,17 +20,21 @@ handles many common tasks. See also FileTarget and VirtualTarget. */ class Target { +public: + typedef std::list Dependencies; + protected: Builder &builder; const Package *package; std::string name; + const Tool *tool; bool buildable; bool building; bool rebuild; std::string rebuild_reason; - TargetList depends; + Dependencies depends; bool deps_ready; bool preparing; @@ -59,11 +63,14 @@ public: */ virtual Target *get_real_target() { return this; } + void set_tool(const Tool &); + const Tool *get_tool() const { return tool; } + bool is_buildable() const { return buildable; } bool get_rebuild() const { return rebuild; } const std::string &get_rebuild_reason() const { return rebuild_reason; } void add_depend(Target *); - const TargetList &get_depends() const { return depends; } + const Dependencies &get_depends() const { return depends; } bool get_depends_ready() const { return deps_ready; } /** @@ -82,7 +89,7 @@ public: /** Starts building the target. Returns the Action used for building. */ - Action *build(); + Task *build(); protected: void mark_rebuild(const std::string &); @@ -92,14 +99,9 @@ protected: virtual void check_rebuild() = 0; /** - Creates and returns an Action suitable for building this target. - */ - virtual Action *create_action() =0; - - /** - Handler for the build_done signal of Action. + Handler for the build_finished signal of Task. */ - virtual void build_done(); + virtual void build_finished(bool); }; #endif