aboutsummaryrefslogtreecommitdiff
path: root/build/rule
diff options
context:
space:
mode:
Diffstat (limited to 'build/rule')
-rw-r--r--build/rule39
1 files changed, 39 insertions, 0 deletions
diff --git a/build/rule b/build/rule
new file mode 100644
index 0000000..6bb58fe
--- /dev/null
+++ b/build/rule
@@ -0,0 +1,39 @@
+// file : build/rule -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#ifndef BUILD_RULE
+#define BUILD_RULE
+
+#include <typeindex>
+#include <functional> // reference_wrapper
+#include <unordered_map>
+
+#include <build/target>
+
+namespace build
+{
+ class rule
+ {
+ public:
+ virtual recipe
+ match (target&) const = 0;
+ };
+
+ typedef std::unordered_multimap<std::type_index,
+ std::reference_wrapper<rule>> rule_map;
+
+ extern rule_map rules;
+
+ class default_path_rule: public rule
+ {
+ public:
+ virtual recipe
+ match (target&) const;
+
+ static target_state
+ update (target&);
+ };
+}
+
+#endif // BUILD_RULE