From ca41ca8f9a6b21588248e5fee1a013363f3f52a8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 13 Mar 2015 14:34:24 +0200 Subject: Add support for "first" and "last" execution modes --- build/target.cxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'build/target.cxx') diff --git a/build/target.cxx b/build/target.cxx index 15d57ca..347a382 100644 --- a/build/target.cxx +++ b/build/target.cxx @@ -16,11 +16,6 @@ namespace build { // recipe // - const recipe empty_recipe; - const recipe noop_recipe (&noop_recipe_function); - const recipe default_recipe ( - static_cast (&execute_prerequisites)); - target_state noop_recipe_function (action, target&) { @@ -28,6 +23,18 @@ namespace build return target_state::unchanged; } + static target_state + default_recipe_function (action a, target& t) + { + return current_mode == execution_mode::first + ? execute_prerequisites (a, t) + : reverse_execute_prerequisites (a, t); + } + + const recipe empty_recipe; + const recipe noop_recipe (&noop_recipe_function); + const recipe default_recipe (&default_recipe_function); + // target // ostream& -- cgit v1.1