X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ffiletarget.cpp;h=d6dcd1681c4d589cdb7976279e7acfdc032dd46c;hb=43bd25ffcb0b4f7882773f4676b209a99cb73c04;hp=e7cfc6c10ce638fcd643a3158ab7d4fcff3eb72e;hpb=20994a6f4802f2dbcf01888d0e1996edf554ade5;p=builder.git diff --git a/source/filetarget.cpp b/source/filetarget.cpp index e7cfc6c..d6dcd16 100644 --- a/source/filetarget.cpp +++ b/source/filetarget.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of builder -Copyright © 2009 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include #include #include @@ -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"); + } } }