6 #include <msp/time/timestamp.h>
13 typedef std::list<Target *> TargetList;
16 Targets make up the build graph. This class is a base for all target types and
17 handles many common tasks. Most targets are associated with a file.
22 const std::string &get_name() const { return name; }
23 Target *get_buildable_target();
24 bool get_buildable() const { return buildable; }
25 bool get_rebuild() const { return rebuild; }
26 const std::string &get_rebuild_reason() const { return rebuild_reason; }
27 const Msp::Time::TimeStamp &get_mtime() const { return mtime; }
28 virtual const char *get_type() const=0;
29 const TargetList &get_depends() const { return depends; }
30 const Package *get_package() const { return package; }
31 bool get_depends_ready() const { return deps_ready; }
32 void add_depend(Target *);
33 virtual void find_depends() { deps_ready=true; }
34 virtual void prepare();
37 Creates and returns an Action suitable for building this target.
39 virtual Action *build()=0;
41 void reset_count() { counted=false; }
42 virtual unsigned count_rebuild();
47 const Package *package;
49 Msp::Time::TimeStamp mtime;
54 std::string rebuild_reason;
63 Target(Builder &, const Package *, const std::string &);
64 void mark_rebuild(const std::string &);
65 virtual void check_rebuild();
66 Action *build(Action *);
67 virtual void build_done();