aboutsummaryrefslogtreecommitdiff
path: root/bbot/buildfile
blob: 311775dbe2795d7d58c0a47089ffca67b0b1e3a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# file      : bbot/buildfile
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license   : TBC; see accompanying LICENSE file

# 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
#    update for install).
#
define service: file
service{*}: extension = service
service{*}: install = lib/systemd/system/
service{*}: install.mode = 644

import libs = libbutl%lib{butl}
import libs += libbbot%lib{bbot}

# Agent is a systemd service.
#
# @@ Have to package on Linux.
#
if ($cxx.target.class == "linux")
{
  ./: exe{bbot-agent} service{'bbot-agent@'}

  exe{bbot-agent}:                                                        \
  {hxx         cxx}{ agent              } {hxx ixx cxx}{ agent-options  } \
  {hxx         cxx}{ bootstrap-manifest } {hxx ixx cxx}{ common-options } \
  {hxx         cxx}{ diagnostics        }                                 \
  {hxx         cxx}{ machine-manifest   }                                 \
  {hxx         cxx}{ machine            }                                 \
  {hxx         cxx}{ tftp               }                                 \
  {hxx            }{ types              }                                 \
  {hxx         cxx}{ types-parsers      }                                 \
  {hxx     txx cxx}{ utility            }                                 \
  {hxx            }{ version-impl       }                                 \
                     $libs
}

./: exe{bbot-worker}

exe{bbot-worker}:                                                        \
{            cxx}{ worker              } {hxx ixx cxx}{ worker-options } \
                                         {hxx ixx cxx}{ common-options } \
{hxx         cxx}{ diagnostics         }                                 \
{hxx            }{ types               }                                 \
{hxx         cxx}{ types-parsers       }                                 \
{hxx     txx cxx}{ utility             }                                 \
{hxx            }{ version-impl        }                                 \
                   $libs

# Generated options parser.
#
if $cli.configured
{
  cli.cxx{common-options}: cli{common}
  cli.cxx{agent-options}: cli{agent}
  cli.cxx{worker-options}: cli{worker}

  cli.options += -I $src_root --include-with-brackets --include-prefix bbot \
--guard-prefix BBOT --cxx-prologue "#include <bbot/types-parsers>" \
--cli-namespace bbot::cli --generate-specifier --generate-parse

  cli.cxx{common-options}: cli.options = $cli.options # No usage.

  # Usage options.
  #
  cli.options += --suppress-undocumented --long-usage --ansi-color \
--page-usage 'bbot::print_$name$_' --option-length 23

  # Include generated cli files into the distribution.
  #
  cli.cxx{*}: dist = true
}