typedef std::list<Target *> Dependencies;
protected:
+ enum State
+ {
+ INIT,
+ PREPARING,
+ REBUILD,
+ BUILDING,
+ UPTODATE
+ };
+
Builder &builder;
const Package *package;
std::string name;
const Tool *tool;
- bool building;
- bool rebuild;
+ State state;
std::string rebuild_reason;
std::string install_location;
Dependencies depends;
bool deps_ready;
- bool preparing;
- bool prepared;
-
Target(Builder &, const Package *, const std::string &);
public:
virtual ~Target() { }
const Tool *get_tool() const { return tool; }
bool is_buildable() const { return tool!=0; }
- bool needs_rebuild() const { return rebuild; }
+ bool needs_rebuild() const { return state>PREPARING && state<UPTODATE; }
const std::string &get_rebuild_reason() const { return rebuild_reason; }
bool is_installable() const { return !install_location.empty(); }
const std::string &get_install_location() const { return install_location; }