aboutsummaryrefslogtreecommitdiff
path: root/build2/bash/init.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-08-01 16:17:09 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-08-01 16:41:08 +0300
commit930ae81f85e5ee5ac37311f5e9c89000fbcb59a6 (patch)
treed14c8a341f16fb6c485bfa4212bc1002fe52ed6b /build2/bash/init.cxx
parentda9cbf29c403d27c2940f9b31199c4648f8ae4a1 (diff)
Move bash build system module to separate library
Diffstat (limited to 'build2/bash/init.cxx')
-rw-r--r--build2/bash/init.cxx89
1 files changed, 0 insertions, 89 deletions
diff --git a/build2/bash/init.cxx b/build2/bash/init.cxx
deleted file mode 100644
index 146e680..0000000
--- a/build2/bash/init.cxx
+++ /dev/null
@@ -1,89 +0,0 @@
-// file : build2/bash/init.cxx -*- C++ -*-
-// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
-// license : MIT; see accompanying LICENSE file
-
-#include <build2/bash/init.hxx>
-
-#include <libbuild2/scope.hxx>
-#include <libbuild2/context.hxx>
-#include <libbuild2/variable.hxx>
-#include <libbuild2/diagnostics.hxx>
-
-#include <libbuild2/install/utility.hxx>
-
-#include <build2/bash/rule.hxx>
-#include <build2/bash/target.hxx>
-#include <build2/bash/utility.hxx>
-
-using namespace std;
-
-namespace build2
-{
- namespace bash
- {
- static const in_rule in_rule_;
- static const install_rule install_rule_ (in_rule_);
-
- bool
- init (scope& rs,
- scope& bs,
- const location& l,
- unique_ptr<module_base>&,
- bool,
- bool,
- const variable_map&)
- {
- tracer trace ("bash::init");
- l5 ([&]{trace << "for " << bs;});
-
- // Load in.base (in.* variables, in{} target type).
- //
- if (!cast_false<bool> (rs["in.base.loaded"]))
- load_module (rs, rs, "in.base", l);
-
- bool install_loaded (cast_false<bool> (rs["install.loaded"]));
-
- // Register target types and configure default installability.
- //
- bs.target_types.insert<bash> ();
-
- if (install_loaded)
- {
- using namespace install;
-
- // Install into bin/<project>/ by default stripping the .bash
- // extension from <project> if present.
- //
- const project_name& p (cast<project_name> (rs.vars[var_project]));
-
- install_path<bash> (bs, dir_path ("bin") /= project_base (p));
- install_mode<bash> (bs, "644");
- }
-
- // Register rules.
- //
- {
- auto& r (bs.rules);
-
- r.insert<exe> (perform_update_id, "bash.in", in_rule_);
- r.insert<exe> (perform_clean_id, "bash.in", in_rule_);
- r.insert<exe> (configure_update_id, "bash.in", in_rule_);
-
- r.insert<bash> (perform_update_id, "bash.in", in_rule_);
- r.insert<bash> (perform_clean_id, "bash.in", in_rule_);
- r.insert<bash> (configure_update_id, "bash.in", in_rule_);
-
- if (install_loaded)
- {
- r.insert<exe> (perform_install_id, "bash.install", install_rule_);
- r.insert<exe> (perform_uninstall_id, "bash.uninstall", install_rule_);
-
- r.insert<bash> (perform_install_id, "bash.install", install_rule_);
- r.insert<bash> (perform_uninstall_id, "bash.uninstall", install_rule_);
- }
- }
-
- return true;
- }
- }
-}