4 #include <msp/fs/path.h>
8 An intermediate base class for targets that represent files. Almost all target
9 classes are derived from this.
11 class FileTarget: public Target
15 Msp::Time::TimeStamp mtime;
17 Msp::FS::Path install_location;
19 FileTarget(Builder &, const Msp::FS::Path &);
20 FileTarget(Builder &, const SourcePackage &, const Msp::FS::Path &);
22 void init(const SourcePackage *);
24 static std::string generate_name(Builder &, const SourcePackage *, const Msp::FS::Path &);
27 const Msp::FS::Path &get_path() const { return path; }
28 const Msp::Time::TimeStamp &get_mtime() const { return mtime; }
29 unsigned get_size() const { return size; }
31 bool is_installable() const { return !install_location.empty(); }
32 const Msp::FS::Path &get_install_location() const { return install_location; }
34 /// Changes the mtime of the target to the current time.
38 virtual void check_rebuild();
40 virtual std::string create_build_signature() const;
43 virtual Task *build();
46 virtual void build_finished(bool);