1 #include <msp/path/utils.h>
5 #include "objectfile.h"
7 #include "staticlibrary.h"
12 Archive::Archive(Builder &b, const StaticLibrary &lib):
15 const Component &comp=lib.get_component();
17 const string &prefix=b.get_arch_prefix(lib.get_package()->get_arch());
19 argv.push_back(prefix+"ar");
22 argv.push_back(lib.get_name());
23 const TargetList &deps=lib.get_depends();
24 for(TargetList::const_iterator i=deps.begin(); i!=deps.end(); ++i)
25 if(dynamic_cast<ObjectFile *>(*i))
26 argv.push_back((*i)->get_name());
28 Path::Path lpath=lib.get_name();
29 if(!builder.get_dry_run())
30 Path::mkpath(lpath.subpath(0, lpath.size()-1), 0755);
32 announce(comp.get_package().get_name(), "AR ", relative(lpath, comp.get_package().get_source()).str());