- rebuild=true;
- rebuild_reason=reason;
-}
-
-/**
-Checks if this target needs to be rebuilt and why.
-*/
-void Target::check_rebuild()
-{
- if(!buildable)
- return;
-
- if(builder.get_build_all())
- mark_rebuild("Rebuilding everything");
- else if(!mtime)
- mark_rebuild("Does not exist");
- else
- {
- for(TargetList::iterator i=depends.begin(); (i!=depends.end() && !rebuild); ++i)
- {
- if((*i)->get_mtime()>mtime)
- mark_rebuild(Path::basename((*i)->get_name())+" has changed");
- else if((*i)->get_rebuild())
- mark_rebuild(Path::basename((*i)->get_name())+" needs rebuilding");
- }
- }
- if(!rebuild && package && package->get_config().get_mtime()>mtime)
- mark_rebuild("Package options changed");
-}
-
-/**
-Hooks the target up with the given action, then returns it. This should be
-called from the public build() function of buildable targets.
-*/
-Action *Target::build(Action *action)
-{
- building=true;
- action->signal_done.connect(sigc::mem_fun(this, &Target::build_done));
- return action;