]> git.tdb.fi Git - builder.git/blobdiff - source/filetarget.cpp
Separate the command-line interface into its own class
[builder.git] / source / filetarget.cpp
index fca8cea51f651d5409f9da90b8e893acd4738901..b42580a099a0a95eb411bc34fa65345cd72a2b03 100644 (file)
@@ -64,6 +64,7 @@ string FileTarget::generate_name(Builder &builder, const SourcePackage *pkg, con
 void FileTarget::touch()
 {
        mtime = Time::now();
+       modified();
        signal_bubble_rebuild.emit();
 }
 
@@ -86,16 +87,29 @@ void FileTarget::check_rebuild()
                }
        }
 
+       if(!needs_rebuild())
+       {
+               for(Dependencies::iterator i=side_effects.begin(); (i!=side_effects.end() && !needs_rebuild()); ++i)
+               {
+                       FileTarget *ft = dynamic_cast<FileTarget *>(*i);
+                       if(ft && !ft->get_mtime())
+                               mark_rebuild((*i)->get_name()+" does not exist");
+               }
+       }
+
        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(tool->get_executable())
                {
-                       if(package->get_cache().get_value(this, "build_sig")!=build_sig)
-                               mark_rebuild("Build signature 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");
+                       }
                }
        }
 }