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;
18 bool nested_build_sig = false;
19 bool arch_in_build_sig = false;
21 FileTarget(Builder &b, const Msp::FS::Path &a): FileTarget(b, 0, a) { }
22 FileTarget(Builder &b, const SourcePackage &p, const Msp::FS::Path &a): FileTarget(b, &p, a) { }
24 FileTarget(Builder &, const SourcePackage *, const Msp::FS::Path &);
26 static std::string generate_name(Builder &, const SourcePackage *, const Msp::FS::Path &);
29 const Msp::FS::Path &get_path() const { return path; }
30 const Msp::Time::TimeStamp &get_mtime() const { return mtime; }
31 unsigned get_size() const { return size; }
33 bool is_installable() const { return !install_location.empty(); }
34 const Msp::FS::Path &get_install_location() const { return install_location; }
36 /// Changes the mtime of the target to the current time.
40 void check_rebuild() override;
42 virtual std::string create_build_signature() const;
44 void build(Task &) override;
46 void build_finished(bool) override;
49 void clean() override;