X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftool.h;h=4bbbcf5595a8f3603e85901fb5bdb88503cba6f2;hb=968db78efd29b1f4890068693728299b2c7c92c7;hp=d1d71030c5fcc7ec35844333b2e79ad2bacf4069;hpb=243d7c7355c1c5d9a0134440f340936325caaf88;p=builder.git diff --git a/source/tool.h b/source/tool.h index d1d7103..4bbbcf5 100644 --- a/source/tool.h +++ b/source/tool.h @@ -5,8 +5,10 @@ #include #include +class Architecture; class Builder; class Component; +class FileTarget; class Target; class Task; @@ -22,16 +24,21 @@ public: protected: Builder &builder; + const Architecture *architecture; std::string tag; + FileTarget *executable; SuffixList input_suffixes; SuffixList aux_suffixes; SearchPath system_path; Tool(Builder &, const std::string &); + Tool(Builder &, const Architecture &, const std::string &); public: virtual ~Tool() { } const std::string &get_tag() const { return tag; } + // XXX The executable target should be retrieved when first needed + FileTarget *get_executable() const { return executable; } 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; @@ -44,4 +51,17 @@ public: 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