aboutsummaryrefslogtreecommitdiff
path: root/build/spec
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-03-07 14:36:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-03-07 14:36:51 +0200
commit7de6f6f275d840e8d9523c72d8f4309c51b4dcd3 (patch)
tree4b0387fe8f80db3ea6214aea330c03f3d1145c08 /build/spec
parent897a0e4fdf9ca90ee8d236a38e138a8ae6bc3627 (diff)
Add support for buildspec
Diffstat (limited to 'build/spec')
-rw-r--r--build/spec58
1 files changed, 58 insertions, 0 deletions
diff --git a/build/spec b/build/spec
new file mode 100644
index 0000000..9ca8c4d
--- /dev/null
+++ b/build/spec
@@ -0,0 +1,58 @@
+// file : build/spec -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#ifndef BUILD_SPEC
+#define BUILD_SPEC
+
+#include <string>
+#include <vector>
+#include <iosfwd>
+#include <utility> // move()
+
+#include <build/path>
+#include <build/name>
+
+namespace build
+{
+ struct targetspec
+ {
+ targetspec (path sr, name t)
+ : src_root (std::move (sr)), target (std::move (t)) {}
+
+ path src_root;
+ name target; // target.dir is out_root.
+ };
+
+ struct opspec: std::vector<targetspec>
+ {
+ opspec () = default;
+ opspec (std::string o): operation (std::move (o)) {}
+
+ std::string operation;
+ };
+
+ struct metaopspec: std::vector<opspec>
+ {
+ metaopspec () = default;
+ metaopspec (std::string mo): meta_operation (std::move (mo)) {}
+
+ std::string meta_operation;
+ };
+
+ typedef std::vector<metaopspec> buildspec;
+
+ std::ostream&
+ operator<< (std::ostream&, const targetspec&);
+
+ std::ostream&
+ operator<< (std::ostream&, const opspec&);
+
+ std::ostream&
+ operator<< (std::ostream&, const metaopspec&);
+
+ std::ostream&
+ operator<< (std::ostream&, const buildspec&);
+}
+
+#endif // BUILD_SPEC