]> git.tdb.fi Git - builder.git/blobdiff - source/install.h
Make symlink a feature of the Install target rather than a target on its own
[builder.git] / source / install.h
index 2aa3280a75778494e664c0a8562c43e17dd12098..0cc0fb8a178bdcc874389ecbb74f072fa7565902 100644 (file)
@@ -1,16 +1,28 @@
 #ifndef INSTALL_H_
 #define INSTALL_H_
 
-#include "target.h"
+#include "sourcepackage.h"
+#include "filetarget.h"
 
-class Install: public Target
+/**
+Represents the installation of a file.
+*/
+class Install: public FileTarget
 {
+private:
+       FileTarget &source;
+       Msp::FS::Path link;
+
 public:
-       Install(Builder &, const Package &, Target &, const std::string &);
-       const char *get_type() const { return "Install"; }
-       void check_rebuild();
-       Action *build();
+       Install(Builder &, const SourcePackage &, FileTarget &, const std::string & =std::string());
+       virtual const char *get_type() const { return "Install"; }
+       FileTarget &get_source() const { return source; }
+       virtual Target *get_real_target();
 private:
+       virtual void check_rebuild();
+       virtual Action *create_action();
+
+       static Msp::FS::Path generate_target_path(const FileTarget &i, const std::string &);
 };
 
 #endif