From 6298f309bddaf3f279a724034e2d1d3ce58e0e1a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 3 Dec 2015 17:20:15 +0200 Subject: Clean up rule names --- build/cxx/module.cxx | 131 ++++++++++++++++++++++++++------------------------- 1 file changed, 68 insertions(+), 63 deletions(-) (limited to 'build/cxx') diff --git a/build/cxx/module.cxx b/build/cxx/module.cxx index 4c0e493..c704ab0 100644 --- a/build/cxx/module.cxx +++ b/build/cxx/module.cxx @@ -48,18 +48,57 @@ namespace build load_module (false, "bin", r, b, loc); } + // Enter module variables. + // + // @@ Probably should only be done on load; make sure reset() unloads + // modules. + // + // @@ Should probably cache the variable pointers so we don't have + // to keep looking them up. + // + if (first) + { + auto& v (var_pool); + + v.find ("config.cxx", string_type); //@@ VAR type + + v.find ("config.cxx.poptions", strings_type); + v.find ("config.cxx.coptions", strings_type); + v.find ("config.cxx.loptions", strings_type); + v.find ("config.cxx.libs", strings_type); + + v.find ("cxx.poptions", strings_type); + v.find ("cxx.coptions", strings_type); + v.find ("cxx.loptions", strings_type); + v.find ("cxx.libs", strings_type); + + v.find ("cxx.export.poptions", strings_type); + v.find ("cxx.export.coptions", strings_type); + v.find ("cxx.export.loptions", strings_type); + v.find ("cxx.export.libs", strings_type); + + v.find ("cxx.std", string_type); + + v.find ("h.ext", string_type); + v.find ("c.ext", string_type); + v.find ("hxx.ext", string_type); + v.find ("ixx.ext", string_type); + v.find ("txx.ext", string_type); + v.find ("cxx.ext", string_type); + } + // Register target types. // { - auto& tts (b.target_types); + auto& t (b.target_types); - tts.insert (); - tts.insert (); + t.insert (); + t.insert (); - tts.insert (); - tts.insert (); - tts.insert (); - tts.insert (); + t.insert (); + t.insert (); + t.insert (); + t.insert (); } // Register rules. @@ -67,74 +106,40 @@ namespace build { using namespace bin; - auto& rs (b.rules); + auto& r (b.rules); - rs.insert (perform_id, update_id, "cxx", compile::instance); - rs.insert (perform_id, clean_id, "cxx", compile::instance); + r.insert (perform_update_id, "cxx.compile", compile::instance); - rs.insert (perform_id, update_id, "cxx", compile::instance); - rs.insert (perform_id, clean_id, "cxx", compile::instance); + r.insert (perform_update_id, "cxx.compile", compile::instance); + r.insert (perform_clean_id, "cxx.compile", compile::instance); - rs.insert (perform_id, update_id, "cxx", link::instance); - rs.insert (perform_id, clean_id, "cxx", link::instance); + r.insert (perform_update_id, "cxx.compile", compile::instance); + r.insert (perform_clean_id, "cxx.compile", compile::instance); - rs.insert (perform_id, update_id, "cxx", link::instance); - rs.insert (perform_id, clean_id, "cxx", link::instance); + r.insert (perform_update_id, "cxx.link", link::instance); + r.insert (perform_clean_id, "cxx.link", link::instance); - rs.insert (perform_id, update_id, "cxx", link::instance); - rs.insert (perform_id, clean_id, "cxx", link::instance); + r.insert (perform_update_id, "cxx.link", link::instance); + r.insert (perform_clean_id, "cxx.link", link::instance); + + r.insert (perform_update_id, "cxx.link", link::instance); + r.insert (perform_clean_id, "cxx.link", link::instance); // Register for configure so that we detect unresolved imports // during configuration rather that later, e.g., during update. // - rs.insert (configure_id, update_id, "cxx", compile::instance); - rs.insert (configure_id, update_id, "cxx", compile::instance); - rs.insert (configure_id, update_id, "cxx", link::instance); - rs.insert (configure_id, update_id, "cxx", link::instance); - rs.insert (configure_id, update_id, "cxx", link::instance); + r.insert (configure_update_id, "cxx.compile", compile::instance); + r.insert (configure_update_id, "cxx.compile", compile::instance); + + r.insert (configure_update_id, "cxx.link", link::instance); + r.insert (configure_update_id, "cxx.link", link::instance); + r.insert (configure_update_id, "cxx.link", link::instance); //@@ Should we check if install module was loaded (see bin)? // - rs.insert (perform_id, install_id, "cxx", install::instance); - rs.insert (perform_id, install_id, "cxx", install::instance); - rs.insert (perform_id, install_id, "cxx", install::instance); - } - - // Enter module variables. - // - // @@ Probably should only be done on load; make sure reset() unloads - // modules. - // - // @@ Should probably cache the variable pointers so we don't have - // to keep looking them up. - // - if (first) - { - var_pool.find ("config.cxx", string_type); //@@ VAR type - - var_pool.find ("config.cxx.poptions", strings_type); - var_pool.find ("config.cxx.coptions", strings_type); - var_pool.find ("config.cxx.loptions", strings_type); - var_pool.find ("config.cxx.libs", strings_type); - - var_pool.find ("cxx.poptions", strings_type); - var_pool.find ("cxx.coptions", strings_type); - var_pool.find ("cxx.loptions", strings_type); - var_pool.find ("cxx.libs", strings_type); - - var_pool.find ("cxx.export.poptions", strings_type); - var_pool.find ("cxx.export.coptions", strings_type); - var_pool.find ("cxx.export.loptions", strings_type); - var_pool.find ("cxx.export.libs", strings_type); - - var_pool.find ("cxx.std", string_type); - - var_pool.find ("h.ext", string_type); - var_pool.find ("c.ext", string_type); - var_pool.find ("hxx.ext", string_type); - var_pool.find ("ixx.ext", string_type); - var_pool.find ("txx.ext", string_type); - var_pool.find ("cxx.ext", string_type); + r.insert (perform_install_id, "cxx.install", install::instance); + r.insert (perform_install_id, "cxx.install", install::instance); + r.insert (perform_install_id, "cxx.install", install::instance); } // Configure. -- cgit v1.1