tgt->touch();
}
+ if(build_all)
+ {
+ for(TargetMap::iterator i=targets.begin(); i!=targets.end(); ++i)
+ if(i->second->is_buildable() && !i->second->needs_rebuild())
+ i->second->force_rebuild();
+ }
+
for(PackageMap::iterator i=packages.begin(); i!=packages.end(); ++i)
if(SourcePackage *spkg = dynamic_cast<SourcePackage *>(i->second))
spkg->get_deps_cache().save();
if(!tool)
return;
- if(builder.get_build_all())
- mark_rebuild("Rebuilding everything");
- else if(!mtime)
+ if(!mtime)
mark_rebuild("Does not exist");
else
{
tool = &t;
}
+void Target::force_rebuild()
+{
+ if(!is_buildable())
+ throw logic_error("Target::force_rebuild");
+ mark_rebuild("Forced rebuild");
+}
+
void Target::add_depend(Target *dep)
{
if(dep==this)
the target has been prepared. */
const std::string &get_rebuild_reason() const { return rebuild_reason; }
+ /** Forces rebuild of the target. */
+ void force_rebuild();
+
bool is_installable() const { return !install_location.empty(); }
const std::string &get_install_location() const { return install_location; }
void add_depend(Target *);