X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Farchive.cpp;h=175a0ae385cf9113d2b29a516741919d607422cf;hb=a2adbd9c0a8d7a7567848c4c6bdbf0de6ba32bb1;hp=a018dc9235c4421351003565cb4e6a2c1c438af9;hpb=0f5283a54fd188072eca23fbd980a43c6c869913;p=builder.git diff --git a/source/archive.cpp b/source/archive.cpp index a018dc9..175a0ae 100644 --- a/source/archive.cpp +++ b/source/archive.cpp @@ -5,7 +5,8 @@ Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ -#include +#include +#include #include "archive.h" #include "builder.h" #include "component.h" @@ -21,21 +22,23 @@ Archive::Archive(Builder &b, const StaticLibrary &lib): { const Component &comp=lib.get_component(); + work_dir=comp.get_package().get_source(); + std::string tool="AR"; argv.push_back(builder.get_current_arch().get_tool(tool)); argv.push_back("rc"); - argv.push_back(lib.get_name()); + argv.push_back(relative(lib.get_name(), work_dir).str()); const TargetList &deps=lib.get_depends(); for(TargetList::const_iterator i=deps.begin(); i!=deps.end(); ++i) if(dynamic_cast(*i)) - argv.push_back((*i)->get_name()); + argv.push_back(relative((*i)->get_name(), work_dir).str()); - Path lpath=lib.get_name(); + FS::Path lpath=lib.get_name(); if(!builder.get_dry_run()) - mkpath(lpath.subpath(0, lpath.size()-1), 0755); + FS::mkpath(FS::dirname(lpath), 0755); - announce(comp.get_package().get_name(), tool, relative(lpath, comp.get_package().get_source()).str()); + announce(comp.get_package().get_name(), tool, relative(lpath, work_dir).str()); launch(); }