class Target;
class Task;
+/**
+Base class for tools. Tools are used to turn targets into other targets.
+Examples include compilers and linkers.
+*/
class Tool
{
public:
const SearchPath &get_system_path() const { return system_path; }
virtual Target *create_source(const Component &, const Msp::FS::Path &) const { return 0; }
+ virtual Target *create_source(const Msp::FS::Path &) const { return 0; }
Target *create_target(Target &, const std::string & = std::string()) const;
virtual Target *create_target(const std::list<Target *> &, const std::string & = std::string()) const = 0;
virtual Task *run(const Target &) const = 0;
};
+/**
+Intermediate base class for tool facets. For example, a linker may need to
+use different commands depending on whether C++ source files are present or
+not, but their presence can't be directly determined from the object files.
+*/
+class SubTool: public Tool
+{
+protected:
+ Tool &parent;
+
+ SubTool(Tool &);
+};
+
#endif