aboutsummaryrefslogtreecommitdiff
path: root/build/target.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-12-18 07:14:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-12-18 07:14:53 +0200
commitc0c85b67516653c181fbce7c61c2df3e31e4edd8 (patch)
tree535467b029b27b190e35064e4babd62825eba6a1 /build/target.cxx
parent835ed5f7080a98e9ee80ac08d5585ccdbb63fe0e (diff)
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
Diffstat (limited to 'build/target.cxx')
-rw-r--r--build/target.cxx25
1 files changed, 17 insertions, 8 deletions
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<file>};
}