]> git.tdb.fi Git - builder.git/blob - source/tool.cpp
Store a target representing the executable in each tool
[builder.git] / source / tool.cpp
1 #include <algorithm>
2 #include "tool.h"
3
4 using namespace std;
5
6 Tool::Tool(Builder &b, const string &t):
7         builder(b),
8         tag(t),
9         executable(0)
10 { }
11
12 bool Tool::accepts_suffix(const string &suffix, bool aux) const
13 {
14         if(find(input_suffixes.begin(), input_suffixes.end(), suffix)!=input_suffixes.end())
15                 return true;
16         else if(aux)
17                 return find(aux_suffixes.begin(), aux_suffixes.end(), suffix)!=aux_suffixes.end();
18         else
19                 return false;
20 }
21
22 Target *Tool::create_target(Target &source, const string &arg) const
23 {
24         list<Target *> sources;
25         sources.push_back(&source);
26         return create_target(sources, arg);
27 }
28
29
30 SubTool::SubTool(Tool &p):
31         Tool(p),
32         parent(p)
33 { }