+
+}
+
+Action *Target::build()
+{
+ if(!buildable)
+ {
+ rebuild=false;
+ return 0;
+ }
+
+ if(!builder.get_dry_run() && FS::exists(name))
+ FS::unlink(name);
+
+ Action *action=create_action();
+ if(action)
+ {
+ action->signal_done.connect(sigc::mem_fun(this, &Target::build_done));
+
+ building=true;
+ }
+
+ return action;
+}
+
+/**
+Returns the number of targets that need to be rebuilt in order to get this
+target up-to-date.
+*/
+unsigned Target::count_rebuild()
+{
+ if(counted)
+ return 0;
+
+ counted=true;
+ unsigned count=rebuild;
+ for(TargetList::iterator i=depends.begin(); i!=depends.end(); ++i)
+ count+=(*i)->count_rebuild();
+ return count;
+}
+
+/**
+Changes the mtime of the target to the current time.
+*/
+void Target::touch()
+{
+ mtime=Time::now();