3 This file is part of builder
4 Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
13 #include <msp/time/timestamp.h>
20 typedef std::list<Target *> TargetList;
23 Targets make up the build graph. This class is a base for all target types and
24 handles many common tasks. Most targets are associated with a file.
29 const std::string &get_name() const { return name; }
30 Target *get_buildable_target();
31 bool get_buildable() const { return buildable; }
32 bool get_rebuild() const { return rebuild; }
33 const std::string &get_rebuild_reason() const { return rebuild_reason; }
34 const Msp::Time::TimeStamp &get_mtime() const { return mtime; }
35 virtual const char *get_type() const=0;
36 const TargetList &get_depends() const { return depends; }
37 const Package *get_package() const { return package; }
38 bool get_depends_ready() const { return deps_ready; }
39 void add_depend(Target *);
40 virtual void find_depends() { deps_ready=true; }
41 virtual void prepare();
44 Creates and returns an Action suitable for building this target.
46 virtual Action *build()=0;
48 void reset_count() { counted=false; }
49 virtual unsigned count_rebuild();
54 const Package *package;
56 Msp::Time::TimeStamp mtime;
61 std::string rebuild_reason;
70 Target(Builder &, const Package *, const std::string &);
71 void mark_rebuild(const std::string &);
72 virtual void check_rebuild();
73 Action *build(Action *);
74 virtual void build_done();