summaryrefslogtreecommitdiff
path: root/cli/buildfile
blob: 7d634e032875c1192d2d7aa9004e39af3c262468 (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
# file      : cli/buildfile
# license   : MIT; see accompanying LICENSE file

import libs = libcutl%lib{cutl}

exe{cli}: cxx{cli} libue{cli}

libue{cli}: {hxx ixx txx cxx}{** -cli -version -options} \
            {hxx}{version} {hxx ixx cxx}{options}        \
            $libs

hxx{version}: in{version} $src_root/manifest

# Build options.
#
# Pass the copyright notice extracted from the LICENSE file.
#
copyright = $process.run_regex(cat $src_root/LICENSE,    \
                               'Copyright \(c\) (.+)\.', \
                               '\1')

obj{cli}: cxx.poptions += -DCLI_COPYRIGHT=\"$copyright\"

# Generated options parser.
#
if $cli.configured
{
  cli.cxx{options}: cli{options}

  cli.options += --include-with-brackets --include-prefix cli \
--guard-prefix CLI --generate-file-scanner --generate-specifier \
--generate-modifier --reserved-name stdout

  cli.cxx{*}:
  {
    # Include the generated cli files into the distribution and don't remove
    # them when cleaning in src (so that clean results in a state identical to
    # distributed).
    #
    dist  = true
    clean = ($src_root != $out_root)

    # We keep the generated code in the repository so copy it back to src
    # in case of a forwarded configuration.
    #
    backlink = overwrite
  }
}