3 #include "executable.h"
5 #include "objectfile.h"
10 Executable::Executable(Builder &b, const Component &c, const list<ObjectFile *> &objs):
11 Target(b, &c.get_package(), generate_target_name(c)),
15 for(list<ObjectFile *>::const_iterator i=objs.begin(); i!=objs.end(); ++i)
20 Finds and adds any required libraries to the dependencies.
22 void Executable::find_depends()
24 const list<string> &libs=comp.get_build_info().libs;
25 for(list<string>::const_iterator i=libs.begin(); i!=libs.end(); ++i)
27 Target *lib=builder.get_library(*i, comp.get_build_info().libpath);
35 Action *Executable::build()
37 return Target::build(new Link(builder, *this));;
41 Returns the name for the executable. We can't do this in the constructor since
42 we need to pass the value to the Target c'tor.
44 string Executable::generate_target_name(const Component &c)
48 if(c.get_type()==Component::LIBRARY)
54 return (c.get_package().get_source()/(prefix+c.get_name()+suffix)).str();