summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-01-22 10:26:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-01-22 10:26:47 +0200
commitf013fac528515dad78c9a624216b1e0217a5f3bb (patch)
tree88a98bdb6f4b6c385f06239eb7c46ce8acf5d3c8
"Hello World" formatter C++ library with build2
-rw-r--r--.gitignore4
-rw-r--r--build/.gitignore1
-rw-r--r--build/bootstrap.build14
-rw-r--r--build/export.build6
-rw-r--r--build/root.build6
-rw-r--r--buildfile3
-rw-r--r--format/buildfile8
-rw-r--r--format/format8
-rw-r--r--format/format.cxx11
-rw-r--r--manifest12
-rw-r--r--version1
11 files changed, 74 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..274fdd1
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.o
+*.so
+*.a
+core
diff --git a/build/.gitignore b/build/.gitignore
new file mode 100644
index 0000000..225c27f
--- /dev/null
+++ b/build/.gitignore
@@ -0,0 +1 @@
+config.build
diff --git a/build/bootstrap.build b/build/bootstrap.build
new file mode 100644
index 0000000..9101716
--- /dev/null
+++ b/build/bootstrap.build
@@ -0,0 +1,14 @@
+project = libformat
+version = 1.0.0
+revision = 0
+
+using config
+using dist
+using install
+
+dist.package = $project-$version
+
+if ($revision != 0)
+{
+ dist.package += +$revision
+}
diff --git a/build/export.build b/build/export.build
new file mode 100644
index 0000000..53e115c
--- /dev/null
+++ b/build/export.build
@@ -0,0 +1,6 @@
+$out_root/:
+{
+ include format/
+}
+
+export $out_root/format/lib{format}
diff --git a/build/root.build b/build/root.build
new file mode 100644
index 0000000..9ade644
--- /dev/null
+++ b/build/root.build
@@ -0,0 +1,6 @@
+using cxx
+
+hxx{*}: extension =
+cxx{*}: extension = cxx
+
+cxx.std = 11
diff --git a/buildfile b/buildfile
new file mode 100644
index 0000000..8d63a42
--- /dev/null
+++ b/buildfile
@@ -0,0 +1,3 @@
+d = format/
+./: $d doc{version} file{manifest}
+include $d
diff --git a/format/buildfile b/format/buildfile
new file mode 100644
index 0000000..4edb840
--- /dev/null
+++ b/format/buildfile
@@ -0,0 +1,8 @@
+lib{format}: {hxx cxx}{format}
+
+cxx.poptions += -I$src_root
+lib{format}: cxx.export.poptions = -I$src_root
+
+# Install into the format/ subdirectory of, say, /usr/include/.
+#
+install.include = $install.include/format
diff --git a/format/format b/format/format
new file mode 100644
index 0000000..6c4d5f8
--- /dev/null
+++ b/format/format
@@ -0,0 +1,8 @@
+// file: format/format -*- C++ -*-
+
+#pragma once
+
+#include <string>
+
+std::string
+format (const std::string& greeting, const std::string& name);
diff --git a/format/format.cxx b/format/format.cxx
new file mode 100644
index 0000000..0566e78
--- /dev/null
+++ b/format/format.cxx
@@ -0,0 +1,11 @@
+// file: format/format.cxx -*- C++ -*-
+
+#include <format/format>
+
+using namespace std;
+
+string
+format (const string& g, const string& n)
+{
+ return g + ", " + n + '!';
+}
diff --git a/manifest b/manifest
new file mode 100644
index 0000000..7083f18
--- /dev/null
+++ b/manifest
@@ -0,0 +1,12 @@
+: 1
+name: libformat
+version: 1.0.0
+summary: The "Hello World" example formatter library
+license: MIT
+tags: c++, hello, world, formatter, example
+description: \
+A simple library that implements the "Hello World" formatting in C++.
+\
+url: http://www.example.org/libformat
+email: hello-users@example.org
+requires: c++11
diff --git a/version b/version
new file mode 100644
index 0000000..3eefcb9
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+1.0.0