7 #include <msp/core/application.h>
8 #include <msp/parser/loader.h>
9 #include <msp/path/path.h>
16 class Builder: public Msp::Application
19 Builder(int, char **);
20 unsigned get_verbose() const { return verbose; }
21 bool get_dry_run() const { return dry_run; }
22 bool get_build_all() const { return build_all; }
23 Package *get_package(const std::string &);
24 Target *get_target(const std::string &);
25 Target *get_header(const std::string &, const std::string &, const std::list<std::string> &);
26 Target *get_library(const std::string &, const std::list<std::string> &);
27 const Msp::Path::Path &get_cwd() const { return cwd; }
31 static void usage(const char *, bool);
33 class Loader: public Msp::Parser::Loader
36 Loader(Builder &, const Msp::Path::Path &);
41 void package(const std::string &);
44 typedef std::map<std::string, Package *> PackageMap;
45 typedef std::map<std::string, Target *> TargetMap;
46 typedef std::map<std::string, std::string> ToolMap;
48 std::list<std::string> cmdline_targets;
49 RawOptionMap cmdline_options;
52 std::list<Package *> new_pkgs;
56 std::list<Target *> new_tgts;
63 Msp::Path::Path build_file;
68 std::list<std::string> what_if;
74 int load_build_file(const Msp::Path::Path &);
76 Target *check_header(const Msp::Path::Path &);
77 void add_target(Target *);
78 void update_hash(std::string &, const std::string &);
82 static Msp::Application::RegApp<Builder> reg;