3 This file is part of builder
4 Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #include <msp/path/utils.h>
11 #include "component.h"
12 #include "objectfile.h"
13 #include "sourcepackage.h"
14 #include "staticlibrary.h"
19 Archive::Archive(Builder &b, const StaticLibrary &lib):
22 const Component &comp=lib.get_component();
24 std::string tool="AR";
25 argv.push_back(builder.get_architecture(comp.get_package().get_arch()).get_tool(tool));
28 argv.push_back(lib.get_name());
29 const TargetList &deps=lib.get_depends();
30 for(TargetList::const_iterator i=deps.begin(); i!=deps.end(); ++i)
31 if(dynamic_cast<ObjectFile *>(*i))
32 argv.push_back((*i)->get_name());
34 Path::Path lpath=lib.get_name();
35 if(!builder.get_dry_run())
36 Path::mkpath(lpath.subpath(0, lpath.size()-1), 0755);
38 announce(comp.get_package().get_name(), tool, relative(lpath, comp.get_package().get_source()).str());