summaryrefslogtreecommitdiff
path: root/libformat
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-06-19 18:26:51 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-06-19 18:26:51 +0300
commitef4070dd12a9aedec805003beaad3816ca4dc3f4 (patch)
treea5f8f65a1e289586554254f4c0dec3dbbb1f3130 /libformat
parent8a9eb6d0e140998871ae2e733c85d895b289f9df (diff)
Move project into intermediate sub-directory
Diffstat (limited to 'libformat')
-rw-r--r--libformat/.gitignore16
-rw-r--r--libformat/build/.gitignore1
-rw-r--r--libformat/build/bootstrap.build7
-rw-r--r--libformat/build/export.build6
-rw-r--r--libformat/build/root.build6
-rw-r--r--libformat/buildfile23
-rw-r--r--libformat/libformat/buildfile21
-rw-r--r--libformat/libformat/export.hxx (renamed from libformat/export.hxx)0
-rw-r--r--libformat/libformat/format.cxx (renamed from libformat/format.cxx)0
-rw-r--r--libformat/libformat/format.hxx (renamed from libformat/format.hxx)0
-rw-r--r--libformat/manifest15
-rw-r--r--libformat/tests/.gitignore1
-rw-r--r--libformat/tests/build/.gitignore1
-rw-r--r--libformat/tests/build/bootstrap.build5
-rw-r--r--libformat/tests/build/root.build14
-rw-r--r--libformat/tests/buildfile1
-rw-r--r--libformat/tests/test/buildfile4
-rw-r--r--libformat/tests/test/driver.cxx13
-rw-r--r--libformat/tests/test/test.out1
19 files changed, 117 insertions, 18 deletions
diff --git a/libformat/.gitignore b/libformat/.gitignore
new file mode 100644
index 0000000..a887fdd
--- /dev/null
+++ b/libformat/.gitignore
@@ -0,0 +1,16 @@
+# Compiler/linker output.
+#
+*.d
+*.ii
+*.o
+*.obj
+*.so
+*.dll
+*.a
+*.lib
+*.exp
+*.exe
+*.exe.dlls/
+*.exe.manifest
+
+version
diff --git a/libformat/build/.gitignore b/libformat/build/.gitignore
new file mode 100644
index 0000000..225c27f
--- /dev/null
+++ b/libformat/build/.gitignore
@@ -0,0 +1 @@
+config.build
diff --git a/libformat/build/bootstrap.build b/libformat/build/bootstrap.build
new file mode 100644
index 0000000..b6e8537
--- /dev/null
+++ b/libformat/build/bootstrap.build
@@ -0,0 +1,7 @@
+project = libformat
+
+using version
+using config
+using dist
+using test
+using install
diff --git a/libformat/build/export.build b/libformat/build/export.build
new file mode 100644
index 0000000..25c99aa
--- /dev/null
+++ b/libformat/build/export.build
@@ -0,0 +1,6 @@
+$out_root/:
+{
+ include libformat/
+}
+
+export $out_root/libformat/lib{format}
diff --git a/libformat/build/root.build b/libformat/build/root.build
new file mode 100644
index 0000000..8ceadfa
--- /dev/null
+++ b/libformat/build/root.build
@@ -0,0 +1,6 @@
+cxx.std = 11
+
+using cxx
+
+hxx{*}: extension = hxx
+cxx{*}: extension = cxx
diff --git a/libformat/buildfile b/libformat/buildfile
index 4f6f156..27e0dec 100644
--- a/libformat/buildfile
+++ b/libformat/buildfile
@@ -1,21 +1,8 @@
-lib{format}: {hxx cxx}{format} hxx{export}
+./: libformat/ tests/ doc{version} file{manifest}
-# For pre-releases use the complete version to make sure they cannot be used
-# in place of another pre-release or the final version.
-#
-if $version.pre_release
- lib{format}: bin.lib.version = @"-$version.project_id"
-else
- lib{format}: bin.lib.version = @"-$version.major.$version.minor"
-
-cxx.poptions =+ "-I$out_root" "-I$src_root"
-obja{*}: cxx.poptions += -DLIBFORMAT_STATIC_BUILD
-objs{*}: cxx.poptions += -DLIBFORMAT_SHARED_BUILD
-
-lib{format}: cxx.export.poptions = "-I$out_root" "-I$src_root"
-liba{format}: cxx.export.poptions += -DLIBFORMAT_STATIC
-libs{format}: cxx.export.poptions += -DLIBFORMAT_SHARED
+doc{version}: file{manifest} # Generated by the version module.
+doc{version}: dist = true
-# Install into the libformat/ subdirectory of, say, /usr/include/.
+# Don't install tests.
#
-install.include = $install.include/libformat/
+dir{tests/}: install = false
diff --git a/libformat/libformat/buildfile b/libformat/libformat/buildfile
new file mode 100644
index 0000000..4f6f156
--- /dev/null
+++ b/libformat/libformat/buildfile
@@ -0,0 +1,21 @@
+lib{format}: {hxx cxx}{format} hxx{export}
+
+# For pre-releases use the complete version to make sure they cannot be used
+# in place of another pre-release or the final version.
+#
+if $version.pre_release
+ lib{format}: bin.lib.version = @"-$version.project_id"
+else
+ lib{format}: bin.lib.version = @"-$version.major.$version.minor"
+
+cxx.poptions =+ "-I$out_root" "-I$src_root"
+obja{*}: cxx.poptions += -DLIBFORMAT_STATIC_BUILD
+objs{*}: cxx.poptions += -DLIBFORMAT_SHARED_BUILD
+
+lib{format}: cxx.export.poptions = "-I$out_root" "-I$src_root"
+liba{format}: cxx.export.poptions += -DLIBFORMAT_STATIC
+libs{format}: cxx.export.poptions += -DLIBFORMAT_SHARED
+
+# Install into the libformat/ subdirectory of, say, /usr/include/.
+#
+install.include = $install.include/libformat/
diff --git a/libformat/export.hxx b/libformat/libformat/export.hxx
index 125c9df..125c9df 100644
--- a/libformat/export.hxx
+++ b/libformat/libformat/export.hxx
diff --git a/libformat/format.cxx b/libformat/libformat/format.cxx
index 421f50d..421f50d 100644
--- a/libformat/format.cxx
+++ b/libformat/libformat/format.cxx
diff --git a/libformat/format.hxx b/libformat/libformat/format.hxx
index 9c813ac..9c813ac 100644
--- a/libformat/format.hxx
+++ b/libformat/libformat/format.hxx
diff --git a/libformat/manifest b/libformat/manifest
new file mode 100644
index 0000000..23cf1bb
--- /dev/null
+++ b/libformat/manifest
@@ -0,0 +1,15 @@
+: 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
+build-email: builds@build2.org
+requires: c++11
+depends: * build2 >= 0.5.0-
+depends: * bpkg >= 0.5.0-
diff --git a/libformat/tests/.gitignore b/libformat/tests/.gitignore
new file mode 100644
index 0000000..e54525b
--- /dev/null
+++ b/libformat/tests/.gitignore
@@ -0,0 +1 @@
+driver
diff --git a/libformat/tests/build/.gitignore b/libformat/tests/build/.gitignore
new file mode 100644
index 0000000..225c27f
--- /dev/null
+++ b/libformat/tests/build/.gitignore
@@ -0,0 +1 @@
+config.build
diff --git a/libformat/tests/build/bootstrap.build b/libformat/tests/build/bootstrap.build
new file mode 100644
index 0000000..2c2de24
--- /dev/null
+++ b/libformat/tests/build/bootstrap.build
@@ -0,0 +1,5 @@
+project = # Unnamed subproject.
+
+using config
+using dist
+using test
diff --git a/libformat/tests/build/root.build b/libformat/tests/build/root.build
new file mode 100644
index 0000000..a2ee38a
--- /dev/null
+++ b/libformat/tests/build/root.build
@@ -0,0 +1,14 @@
+cxx.std = 11
+
+using cxx
+
+hxx{*}: extension = hxx
+cxx{*}: extension = cxx
+
+# Every exe{} in this subproject is by default a test.
+#
+exe{*}: test = true
+
+# Specify the test target for cross-testing.
+#
+test.target = $cxx.target
diff --git a/libformat/tests/buildfile b/libformat/tests/buildfile
new file mode 100644
index 0000000..1a8bcc9
--- /dev/null
+++ b/libformat/tests/buildfile
@@ -0,0 +1 @@
+./: test/
diff --git a/libformat/tests/test/buildfile b/libformat/tests/test/buildfile
new file mode 100644
index 0000000..92d2804
--- /dev/null
+++ b/libformat/tests/test/buildfile
@@ -0,0 +1,4 @@
+import libs = libformat%lib{format}
+
+exe{driver}: cxx{driver} $libs
+exe{driver}: test.output = test.out
diff --git a/libformat/tests/test/driver.cxx b/libformat/tests/test/driver.cxx
new file mode 100644
index 0000000..fb2939d
--- /dev/null
+++ b/libformat/tests/test/driver.cxx
@@ -0,0 +1,13 @@
+// file: tests/test/driver.cxx -*- C++ -*-
+
+#include <iostream>
+
+#include <libformat/format.hxx>
+
+int
+main ()
+{
+ using namespace std;
+
+ cout << format ("Hello", "World") << endl;
+}
diff --git a/libformat/tests/test/test.out b/libformat/tests/test/test.out
new file mode 100644
index 0000000..8ab686e
--- /dev/null
+++ b/libformat/tests/test/test.out
@@ -0,0 +1 @@
+Hello, World!