7 #include <msp/core/application.h>
8 #include <msp/parser/loader.h>
9 #include <msp/path/path.h>
18 The main application class. Controls and owns everything. Rules the world.
20 class Builder: public Msp::Application
23 Builder(int, char **);
24 unsigned get_verbose() const { return verbose; }
25 bool get_dry_run() const { return dry_run; }
26 bool get_build_all() const { return build_all; }
27 Package *get_package(const std::string &);
28 Target *get_target(const std::string &);
29 Target *get_header(const std::string &, const std::string &, const StringList &);
30 Target *get_library(const std::string &, const StringList &, unsigned);
31 const Msp::Path::Path &get_cwd() const { return cwd; }
35 static void usage(const char *, bool);
37 class Loader: public Msp::Parser::Loader
40 Loader(Builder &, const Msp::Path::Path &);
45 void package(const std::string &);
48 typedef std::list<Package *> PackageList;
49 typedef std::map<std::string, Package *> PackageMap;
50 typedef std::map<std::string, Target *> TargetMap;
51 typedef std::map<std::string, std::string> ToolMap;
53 StringList cmdline_targets;
54 RawOptionMap cmdline_options;
66 ToolMap tools; /// Not used yet
74 Msp::Path::Path build_file;
81 int load_build_file(const Msp::Path::Path &);
83 Target *get_header(const Msp::Path::Path &);
84 Target *get_library(const std::string &, const Msp::Path::Path &, unsigned);
85 void add_target(Target *);
86 void update_hash(std::string &, const std::string &);
90 static Msp::Application::RegApp<Builder> reg;