]> git.tdb.fi Git - builder.git/blobdiff - source/filetarget.cpp
Replace per-file copyright notices with a single file
[builder.git] / source / filetarget.cpp
index e7cfc6c10ce638fcd643a3158ab7d4fcff3eb72e..d6dcd1681c4d589cdb7976279e7acfdc032dd46c 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of builder
-Copyright © 2009  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include <msp/fs/stat.h>
 #include <msp/fs/utils.h>
 #include <msp/time/utils.h>
@@ -22,11 +15,10 @@ FileTarget::FileTarget(Builder &b, const Package *p, const FS::Path &a):
 {
        builder.add_target(this);
 
-       struct stat st;
-       if(!FS::stat(path, st))
+       if(FS::Stat st = FS::lstat(path))
        {
-               mtime = Time::TimeStamp::from_unixtime(st.st_mtime);
-               size = st.st_size;
+               mtime = st.get_modify_time();
+               size = st.get_size();
        }
 }
 
@@ -53,6 +45,12 @@ void FileTarget::check_rebuild()
                                mark_rebuild((*i)->get_name()+" has changed");
                        else if((*i)->get_rebuild())
                                mark_rebuild((*i)->get_name()+" needs rebuilding");
+                       else
+                       {
+                               Target *real = ft->get_real_target();
+                               if(real->get_rebuild())
+                                       mark_rebuild(real->get_name()+" needs rebuilding");
+                       }
                }
        }