aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bbot/agent/agent.cxx2
-rw-r--r--bbot/agent/machine.cxx3
-rw-r--r--bbot/buildfile35
-rw-r--r--bbot/machine-manifest.cxx (renamed from bbot/agent/machine-manifest.cxx)4
-rw-r--r--bbot/machine-manifest.hxx (renamed from bbot/agent/machine-manifest.hxx)8
-rw-r--r--build/root.build4
-rw-r--r--unit-tests/bootstrap-manifest/buildfile7
-rw-r--r--unit-tests/machine-manifest/buildfile7
-rw-r--r--unit-tests/machine-manifest/driver.cxx2
9 files changed, 33 insertions, 39 deletions
diff --git a/bbot/agent/agent.cxx b/bbot/agent/agent.cxx
index 80b4fb7..c0849c6 100644
--- a/bbot/agent/agent.cxx
+++ b/bbot/agent/agent.cxx
@@ -30,11 +30,11 @@
#include <bbot/utility.hxx>
#include <bbot/diagnostics.hxx>
+#include <bbot/machine-manifest.hxx>
#include <bbot/bootstrap-manifest.hxx>
#include <bbot/agent/tftp.hxx>
#include <bbot/agent/machine.hxx>
-#include <bbot/agent/machine-manifest.hxx>
using namespace std;
using namespace butl;
diff --git a/bbot/agent/machine.cxx b/bbot/agent/machine.cxx
index 422c623..f3c9874 100644
--- a/bbot/agent/machine.cxx
+++ b/bbot/agent/machine.cxx
@@ -12,8 +12,9 @@
#include <cstdio> // snprintf()
#include <cstring> // strcpy()
+#include <bbot/machine-manifest.hxx>
+
#include <bbot/agent/agent.hxx>
-#include <bbot/agent/machine-manifest.hxx>
using namespace std;
using namespace butl;
diff --git a/bbot/buildfile b/bbot/buildfile
index a576cce..60f120f 100644
--- a/bbot/buildfile
+++ b/bbot/buildfile
@@ -5,7 +5,7 @@
# Systemd .service file.
#
# @@ Currently the executable path is hardcoded as /usr/bin/bbot-agent. To
-# handle this properly would need to generate/pre-process it )and detect
+# handle this properly would need to generate/pre-process it (and detect
# update for install).
#
define service: file
@@ -24,18 +24,19 @@ if ($cxx.target.class == "linux")
{
./: exe{bbot-agent} service{'bbot-agent@'}
- exe{bbot-agent}: {hxx ixx txx cxx}{* +agent/* -**-options -version} \
- {hxx ixx cxx}{common-options agent/agent-options} \
- {hxx}{version} \
- $libs
+ exe{bbot-agent}: agent/{hxx ixx txx cxx}{* -agent-options} \
+ agent/{hxx ixx cxx}{agent-options} libu{bbot}
}
./: exe{bbot-worker}
-exe{bbot-worker}: {hxx ixx txx cxx}{* +worker/* -**-options -version} \
- {hxx ixx cxx}{common-options worker/worker-options} \
- {hxx}{version} \
- $libs
+exe{bbot-worker}: worker/{hxx ixx txx cxx}{* -worker-options} \
+ worker/{hxx ixx cxx}{worker-options} libu{bbot}
+
+libu{bbot}: bin.whole = false
+libu{bbot}: {hxx ixx txx cxx}{* -common-options -version} \
+ {hxx ixx cxx}{common-options} {hxx}{version} \
+ $libs
hxx{version}: in{version} $src_root/file{manifest}
hxx{version}: dist = true
@@ -45,26 +46,26 @@ hxx{version}: dist = true
if $cli.configured
{
cli.cxx{common-options}: cli{common}
- cli.cxx{agent/agent-options}: cli{agent/agent}
- cli.cxx{worker/worker-options}: cli{worker/worker}
+ agent/cli.cxx{agent-options}: cli{agent/agent}
+ worker/cli.cxx{worker-options}: cli{worker/worker}
cli.options += -I $src_root --include-with-brackets \
--cxx-prologue "#include <bbot/types-parsers.hxx>" \
--cli-namespace bbot::cli --generate-specifier --generate-parse
- cli.cxx{common-options}: \
- cli.options += --include-prefix bbot --guard-prefix BBOT # No usage.
+ cli.cxx{common-options}: cli.options += --include-prefix bbot \
+--guard-prefix BBOT # No usage.
# Usage options.
#
cli.options += --suppress-undocumented --long-usage --ansi-color \
--page-usage 'bbot::print_$name$_' --option-length 23
- cli.cxx{agent/agent-options}: \
- cli.options += --include-prefix bbot/agent --guard-prefix BBOT_AGENT
+ agent/cli.cxx{agent-options}: cli.options += --include-prefix bbot/agent \
+--guard-prefix BBOT_AGENT
- cli.cxx{worker/worker-options}: \
- cli.options += --include-prefix bbot/worker --guard-prefix BBOT_WORKER
+ worker/cli.cxx{worker-options}: cli.options += --include-prefix bbot/worker \
+--guard-prefix BBOT_WORKER
# Include generated cli files into the distribution.
#
diff --git a/bbot/agent/machine-manifest.cxx b/bbot/machine-manifest.cxx
index 3312d1b..b7baf7e 100644
--- a/bbot/agent/machine-manifest.cxx
+++ b/bbot/machine-manifest.cxx
@@ -1,8 +1,8 @@
-// file : bbot/agent/machine-manifest.cxx -*- C++ -*-
+// file : bbot/machine-manifest.cxx -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license : TBC; see accompanying LICENSE file
-#include <bbot/agent/machine-manifest.hxx>
+#include <bbot/machine-manifest.hxx>
#include <sstream>
diff --git a/bbot/agent/machine-manifest.hxx b/bbot/machine-manifest.hxx
index 37919ba..efcdda4 100644
--- a/bbot/agent/machine-manifest.hxx
+++ b/bbot/machine-manifest.hxx
@@ -1,9 +1,9 @@
-// file : bbot/agent/machine-manifest.hxx -*- C++ -*-
+// file : bbot/machine-manifest.hxx -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license : TBC; see accompanying LICENSE file
-#ifndef BBOT_AGENT_MACHINE_MANIFEST_HXX
-#define BBOT_AGENT_MACHINE_MANIFEST_HXX
+#ifndef BBOT_MACHINE_MANIFEST_HXX
+#define BBOT_MACHINE_MANIFEST_HXX
#include <map>
@@ -115,4 +115,4 @@ namespace bbot
using bootstrapped_machine_manifests = vector<bootstrapped_machine_manifest>;
}
-#endif // BBOT_AGENT_MACHINE_MANIFEST_HXX
+#endif // BBOT_MACHINE_MANIFEST_HXX
diff --git a/build/root.build b/build/root.build
index f63ff10..363cb62 100644
--- a/build/root.build
+++ b/build/root.build
@@ -21,9 +21,11 @@ cxx.poptions =+ "-I$out_root" "-I$src_root"
#
using? cli
-# All exe{} in unit-tests/ are, well, tests.
+# All exe{} in unit-tests/ are, well, tests. Also don't link whole archives
+# by default there.
#
unit-tests/exe{*}: test = true
+unit-tests/libu{*}: bin.whole = false
# Specify the test target for cross-testing.
#
diff --git a/unit-tests/bootstrap-manifest/buildfile b/unit-tests/bootstrap-manifest/buildfile
index 2be37fb..c628833 100644
--- a/unit-tests/bootstrap-manifest/buildfile
+++ b/unit-tests/bootstrap-manifest/buildfile
@@ -2,10 +2,5 @@
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license : TBC; see accompanying LICENSE file
-import libs = libbutl%lib{butl}
-import libs += libbbot%lib{bbot}
-
-exe{driver}: {hxx cxx}{*} ../../bbot/{hxx cxx}{bootstrap-manifest} $libs \
- test{testscript}
-
include ../../bbot/
+exe{driver}: {hxx cxx}{*} ../../bbot/libu{bbot} test{testscript}
diff --git a/unit-tests/machine-manifest/buildfile b/unit-tests/machine-manifest/buildfile
index d56aa1f..6d47d77 100644
--- a/unit-tests/machine-manifest/buildfile
+++ b/unit-tests/machine-manifest/buildfile
@@ -2,10 +2,5 @@
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license : TBC; see accompanying LICENSE file
-import libs = libbutl%lib{butl}
-import libs += libbbot%lib{bbot}
-
-exe{driver}: {hxx cxx}{*} ../../bbot/{hxx cxx}{**-manifest} $libs \
- test{testscript}
-
include ../../bbot/
+exe{driver}: {hxx cxx}{*} ../../bbot/libu{bbot} test{testscript}
diff --git a/unit-tests/machine-manifest/driver.cxx b/unit-tests/machine-manifest/driver.cxx
index db42434..44b1e36 100644
--- a/unit-tests/machine-manifest/driver.cxx
+++ b/unit-tests/machine-manifest/driver.cxx
@@ -11,7 +11,7 @@
#include <bbot/types.hxx>
#include <bbot/utility.hxx>
-#include <bbot/agent/machine-manifest.hxx>
+#include <bbot/machine-manifest.hxx>
using namespace std;
using namespace butl;