aboutsummaryrefslogtreecommitdiff
path: root/bbot
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 /bbot
parent8e8d599b129d35f638f2c1957c869b054a38b021 (diff)
Make use of wildcards in buildfiles
Diffstat (limited to 'bbot')
-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
12 files changed, 55 insertions, 61 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;