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 Package *get_default_package() const { return default_pkg; }
30 Target *get_target(const std::string &) const;
31 Target *get_header(const std::string &, const std::string &, const std::string &, const StringList &);
32 Target *get_library(const std::string &, const std::string &, const StringList &, LibMode);
33 const Msp::Path::Path &get_cwd() const { return cwd; }
34 const std::string &get_arch_prefix(const std::string &) const;
35 std::string get_tool(const std::string &, const std::string &);
36 void apply_profile_template(Config &, const std::string &) const;
37 void add_target(Target *);
41 static void usage(const char *, const char *, bool);
43 class Loader: public Msp::Parser::Loader
46 Loader(Builder &, const Msp::Path::Path &);
51 void package(const std::string &);
54 typedef std::list<Package *> PackageList;
55 typedef std::map<std::string, Package *> PackageMap;
56 typedef std::map<std::string, Target *> TargetMap;
57 typedef std::map<std::string, StringMap> ToolMap;
58 typedef std::map<std::string, StringMap> ProfileTemplateMap;
60 StringList cmdline_targets;
61 StringMap cmdline_options;
73 ToolMap tools; //< arch, tool name -> program name
74 StringMap archs; //< arch -> prefix
75 ProfileTemplateMap profile_tmpl;
84 std::string build_file;
92 int load_build_file(const Msp::Path::Path &);
94 Target *get_header(const Msp::Path::Path &);
95 Target *get_library(const std::string &, const std::string &, const Msp::Path::Path &, LibMode);
96 void update_hash(std::string &, const std::string &);
99 int do_create_makefile();
102 static Msp::Application::RegApp<Builder> reg;