From 5925c11a1fe8b2e02b790dd40b031ae005d5b68f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Mar 2015 15:42:04 +0200 Subject: Further operation implementation --- build/algorithm | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'build/algorithm') diff --git a/build/algorithm b/build/algorithm index 82913ad..8ce35f8 100644 --- a/build/algorithm +++ b/build/algorithm @@ -6,6 +6,7 @@ #define BUILD_ALGORITHM #include +#include #include namespace build @@ -19,41 +20,44 @@ namespace build target& search (prerequisite&); - // Match a rule to the target with ambiguity detection. + // Match a rule to the action/target with ambiguity detection. // void - match (target&); + match (action, target&); // The default prerequisite search and match implementation. It calls // search() and then match() for each prerequisite in a loop. // void - search_and_match (target&); + search_and_match (action, target&); + // Execute the action on target, assuming a rule has been matched + // and the recipe for this action has been set. + // target_state - update (target&); + execute (action, target&); - // The default prerequisite update implementation. It calls update() - // for each prerequisite in a loop. Returns target_state::updated - // if any of them were updated and target_state::uptodate otherwise. + // The default prerequisite execute implementation. It calls execute() + // for each prerequisite in a loop. Returns target_state::changed + // if any of them were changed and target_state::unchanged otherwise. // target_state - update_prerequisites (target&); + execute_prerequisites (action, target&); - // A version of the above that also determines whether the target - // needs updating based on the passed timestamp. + // A version of the above that also determines whether the action + // needs to be executed on the target based on the passed timestamp. // bool - update_prerequisites (target&, const timestamp&); + execute_prerequisites (action, target&, const timestamp&); // Another version of the above that does two extra things for the - // caller: it determines whether the target needs updating based - // on the passed timestamp and, if so, finds a prerequisite of the - // specified type. + // caller: it determines whether the action needs to be executed on + // the target based on the passed timestamp and, if so, finds a + // prerequisite of the specified type (e.g., source file). // template T* - update_prerequisites (target&, const timestamp&); + execute_prerequisites (action, target&, const timestamp&); } #include -- cgit v1.1