X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftool.h;h=41b8c5f24dd92387ae4bf454653c3984d34694b5;hb=HEAD;hp=36d1be165b4f614a994d99ca08bcda4b37674ecd;hpb=722d53055cc78a7a7d9901d2b1fe23a2a33fb623;p=builder.git diff --git a/source/tool.h b/source/tool.h deleted file mode 100644 index 36d1be1..0000000 --- a/source/tool.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef TOOL_H_ -#define TOOL_H_ - -#include -#include -#include - -class Builder; -class Component; -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: - typedef std::list SearchPath; - typedef std::list SuffixList; - -protected: - Builder &builder; - std::string tag; - SuffixList input_suffixes; - SuffixList aux_suffixes; - SearchPath system_path; - - Tool(Builder &, const std::string &); -public: - virtual ~Tool() { } - - const std::string &get_tag() const { return tag; } - const SuffixList &get_input_suffixes() const { return input_suffixes; } - const SuffixList &get_auxiliary_suffixes() const { return aux_suffixes; } - bool accepts_suffix(const std::string &, bool = false) const; - 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 &, 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