aboutsummaryrefslogtreecommitdiff
path: root/build2/rule.hxx
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.hxx
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.hxx')
-rw-r--r--build2/rule.hxx26
1 files changed, 10 insertions, 16 deletions
diff --git a/build2/rule.hxx b/build2/rule.hxx
index 8e43ca6..f4a7798 100644
--- a/build2/rule.hxx
+++ b/build2/rule.hxx
@@ -29,41 +29,38 @@ namespace build2
apply (action, target&) const = 0;
};
- // Fallback rule that only matches if the file exists.
+ // Fallback rule that only matches if the file exists. It will also match
+ // an mtime_target provided it has a set timestamp.
//
class file_rule: public rule
{
public:
- file_rule () {}
-
virtual bool
match (action, target&, const string&) const override;
virtual recipe
apply (action, target&) const override;
+ file_rule () {}
static const file_rule instance;
};
class alias_rule: public rule
{
public:
- alias_rule () {}
-
virtual bool
match (action, target&, const string&) const override;
virtual recipe
apply (action, target&) const override;
+ alias_rule () {}
static const alias_rule instance;
};
class fsdir_rule: public rule
{
public:
- fsdir_rule () {}
-
virtual bool
match (action, target&, const string&) const override;
@@ -82,26 +79,23 @@ namespace build2
static void
perform_update_direct (action, const target&);
+ fsdir_rule () {}
static const fsdir_rule instance;
};
// Fallback rule that always matches and does nothing.
//
- class fallback_rule: public build2::rule
+ class noop_rule: public rule
{
public:
- fallback_rule () {}
-
virtual bool
- match (action, target&, const string&) const override
- {
- return true;
- }
+ match (action, target&, const string&) const override;
virtual recipe
- apply (action, target&) const override {return noop_recipe;}
+ apply (action, target&) const override;
- static const fallback_rule instance;
+ noop_rule () {}
+ static const noop_rule instance;
};
}