6 #include <msp/fs/path.h>
16 Base class for tools. Tools are used to turn targets into other targets.
17 Examples include compilers and linkers.
22 typedef std::list<Msp::FS::Path> SearchPath;
23 typedef std::list<std::string> SuffixList;
27 const Architecture *architecture;
29 FileTarget *executable;
30 SuffixList input_suffixes;
31 SuffixList aux_suffixes;
32 SearchPath system_path;
34 Tool(Builder &, const std::string &);
35 Tool(Builder &, const Architecture &, const std::string &);
39 const std::string &get_tag() const { return tag; }
40 // XXX The executable target should be retrieved when first needed
41 FileTarget *get_executable() const { return executable; }
42 const SuffixList &get_input_suffixes() const { return input_suffixes; }
43 const SuffixList &get_auxiliary_suffixes() const { return aux_suffixes; }
44 bool accepts_suffix(const std::string &, bool = false) const;
45 const SearchPath &get_system_path() const { return system_path; }
47 virtual Target *create_source(const Component &, const Msp::FS::Path &) const { return 0; }
48 virtual Target *create_source(const Msp::FS::Path &) const { return 0; }
49 Target *create_target(Target &, const std::string & = std::string()) const;
50 virtual Target *create_target(const std::list<Target *> &, const std::string & = std::string()) const = 0;
51 virtual Task *run(const Target &) const = 0;
55 Intermediate base class for tool facets. For example, a linker may need to
56 use different commands depending on whether C++ source files are present or
57 not, but their presence can't be directly determined from the object files.
59 class SubTool: public Tool