]> git.tdb.fi Git - builder.git/blob - source/gnucompiler.h
Refactor transitive dependencies to work on all targets
[builder.git] / source / gnucompiler.h
1 #ifndef GNUCOMPILER_H_
2 #define GNUCOMPILER_H_
3
4 #include "tool.h"
5
6 /**
7 Common base class for GNU compilers.  Turns SourceFiles into ObjectFiles.
8
9 Since invocation is mostly the same for all language frontends, most of the
10 logic is here and the individual tools only handle creating source files of
11 appropriate type.
12 */
13 class GnuCompiler: public Tool
14 {
15 protected:
16         unsigned version;
17
18 public:
19         GnuCompiler(Builder &, const Architecture &, const std::string &);
20
21         virtual Target *create_source(const Component &, const Msp::FS::Path &) const;
22         virtual Target *create_source(const Msp::FS::Path &) const;
23         virtual Target *create_target(const std::list<Target *> &, const std::string &);
24         virtual std::string create_build_signature(const BuildInfo &) const;
25 protected:
26         virtual void do_prepare();
27         void prepare_syspath();
28         void prepare_version();
29         void prepare_version(const std::string &);
30 public:
31         virtual Task *run(const Target &) const;
32 };
33
34 #endif