]> git.tdb.fi Git - builder.git/blob - source/objectfile.h
Rework the Target class hierarchy
[builder.git] / source / objectfile.h
1 /* $Id$
2
3 This file is part of builder
4 Copyright © 2006-2009  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef OBJECTFILE_H_
9 #define OBJECTFILE_H_
10
11 #include "filetarget.h"
12
13 class Component;
14 class SourceFile;
15
16 /**
17 Object files are compiled from source files.
18 */
19 class ObjectFile: public FileTarget
20 {
21 private:
22         const Component ∁
23         SourceFile &source;
24         TargetList new_deps;
25         
26 public:
27         ObjectFile(Builder &, const Component &, SourceFile &);
28         virtual const char *get_type() const { return "ObjectFile"; }
29         const Component &get_component() const { return comp; }
30         SourceFile &get_source() const { return source; }
31
32         /** Processes as many new dependences as possible.  Some may be created on
33         the fly and can't be processed until their own dependencies are ready.  In
34         such cases this function needs to be called again. */
35         virtual void find_depends();
36
37 private:
38         /** Recursively looks for header targets and adds them as dependencies. */
39         void find_depends(Target *);
40
41         /** Adds a target to the dependency list as well as the new dependencies
42         list. */
43         void add_depend(Target *);
44         virtual Action *create_action();
45
46         static Msp::FS::Path generate_target_path(const Component &, const std::string &);
47 };
48
49 #endif