aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-07-13 22:50:15 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-07-14 19:10:22 +0300
commitc8ace1ee0a6cab5fd4ea2f084ea436cfa513637d (patch)
treea8db884a665fbf14797393a3b2ff95438c338bb9
parent8e8d599b129d35f638f2c1957c869b054a38b021 (diff)
Make use of wildcards in buildfiles
-rw-r--r--bbot/agent/agent.cli (renamed from bbot/agent.cli)0
-rw-r--r--bbot/agent/agent.cxx (renamed from bbot/agent.cxx)11
-rw-r--r--bbot/agent/agent.hxx (renamed from bbot/agent.hxx)10
-rw-r--r--bbot/agent/machine-manifest.cxx (renamed from bbot/machine-manifest.cxx)4
-rw-r--r--bbot/agent/machine-manifest.hxx (renamed from bbot/machine-manifest.hxx)8
-rw-r--r--bbot/agent/machine.cxx (renamed from bbot/machine.cxx)8
-rw-r--r--bbot/agent/machine.hxx (renamed from bbot/machine.hxx)8
-rw-r--r--bbot/agent/tftp.cxx (renamed from bbot/tftp.cxx)6
-rw-r--r--bbot/agent/tftp.hxx (renamed from bbot/tftp.hxx)8
-rw-r--r--bbot/buildfile50
-rw-r--r--bbot/worker/worker.cli (renamed from bbot/worker.cli)0
-rw-r--r--bbot/worker/worker.cxx (renamed from bbot/worker.cxx)3
-rw-r--r--buildfile4
-rw-r--r--doc/buildfile23
-rwxr-xr-xdoc/cli.sh2
-rw-r--r--tests/agent/buildfile2
-rw-r--r--unit-tests/bootstrap-manifest/buildfile4
-rw-r--r--unit-tests/machine-manifest/buildfile4
-rw-r--r--unit-tests/machine-manifest/driver.cxx2
19 files changed, 70 insertions, 87 deletions
diff --git a/bbot/agent.cli b/bbot/agent/agent.cli
index a5dbe01..a5dbe01 100644
--- a/bbot/agent.cli
+++ b/bbot/agent/agent.cli
diff --git a/bbot/agent.cxx b/bbot/agent/agent.cxx
index d71f7b4..ff697db 100644
--- a/bbot/agent.cxx
+++ b/bbot/agent/agent.cxx
@@ -1,8 +1,8 @@
-// file : bbot/agent.cxx -*- C++ -*-
+// file : bbot/agent/agent.cxx -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license : TBC; see accompanying LICENSE file
-#include <bbot/agent.hxx>
+#include <bbot/agent/agent.hxx>
#include <pwd.h> // getpwuid()
#include <limits.h> // PATH_MAX
@@ -30,11 +30,12 @@
#include <bbot/utility.hxx>
#include <bbot/diagnostics.hxx>
-#include <bbot/tftp.hxx>
-#include <bbot/machine.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;
using namespace bbot;
diff --git a/bbot/agent.hxx b/bbot/agent/agent.hxx
index f009a64..96876bc 100644
--- a/bbot/agent.hxx
+++ b/bbot/agent/agent.hxx
@@ -1,16 +1,16 @@
-// file : bbot/agent.hxx -*- C++ -*-
+// file : bbot/agent/agent.hxx -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license : TBC; see accompanying LICENSE file
-#ifndef BBOT_AGENT_HXX
-#define BBOT_AGENT_HXX
+#ifndef BBOT_AGENT_AGENT_HXX
+#define BBOT_AGENT_AGENT_HXX
#include <sys/types.h> // uid_t
#include <bbot/types.hxx>
#include <bbot/utility.hxx>
-#include <bbot/agent-options.hxx>
+#include <bbot/agent/agent-options.hxx>
namespace bbot
{
@@ -42,4 +42,4 @@ namespace bbot
iface_addr (const string&);
}
-#endif // BBOT_AGENT_HXX
+#endif // BBOT_AGENT_AGENT_HXX
diff --git a/bbot/machine-manifest.cxx b/bbot/agent/machine-manifest.cxx
index b7baf7e..3312d1b 100644
--- a/bbot/machine-manifest.cxx
+++ b/bbot/agent/machine-manifest.cxx
@@ -1,8 +1,8 @@
-// file : bbot/machine-manifest.cxx -*- C++ -*-
+// file : bbot/agent/machine-manifest.cxx -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license : TBC; see accompanying LICENSE file
-#include <bbot/machine-manifest.hxx>
+#include <bbot/agent/machine-manifest.hxx>
#include <sstream>
diff --git a/bbot/machine-manifest.hxx b/bbot/agent/machine-manifest.hxx
index efcdda4..37919ba 100644
--- a/bbot/machine-manifest.hxx
+++ b/bbot/agent/machine-manifest.hxx
@@ -1,9 +1,9 @@
-// file : bbot/machine-manifest.hxx -*- C++ -*-
+// file : bbot/agent/machine-manifest.hxx -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license : TBC; see accompanying LICENSE file
-#ifndef BBOT_MACHINE_MANIFEST_HXX
-#define BBOT_MACHINE_MANIFEST_HXX
+#ifndef BBOT_AGENT_MACHINE_MANIFEST_HXX
+#define BBOT_AGENT_MACHINE_MANIFEST_HXX
#include <map>
@@ -115,4 +115,4 @@ namespace bbot
using bootstrapped_machine_manifests = vector<bootstrapped_machine_manifest>;
}
-#endif // BBOT_MACHINE_MANIFEST_HXX
+#endif // BBOT_AGENT_MACHINE_MANIFEST_HXX
diff --git a/bbot/machine.cxx b/bbot/agent/machine.cxx
index 0c8a0e5..422c623 100644
--- a/bbot/machine.cxx
+++ b/bbot/agent/machine.cxx
@@ -1,8 +1,8 @@
-// file : bbot/machine.cxx -*- C++ -*-
+// file : bbot/agent/machine.cxx -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license : TBC; see accompanying LICENSE file
-#include <bbot/machine.hxx>
+#include <bbot/agent/machine.hxx>
#include <unistd.h> // sleep()
@@ -12,8 +12,8 @@
#include <cstdio> // snprintf()
#include <cstring> // strcpy()
-#include <bbot/agent.hxx>
-#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/machine.hxx b/bbot/agent/machine.hxx
index c15d618..e352e42 100644
--- a/bbot/machine.hxx
+++ b/bbot/agent/machine.hxx
@@ -1,9 +1,9 @@
-// file : bbot/machine.hxx -*- C++ -*-
+// file : bbot/agent/machine.hxx -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license : TBC; see accompanying LICENSE file
-#ifndef BBOT_MACHINE_HXX
-#define BBOT_MACHINE_HXX
+#ifndef BBOT_AGENT_MACHINE_HXX
+#define BBOT_AGENT_MACHINE_HXX
#include <bbot/types.hxx>
#include <bbot/utility.hxx>
@@ -81,4 +81,4 @@ namespace bbot
uint16_t tftp_port);
}
-#endif // BBOT_MACHINE_HXX
+#endif // BBOT_AGENT_MACHINE_HXX
diff --git a/bbot/tftp.cxx b/bbot/agent/tftp.cxx
index 0da6c24..27c1577 100644
--- a/bbot/tftp.cxx
+++ b/bbot/agent/tftp.cxx
@@ -1,8 +1,8 @@
-// file : bbot/tftp.cxx -*- C++ -*-
+// file : bbot/agent/tftp.cxx -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license : TBC; see accompanying LICENSE file
-#include <bbot/tftp.hxx>
+#include <bbot/agent/tftp.hxx>
#include <arpa/inet.h> // htonl()
#include <netinet/in.h> // sockaddr_in
@@ -11,7 +11,7 @@
#include <cstring> // memset()
-#include <bbot/agent.hxx>
+#include <bbot/agent/agent.hxx>
using namespace std;
using namespace butl;
diff --git a/bbot/tftp.hxx b/bbot/agent/tftp.hxx
index cdd0e3e..76b4d1c 100644
--- a/bbot/tftp.hxx
+++ b/bbot/agent/tftp.hxx
@@ -1,9 +1,9 @@
-// file : bbot/tftp.hxx -*- C++ -*-
+// file : bbot/agent/tftp.hxx -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license : TBC; see accompanying LICENSE file
-#ifndef BBOT_TFTP_HXX
-#define BBOT_TFTP_HXX
+#ifndef BBOT_AGENT_TFTP_HXX
+#define BBOT_AGENT_TFTP_HXX
#include <bbot/types.hxx>
#include <bbot/utility.hxx>
@@ -44,4 +44,4 @@ namespace bbot
};
}
-#endif // BBOT_TFTP_HXX
+#endif // BBOT_AGENT_TFTP_HXX
diff --git a/bbot/buildfile b/bbot/buildfile
index 15ab966..a576cce 100644
--- a/bbot/buildfile
+++ b/bbot/buildfile
@@ -13,7 +13,7 @@ service{*}: extension = service
service{*}: install = lib/systemd/system/
service{*}: install.mode = 644
-import libs = libbutl%lib{butl}
+import libs = libbutl%lib{butl}
import libs += libbbot%lib{bbot}
# Agent is a systemd service.
@@ -24,33 +24,18 @@ if ($cxx.target.class == "linux")
{
./: exe{bbot-agent} service{'bbot-agent@'}
- exe{bbot-agent}: \
- {hxx cxx}{ agent } {hxx ixx cxx}{ agent-options } \
- {hxx ixx cxx}{ common-options } \
- {hxx cxx}{ bootstrap-manifest } \
- {hxx cxx}{ diagnostics } \
- {hxx cxx}{ machine-manifest } \
- {hxx cxx}{ machine } \
- {hxx cxx}{ tftp } \
- {hxx }{ types } \
- {hxx cxx}{ types-parsers } \
- {hxx txx }{ utility } \
- {hxx }{ version } \
- $libs
+ exe{bbot-agent}: {hxx ixx txx cxx}{* +agent/* -**-options -version} \
+ {hxx ixx cxx}{common-options agent/agent-options} \
+ {hxx}{version} \
+ $libs
}
./: exe{bbot-worker}
-exe{bbot-worker}: \
-{ cxx}{ worker } {hxx ixx cxx}{ worker-options } \
- {hxx ixx cxx}{ common-options } \
-{hxx cxx}{ bootstrap-manifest } \
-{hxx cxx}{ diagnostics } \
-{hxx }{ types } \
-{hxx cxx}{ types-parsers } \
-{hxx txx }{ utility } \
-{hxx }{ version } \
- $libs
+exe{bbot-worker}: {hxx ixx txx cxx}{* +worker/* -**-options -version} \
+ {hxx ixx cxx}{common-options worker/worker-options} \
+ {hxx}{version} \
+ $libs
hxx{version}: in{version} $src_root/file{manifest}
hxx{version}: dist = true
@@ -60,20 +45,27 @@ hxx{version}: dist = true
if $cli.configured
{
cli.cxx{common-options}: cli{common}
- cli.cxx{agent-options}: cli{agent}
- cli.cxx{worker-options}: cli{worker}
+ cli.cxx{agent/agent-options}: cli{agent/agent}
+ cli.cxx{worker/worker-options}: cli{worker/worker}
- cli.options += -I $src_root --include-with-brackets --include-prefix bbot \
---guard-prefix BBOT --cxx-prologue "#include <bbot/types-parsers.hxx>" \
+ 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 = $cli.options # 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
+
+ cli.cxx{worker/worker-options}: \
+ cli.options += --include-prefix bbot/worker --guard-prefix BBOT_WORKER
+
# Include generated cli files into the distribution.
#
cli.cxx{*}: dist = true
diff --git a/bbot/worker.cli b/bbot/worker/worker.cli
index 09e09a3..09e09a3 100644
--- a/bbot/worker.cli
+++ b/bbot/worker/worker.cli
diff --git a/bbot/worker.cxx b/bbot/worker/worker.cxx
index 81d9a50..2aad8aa 100644
--- a/bbot/worker.cxx
+++ b/bbot/worker/worker.cxx
@@ -20,9 +20,10 @@
#include <bbot/utility.hxx>
#include <bbot/diagnostics.hxx>
-#include <bbot/worker-options.hxx>
#include <bbot/bootstrap-manifest.hxx>
+#include <bbot/worker/worker-options.hxx>
+
using namespace std;
using namespace butl;
using namespace bbot;
diff --git a/buildfile b/buildfile
index 584a35d..0362e29 100644
--- a/buildfile
+++ b/buildfile
@@ -2,8 +2,8 @@
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license : TBC; see accompanying LICENSE file
-./: bbot/ etc/ unit-tests/ doc/ doc{INSTALL LICENSE NEWS README version} \
- file{manifest}
+./: {*/ -tests/ -build/} doc{INSTALL LICENSE NEWS README version} \
+ file{manifest}
doc{version}: file{manifest} # Generated by the version module.
doc{version}: dist = true
diff --git a/doc/buildfile b/doc/buildfile
index c11de50..9131de2 100644
--- a/doc/buildfile
+++ b/doc/buildfile
@@ -2,29 +2,18 @@
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license : TBC; see accompanying LICENSE file
-cmds = \
-bbot-agent \
-bbot-worker
-
define css: file
css{*}: extension = css
define xhtml: doc
xhtml{*}: extension = xhtml
-./: {man1 xhtml}{$cmds} \
- css{common pre-box man} \
- file{man-prologue.1 man-epilogue.1 \
- man-prologue.xhtml man-epilogue.xhtml}
+./: {man1 xhtml}{bbot-*} \
+ css{common pre-box man} \
+ file{man-*}
-./: doc{build2-build-bot-manual.xhtml \
- build2-build-bot-manual-a4.pdf \
- build2-build-bot-manual-a4.ps \
- build2-build-bot-manual-letter.pdf \
- build2-build-bot-manual-letter.ps} \
- css{code-box common doc pre-box toc} \
- file{a4.html2ps letter.html2ps doc.html2ps} \
- file{doc-prologue.xhtml doc-epilogue.xhtml \
- manual.cli}
+./: doc{build2-build-bot-manual*} \
+ css{code-box common doc pre-box toc} \
+ file{manual.cli doc-* *.html2ps}
./: file{cli.sh}
diff --git a/doc/cli.sh b/doc/cli.sh
index 2a5136d..e8a06c8 100755
--- a/doc/cli.sh
+++ b/doc/cli.sh
@@ -51,7 +51,7 @@ o="--output-prefix bbot-"
#
#compile "bbot" $o --output-prefix ""
-pages="bbot/agent bbot/worker"
+pages="bbot/agent/agent bbot/worker/worker"
for p in $pages; do
compile $p $o
diff --git a/tests/agent/buildfile b/tests/agent/buildfile
index 3dc4ef5..8775cbd 100644
--- a/tests/agent/buildfile
+++ b/tests/agent/buildfile
@@ -6,5 +6,5 @@
#
import agent = bbot%exe{bbot-agent}
-./: test{testscript} file{btrfs-cpdir btrfs-rmdir} $agent
+./: test{testscript} file{btrfs-*} $agent
dir{./}: test = $agent
diff --git a/unit-tests/bootstrap-manifest/buildfile b/unit-tests/bootstrap-manifest/buildfile
index 2d2da8f..2be37fb 100644
--- a/unit-tests/bootstrap-manifest/buildfile
+++ b/unit-tests/bootstrap-manifest/buildfile
@@ -2,10 +2,10 @@
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license : TBC; see accompanying LICENSE file
-import libs = libbutl%lib{butl}
+import libs = libbutl%lib{butl}
import libs += libbbot%lib{bbot}
-exe{driver}: cxx{driver} ../../bbot/{hxx cxx}{bootstrap-manifest} $libs \
+exe{driver}: {hxx cxx}{*} ../../bbot/{hxx cxx}{bootstrap-manifest} $libs \
test{testscript}
include ../../bbot/
diff --git a/unit-tests/machine-manifest/buildfile b/unit-tests/machine-manifest/buildfile
index ae5ffa1..d56aa1f 100644
--- a/unit-tests/machine-manifest/buildfile
+++ b/unit-tests/machine-manifest/buildfile
@@ -2,10 +2,10 @@
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license : TBC; see accompanying LICENSE file
-import libs = libbutl%lib{butl}
+import libs = libbutl%lib{butl}
import libs += libbbot%lib{bbot}
-exe{driver}: cxx{driver} ../../bbot/{hxx cxx}{*-manifest} $libs \
+exe{driver}: {hxx cxx}{*} ../../bbot/{hxx cxx}{**-manifest} $libs \
test{testscript}
include ../../bbot/
diff --git a/unit-tests/machine-manifest/driver.cxx b/unit-tests/machine-manifest/driver.cxx
index 44b1e36..db42434 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/machine-manifest.hxx>
+#include <bbot/agent/machine-manifest.hxx>
using namespace std;
using namespace butl;