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