aboutsummaryrefslogtreecommitdiff
path: root/build/algorithm.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-03-12 15:43:17 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-03-12 15:43:17 +0200
commitcf6b3e34b59ad120111e0c1ead779bbb3a70c38d (patch)
tree424e9def98c65d9080e72a69064334c6716fb82b /build/algorithm.ixx
parent5925c11a1fe8b2e02b790dd40b031ae005d5b68f (diff)
Implement clean operation
Diffstat (limited to 'build/algorithm.ixx')
-rw-r--r--build/algorithm.ixx27
1 files changed, 27 insertions, 0 deletions
diff --git a/build/algorithm.ixx b/build/algorithm.ixx
index e33566b..340789e 100644
--- a/build/algorithm.ixx
+++ b/build/algorithm.ixx
@@ -4,6 +4,15 @@
namespace build
{
+ target&
+ search_impl (prerequisite&);
+
+ inline target&
+ search (prerequisite& p)
+ {
+ return p.target != nullptr ? *p.target : search_impl (p);
+ }
+
void
match_impl (action, target&);
@@ -12,5 +21,23 @@ namespace build
{
if (!t.recipe (a))
match_impl (a, t);
+
+ t.dependents++;
+ }
+
+ target_state
+ execute_impl (action, target&);
+
+ inline target_state
+ execute (action a, target& t)
+ {
+ t.dependents--;
+
+ switch (t.state)
+ {
+ case target_state::unchanged:
+ case target_state::changed: return t.state;
+ default: return execute_impl (a, t);
+ }
}
}