]> git.tdb.fi Git - builder.git/blob - source/datafile.cpp
Add support for building datafiles
[builder.git] / source / datafile.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 "component.h"
9 #include "datacompile.h"
10 #include "datafile.h"
11 #include "file.h"
12 #include "sourcepackage.h"
13
14 DataFile::DataFile(Builder &b, const Component &c, File &s):
15         FileTarget(b, &c.get_package(), generate_target_path(c)),
16         component(c),
17         source(s)
18 {
19         buildable=true;
20         add_depend(&source);
21 }
22
23 Action *DataFile::create_action()
24 {
25         return new DataCompile(builder, *this);
26 }
27
28 Msp::FS::Path DataFile::generate_target_path(const Component &comp)
29 {
30         return comp.get_package().get_out_dir()/(comp.get_name()+".dat");
31 }