]> git.tdb.fi Git - builder.git/blob - source/filetarget.cpp
ed3e66b7c3711577a6a5e620086eec18e506f063
[builder.git] / source / filetarget.cpp
1 /* $Id$
2
3 This file is part of builder
4 Copyright © 2009  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #include <msp/fs/stat.h>
9 #include <msp/fs/utils.h>
10 #include "file.h"
11
12 using namespace std;
13 using namespace Msp;
14
15 FileTarget::FileTarget(Builder &b, const Package *p, const FS::Path &a):
16         // XXX Builder depends on target name being its path for locating file targets
17         Target(b, p, /*FS::basename*/(a.str())),
18         path(a)
19 {
20         struct stat st;
21         if(!FS::stat(path, st))
22                 mtime=Time::TimeStamp::from_unixtime(st.st_mtime);
23 }