diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-22 10:27:59 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-22 10:27:59 +0200 |
commit | d1753af195bccde1690f639ee83a6a8611d9e323 (patch) | |
tree | 4f51663112a1be23ef7089fc29f8df86d38bef2f |
"Hello World" printer C++ library with build2
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | build/.gitignore | 1 | ||||
-rw-r--r-- | build/bootstrap.build | 14 | ||||
-rw-r--r-- | build/export.build | 6 | ||||
-rw-r--r-- | build/root.build | 6 | ||||
-rw-r--r-- | buildfile | 3 | ||||
-rw-r--r-- | manifest | 12 | ||||
-rw-r--r-- | print/buildfile | 8 | ||||
-rw-r--r-- | print/print | 8 | ||||
-rw-r--r-- | print/print.cxx | 13 | ||||
-rw-r--r-- | version | 1 |
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; +} @@ -0,0 +1 @@ +1.0.0 |