- Builder &builder;
- const Package *package;
- std::string name;
- bool building;
- bool rebuild;
- std::string rebuild_reason;
- Msp::Time::TimeStamp mtime;
- std::list<Target *> depends;
- std::list<Target *> rdepends;
- bool ready_for_build;
+ /** Finds dependencies for the target. Called during preparation. If the
+ target needs to recursively inspect its dependencies, it should prepare its
+ direct dependencies first. */
+ virtual void find_depends() { }
+
+public:
+ /// Returns the dependencies of the target, in the order they were added.
+ const Dependencies &get_depends() const { return depends; }
+
+ /** Tries to locate a target that will help getting this target built. If
+ all dependencies are up-to-date, returns this target. If there are no
+ targets ready to be built (maybe because they are being built right now),
+ returns 0. */
+ virtual Target *get_buildable_target();
+
+ /** If this target is a proxy for another (such as InstalledFile), return
+ that target. Otherwise, return the target itself. Implementors should call
+ the function recursively to find the final target. */
+ virtual Target *get_real_target() { return this; }