cmdline_targets.push_back("default");
if(!work_dir.empty())
- chdir(work_dir.c_str());
+ FS::chdir(work_dir);
cwd=FS::getcwd();
Target *Builder::get_target(const string &n) const
{
+ // XXX Used for getting targets by path. get_target(const FS::Path &)?
TargetMap::const_iterator i=targets.find(n);
if(i!=targets.end())
return i->second;
return 0;
}
-Target *Builder::get_header(const string &include, const string &from, const list<string> &path)
+Target *Builder::get_header(const string &include, const FS::Path &from, const list<string> &path)
{
string hash(8, 0);
if(include[0]=='\"')
- update_hash(hash, from);
+ update_hash(hash, from.str());
for(list<string>::const_iterator i=path.begin(); i!=path.end(); ++i)
update_hash(hash, *i);
if(tgt)
{
Target *real_tgt=tgt;
- if(dynamic_cast<Install *>(tgt))
- real_tgt=real_tgt->get_depends().front();
+ if(Install *inst=dynamic_cast<Install *>(tgt))
+ real_tgt=&inst->get_source();
/* Ignore dynamic libraries from local packages unless library mode is
DYNAMIC */
}
for(set<Target *>::iterator i=clean_tgts.begin(); i!=clean_tgts.end(); ++i)
- {
- Action *action=new Unlink(*this, **i);
- while(action->check()<0) ;
- delete action;
- }
+ if(FileTarget *ft=dynamic_cast<FileTarget *>(*i))
+ {
+ Action *action=new Unlink(*this, *ft);
+ while(action->check()<0) ;
+ delete action;
+ }
return 0;
}