summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-01-22 10:27:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-01-22 10:27:59 +0200
commitd1753af195bccde1690f639ee83a6a8611d9e323 (patch)
tree4f51663112a1be23ef7089fc29f8df86d38bef2f
"Hello World" printer 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--manifest12
-rw-r--r--print/buildfile8
-rw-r--r--print/print8
-rw-r--r--print/print.cxx13
-rw-r--r--version1
11 files changed, 76 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..a7e8eb6
--- /dev/null
+++ b/build/bootstrap.build
@@ -0,0 +1,14 @@
+project = libprint
+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..dd96278
--- /dev/null
+++ b/build/export.build
@@ -0,0 +1,6 @@
+$out_root/:
+{
+ include print/
+}
+
+export $out_root/print/lib{print}
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..ae49972
--- /dev/null
+++ b/buildfile
@@ -0,0 +1,3 @@
+d = print/
+./: $d doc{version} file{manifest}
+include $d
diff --git a/manifest b/manifest
new file mode 100644
index 0000000..6d2923a
--- /dev/null
+++ b/manifest
@@ -0,0 +1,12 @@
+: 1
+name: libprint
+version: 1.0.0
+summary: The "Hello World" example printer library
+license: MIT
+tags: c++, hello, world, printer, example
+description: \
+A simple library that implements the "Hello World" example printer in C++.
+\
+url: http://www.example.org/libprint
+email: hello-users@example.org
+requires: c++11
diff --git a/print/buildfile b/print/buildfile
new file mode 100644
index 0000000..20a7d60
--- /dev/null
+++ b/print/buildfile
@@ -0,0 +1,8 @@
+lib{print}: {hxx cxx}{print}
+
+cxx.poptions += -I$src_root
+lib{print}: cxx.export.poptions = -I$src_root
+
+# Install into the print/ subdirectory of, say, /usr/include/.
+#
+install.include = $install.include/print
diff --git a/print/print b/print/print
new file mode 100644
index 0000000..8943b6e
--- /dev/null
+++ b/print/print
@@ -0,0 +1,8 @@
+// file: print/print -*- C++ -*-
+
+#pragma once
+
+#include <string>
+
+void
+print (const std::string& hello);
diff --git a/print/print.cxx b/print/print.cxx
new file mode 100644
index 0000000..99a466d
--- /dev/null
+++ b/print/print.cxx
@@ -0,0 +1,13 @@
+// file: print/print.cxx -*- C++ -*-
+
+#include <print/print>
+
+#include <iostream>
+
+using namespace std;
+
+void
+print (const string& h)
+{
+ cout << h << endl;
+}
diff --git a/version b/version
new file mode 100644
index 0000000..3eefcb9
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+1.0.0