Package *pkg=Package::create(*this, n);
packages.insert(PackageMap::value_type(n, pkg));
- new_pkgs.push_back(pkg);
+ if(pkg)
+ new_pkgs.push_back(pkg);
return pkg;
}
+/**
+Returns the target with the given name, or 0 if no such target exists.
+*/
Target *Builder::get_target(const string &n)
{
TargetMap::iterator i=targets.find(n);
std::list<std::string> missing;
for(PackageMap::iterator i=packages.begin(); i!=packages.end(); ++i)
- {
- const list<PackageRef> &requires=i->second->get_requires();
- for(list<PackageRef>::const_iterator j=requires.begin(); j!=requires.end(); ++j)
- if(!j->get_package())
- missing.push_back(j->get_name());
- }
+ if(!i->second)
+ missing.push_back(i->first);
if(!missing.empty())
{
missing.sort();
- missing.unique();
cerr<<"The following packages were not found on the system:\n";
for(list<string>::iterator i=missing.begin(); i!=missing.end(); ++i)
cerr<<" "<<*i<<'\n';
if(!i->second->get_buildable())
continue;
+ Path::Path inst_base;
+ if(i->second->get_config().is_option("prefix"))
+ inst_base=i->second->get_config().get_option("prefix").value;
+
const ComponentList &components=i->second->get_components();
for(ComponentList::const_iterator j=components.begin(); j!=components.end(); ++j)
{
files.push_back(*k / *l);
}
- Path::Path inst_base=i->second->get_config().get_option("prefix").value;
-
bool build_exe=j->get_type()!=Component::HEADERS;
list<ObjectFile *> objs;
Target *tgt=new_tgts.front();
new_tgts.erase(new_tgts.begin());
tgt->find_depends();
+ if(!tgt->get_depends_ready())
+ new_tgts.push_back(tgt);
}
Target *cmdline=new VirtualTarget(*this, "cmdline");