aboutsummaryrefslogtreecommitdiff
path: root/build2/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-02-07 10:00:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-02-07 14:05:39 +0200
commit378b2598a305d4e332e52460ca89dd867546a58b (patch)
tree7541771843232bc6d51880d58a57e25737b7ba13 /build2/rule.cxx
parentf10be65c39c18668df31c8680569a6417ef3ae06 (diff)
Initial work for default update outer operation
While update still uses the old "all update rules update all their prerequisites" assumption, test and install have been fixed not to rely on this.
Diffstat (limited to 'build2/rule.cxx')
-rw-r--r--build2/rule.cxx25
1 files changed, 23 insertions, 2 deletions
diff --git a/build2/rule.cxx b/build2/rule.cxx
index ef1d3a4..e215846 100644
--- a/build2/rule.cxx
+++ b/build2/rule.cxx
@@ -98,6 +98,11 @@ namespace build2
recipe file_rule::
apply (action a, target& t) const
{
+ /*
+ @@ outer
+ return noop_recipe;
+ */
+
// Update triggers the update of this target's prerequisites so it would
// seem natural that we should also trigger their cleanup. However, this
// possibility is rather theoretical so until we see a real use-case for
@@ -220,6 +225,8 @@ namespace build2
// First update prerequisites (e.g. create parent directories) then create
// this directory.
//
+ // @@ outer: should we assume for simplicity its only prereqs are fsdir{}?
+ //
if (!t.prerequisite_targets[a].empty ())
ts = straight_execute_prerequisites (a, t);
@@ -232,6 +239,8 @@ namespace build2
// better performance by first checking if it indeed exists. See
// butl::try_mkdir() for details.
//
+ // @@ Also skip prerequisites? Can't we return noop in apply?
+ //
if (!exists (d) && fsdir_mkdir (t, d))
ts |= target_state::changed;
@@ -280,7 +289,19 @@ namespace build2
const fsdir_rule fsdir_rule::instance;
- // fallback_rule
+ // noop_rule
//
- const fallback_rule fallback_rule::instance;
+ bool noop_rule::
+ match (action, target&, const string&) const
+ {
+ return true;
+ }
+
+ recipe noop_rule::
+ apply (action, target&) const
+ {
+ return noop_recipe;
+ }
+
+ const noop_rule noop_rule::instance;
}