aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-14 16:46:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-14 16:46:08 +0200
commit589b66ec94d95b4bea8d9a0d23c8439dff9031de (patch)
tree1d2a46917ce16c956d88404597bd5fde352dfc7b
parent8f2a63aa4e0e047154b09c7d0fd0f392bdf46f44 (diff)
Clean up buildfiles, make dist work
-rw-r--r--brep/buildfile53
-rw-r--r--build/bootstrap.build11
-rw-r--r--build/export.build10
-rw-r--r--build/root.build21
-rw-r--r--buildfile2
-rw-r--r--loader/buildfile10
-rw-r--r--loader/loader.cxx2
-rw-r--r--tests/loader/buildfile2
-rw-r--r--version2
9 files changed, 90 insertions, 23 deletions
diff --git a/brep/buildfile b/brep/buildfile
index 1cdb864..eb3f472 100644
--- a/brep/buildfile
+++ b/brep/buildfile
@@ -2,12 +2,10 @@
# copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
-using cli
-
define mod: libso
mod{*}: bin.libprefix = mod_
-./: libso{brep} mod{brep}
+./: lib{brep} mod{brep}
# lib{brep}
#
@@ -15,23 +13,50 @@ import libs += libodb%lib{odb}
import libs += libodb-pgsql%lib{odb-pgsql}
import libs += libbpkg%lib{bpkg}
-brep = cxx{package package-traits package-odb}
+lib{brep}: \
+{hxx cxx}{ package } \
+{hxx cxx}{ package-traits } \
+{hxx ixx cxx}{ package-odb } \
+$libs
-libso{brep}: $brep $libs
libso{brep}: cxx.export.poptions = -I$out_root -I$src_root
+# Install into the brep/ subdirectory of, say, /usr/include/.
+#
+install.include = $install.include/brep
+
# mod{brep}
#
import libs += libstudxml%lib{studxml}
-brep = cxx{services diagnostics module repository-root package-search \
- package-details package-version-details repository-details \
- shared-database page types-parsers} \
- cli.cxx{options}
-
-web = ../web/apache/cxx{request service} ../web/cxx{mime-url-encoding}
-
-mod{brep}: $brep $web libso{brep} $libs
+mod{brep}: \
+ {hxx cxx}{ diagnostics } \
+ {hxx cxx}{ module } \
+ {hxx ixx cxx}{ options } \
+ {hxx }{ options-types } \
+ {hxx cxx}{ package } \
+ {hxx cxx}{ package-details } \
+ {hxx ixx cxx}{ package-odb } \
+ {hxx cxx}{ package-search } \
+ {hxx cxx}{ package-traits } \
+ {hxx cxx}{ package-version-details } \
+ {hxx cxx}{ page } \
+ {hxx cxx}{ repository-details } \
+ {hxx cxx}{ repository-root } \
+ { cxx}{ services } \
+ {hxx cxx}{ shared-database } \
+ {hxx }{ types } \
+ {hxx cxx}{ types-parsers } \
+ {hxx }{ utility } \
+ {hxx }{ wrapper-traits } \
+ ../web/{hxx cxx}{ mime-url-encoding } \
+ ../web/{hxx }{ module } \
+ ../web/{hxx }{ xhtml } \
+../web/apache/{hxx }{ log } \
+../web/apache/{hxx ixx cxx}{ request } \
+../web/apache/{hxx txx cxx}{ service } \
+../web/apache/{hxx }{ stream } \
+lib{brep} $libs
# Set option prefix to the empty value to handle all unknown request parameters
# uniformly with a single catch block.
@@ -42,4 +67,4 @@ cli.options += --std c++11 -I $src_root --include-with-brackets \
--cli-namespace brep::cli --generate-file-scanner --suppress-usage \
--generate-modifier --generate-description --option-prefix ""
-cli.cxx{options}: cli{options}
+{hxx ixx cxx}{options}: cli{options}
diff --git a/build/bootstrap.build b/build/bootstrap.build
index fda9151..728c2a8 100644
--- a/build/bootstrap.build
+++ b/build/bootstrap.build
@@ -1,3 +1,14 @@
+# file : build/bootstrap.build
+# copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
project = brep
+version = 0.1.0
+
+using build@0.1.0
using config
+using dist
using test
+using install
+
+dist.package = $project-$version
diff --git a/build/export.build b/build/export.build
new file mode 100644
index 0000000..44e84ae
--- /dev/null
+++ b/build/export.build
@@ -0,0 +1,10 @@
+# file : build/export.build
+# copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+$out_root/:
+{
+ include brep/
+}
+
+export $out_root/brep/lib{brep}
diff --git a/build/root.build b/build/root.build
index 8924086..53219ae 100644
--- a/build/root.build
+++ b/build/root.build
@@ -1,3 +1,7 @@
+# file : build/root.build
+# copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
using cxx
hxx{*}: extension =
@@ -8,6 +12,23 @@ cxx{*}: extension = cxx
cxx.std = 11
cxx.poptions =+ -I$out_root -I$src_root
+# Load the cli module but only if it's available. This way a distribution
+# that includes pre-generated files can be built without installing cli.
+#
+using? cli
+
+if! $cli.loaded
+{
+ define cli: file
+ cli{*}: extension = cli
+}
+
+# Include generated cli files into the distribution.
+#
+hxx{*options}: dist = true
+ixx{*options}: dist = true
+cxx{*options}: dist = true
+
# All exe{} in tests/ are, well, tests.
#
tests/: test.exe = true
diff --git a/buildfile b/buildfile
index 65768b4..205cb3e 100644
--- a/buildfile
+++ b/buildfile
@@ -3,5 +3,5 @@
# license : MIT; see accompanying LICENSE file
d = brep/ loader/ tests/
-./: $d
+./: $d doc{LICENSE version}
include $d
diff --git a/loader/buildfile b/loader/buildfile
index bb5684e..ffa8a9c 100644
--- a/loader/buildfile
+++ b/loader/buildfile
@@ -2,8 +2,6 @@
# copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
-using cli
-
import libs += libbpkg%lib{bpkg}
import libs += libbutl%lib{butl}
import libs += libodb-pgsql%lib{odb-pgsql}
@@ -11,10 +9,12 @@ import libs += libodb%lib{odb}
include ../brep/
-loader = cxx{loader} cli.cxx{options}
-exe{brep-loader}: $loader ../brep/libso{brep} $libs
+exe{brep-loader}: \
+{ cxx}{ loader } \
+{hxx ixx cxx}{ options } \
+../brep/lib{brep} $libs
cli.options += -I $src_root --include-with-brackets --include-prefix loader \
--guard-prefix LOADER --cli-namespace brep::cli
-cli.cxx{options}: cli{options}
+{hxx ixx cxx}{options}: cli{options}
diff --git a/loader/loader.cxx b/loader/loader.cxx
index 3083366..7d8570a 100644
--- a/loader/loader.cxx
+++ b/loader/loader.cxx
@@ -704,7 +704,7 @@ main (int argc, char* argv[])
//
if (ops.version ())
{
- cout << "brep-loader 0.0.0" << endl
+ cout << "brep-loader 0.1.0" << endl
<< "Copyright (c) 2014-2015 Code Synthesis Ltd" << endl
<< "MIT; see accompanying LICENSE file" << endl;
diff --git a/tests/loader/buildfile b/tests/loader/buildfile
index 1ce249f..e531a1f 100644
--- a/tests/loader/buildfile
+++ b/tests/loader/buildfile
@@ -9,7 +9,7 @@ import libs += libodb%lib{odb}
include ../../brep/
-exe{driver}: cxx{driver} ../../brep/libso{brep} $libs
+exe{driver}: cxx{driver} ../../brep/lib{brep} $libs
# Disable for now until build2 test module supports running custom
# commands, pre/post steps.
diff --git a/version b/version
index 77d6f4c..6e8bf73 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-0.0.0
+0.1.0