From f013fac528515dad78c9a624216b1e0217a5f3bb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Jan 2016 10:26:47 +0200 Subject: "Hello World" formatter C++ library with build2 --- .gitignore | 4 ++++ build/.gitignore | 1 + build/bootstrap.build | 14 ++++++++++++++ build/export.build | 6 ++++++ build/root.build | 6 ++++++ buildfile | 3 +++ format/buildfile | 8 ++++++++ format/format | 8 ++++++++ format/format.cxx | 11 +++++++++++ manifest | 12 ++++++++++++ version | 1 + 11 files changed, 74 insertions(+) create mode 100644 .gitignore create mode 100644 build/.gitignore create mode 100644 build/bootstrap.build create mode 100644 build/export.build create mode 100644 build/root.build create mode 100644 buildfile create mode 100644 format/buildfile create mode 100644 format/format create mode 100644 format/format.cxx create mode 100644 manifest create mode 100644 version 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 + +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 + +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 -- cgit v1.1