- const SourcePackage *spkg = dynamic_cast<const SourcePackage *>(package);
- if(!needs_rebuild() && spkg && spkg->get_config().get_mtime()>mtime)
- mark_rebuild("Package options changed");
+ if(!needs_rebuild() && package)
+ {
+ if(package->get_config().get_mtime()>mtime)
+ mark_rebuild("Package options changed");
+
+ string build_sig = create_build_signature();
+ if(package->get_cache().has_key(this, "build_sig"))
+ {
+ if(package->get_cache().get_value(this, "build_sig")!=build_sig)
+ mark_rebuild("Build signature changed");
+ }
+ }
+}
+
+string FileTarget::create_build_signature() const
+{
+ if(!package)
+ return string();
+
+ const BuildInfo &binfo = (component ? component->get_build_info() : package->get_build_info());
+ return tool->create_build_signature(binfo);
+}
+
+Task *FileTarget::build()
+{
+ Task *task = Target::build();
+ task->set_file(path);
+ task->set_unlink(true);
+ return task;