From f4ed3e569cb5ebae855ea5309bfc17aa6b35874a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 11 Dec 2014 07:35:54 +0200 Subject: Initial implementation of dependency injection (g++ -M output) --- build/bd.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'build/bd.cxx') diff --git a/build/bd.cxx b/build/bd.cxx index e48de21..faae4c4 100644 --- a/build/bd.cxx +++ b/build/bd.cxx @@ -22,6 +22,10 @@ namespace build bool match (target& t) { + // Because we match the target first and then prerequisites, + // any additional dependency information injected by the rule + // will be covered as well. + // if (!t.recipe ()) { for (auto ti (&t.type_id ()); @@ -44,7 +48,7 @@ namespace build if (!t.recipe ()) { - cerr << "error: no rule to build target " << t << endl; + cerr << "error: no rule to update target " << t << endl; return false; } } @@ -132,11 +136,7 @@ main (int argc, char* argv[]) cxx::cxx bd_cxx ("bd"); bd_cxx.path (path ("bd.cxx")); - hxx target ("target"); - target.path (path ("target")); - bd_o.prerequisite (bd_cxx); - bd_o.prerequisite (target); // // -- cgit v1.1