7 #include <msp/core/application.h>
8 #include <msp/parser/loader.h>
9 #include <msp/path/path.h>
19 The main application class. Controls and owns everything. Rules the world.
21 class Builder: public Msp::Application
24 Builder(int, char **);
25 unsigned get_verbose() const { return verbose; }
26 bool get_dry_run() const { return dry_run; }
27 bool get_build_all() const { return build_all; }
28 Package *get_package(const std::string &);
29 Target *get_target(const std::string &);
30 Target *get_header(const std::string &, const std::string &, const std::string &, const StringList &);
31 Target *get_library(const std::string &, const std::string &, const StringList &, LibMode);
32 const Msp::Path::Path &get_cwd() const { return cwd; }
33 const std::string &get_arch_prefix(const std::string &) const;
34 std::string get_tool(const std::string &, const std::string &);
35 void apply_profile_template(Config &, const std::string &) const;
39 static void usage(const char *, const char *, bool);
41 class Loader: public Msp::Parser::Loader
44 Loader(Builder &, const Msp::Path::Path &);
49 void package(const std::string &);
52 typedef std::list<Package *> PackageList;
53 typedef std::map<std::string, Package *> PackageMap;
54 typedef std::map<std::string, Target *> TargetMap;
55 typedef std::map<std::string, StringMap> ToolMap;
56 typedef std::map<std::string, StringMap> ProfileTemplateMap;
58 StringList cmdline_targets;
59 StringMap cmdline_options;
71 ToolMap tools; //< arch, tool name -> program name
72 StringMap archs; //< arch -> prefix
73 ProfileTemplateMap profile_tmpl;
82 std::string build_file;
90 int load_build_file(const Msp::Path::Path &);
92 Target *get_header(const Msp::Path::Path &);
93 Target *get_library(const std::string &, const std::string &, const Msp::Path::Path &, LibMode);
94 void add_target(Target *);
95 void update_hash(std::string &, const std::string &);
98 int do_create_makefile();
101 static Msp::Application::RegApp<Builder> reg;