From c0c85b67516653c181fbce7c61c2df3e31e4edd8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 18 Dec 2014 07:14:53 +0200 Subject: Initial support for loading dependency info from buildfiles Also a new iteration on the overall architecture. Now, for the first time, build can read the buildfile and build itself. g++-4.9 -std=c++14 -g -I.. -o bd bd.cxx algorithm.cxx scope.cxx parser.cxx lexer.cxx target.cxx prerequisite.cxx rule.cxx native.cxx cxx/target.cxx cxx/rule.cxx process.cxx timestamp.cxx path.cxx g++-4.9 -std=c++14 -g -I../../.. -o driver driver.cxx ../../../build/lexer.cxx g++-4.9 -std=c++14 -g -I../../.. -o driver driver.cxx ../../../build/lexer.cxx ../../../build/parser.cxx ../../../build/scope.cxx ../../../build/target.cxx ../../../build/native.cxx ../../../build/prerequisite.cxx ../../../build/path.cxx ../../../build/timestamp.cxx --- build/target.cxx | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'build/target.cxx') diff --git a/build/target.cxx b/build/target.cxx index e3e3d4d..8314ba4 100644 --- a/build/target.cxx +++ b/build/target.cxx @@ -15,9 +15,15 @@ namespace build ostream& operator<< (ostream& os, const target& t) { - return os << t.type_id ().name << '{' << t.name () << '}'; + // @@ TODO: need to come up with a relative (to current) path. + + return os << t.type ().name << '{' << t.name << '}'; } + target_set targets; + target* default_target = nullptr; + target_type_map target_types; + // path_target // timestamp path_target:: @@ -27,12 +33,15 @@ namespace build return path_mtime (path_); } - using type_info = target::type_info; + const target_type target::static_type { + typeid (target), "target", nullptr, nullptr}; + + const target_type mtime_target::static_type { + typeid (mtime_target), "mtime_target", &target::static_type, nullptr}; + + const target_type path_target::static_type { + typeid (path_target), "path_target", &mtime_target::static_type, nullptr}; - const type_info target::ti_ {typeid (target), "target", nullptr}; - const type_info mtime_target::ti_ { - typeid (mtime_target), "mtime_target", &target::ti_}; - const type_info path_target::ti_ { - typeid (path_target), "path_target", &mtime_target::ti_}; - const type_info file::ti_ {typeid (file), "file", &path_target::ti_}; + const target_type file::static_type { + typeid (file), "file", &path_target::static_type, &target_factory}; } -- cgit v1.1