summaryrefslogtreecommitdiff
path: root/xsd/xsd/buildfile
blob: 2b356b6848bcb3b1bae8d3d78b78971c9a89b997 (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
76
# file      : xsd/buildfile
# license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

import libs  = libxsd-frontend%lib{xsd-frontend}
import libs += libcutl%lib{cutl}
import libs += libxerces-c%lib{xerces-c}

import! [metadata] cli = cli%exe{cli}

ops = options cxx/options cxx/parser/options cxx/tree/options

./: exe{xsd}: {hxx ixx txx cxx}{** -{$ops} -version} \
              {hxx ixx cxx}{$ops}                    \
              {hxx}{version}                         \
              $libs

# Target metadata, see also --build2-metadata in xsd.cxx.
#
exe{xsd}:
{
  export.metadata = 1 xsd
  xsd.name = [string] xsd
  xsd.version  = $version
  xsd.checksum = $version
}

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

# Generated options parser.
#
# Note: tracking .cli dependencies manually.
#
cli_options = --std c++11 -I $src_root --generate-specifier \
--generate-file-scanner --suppress-undocumented \
--ostream-type ::std::wostream --exclude-base \
--include-with-brackets --option-length 28 \
--cxx-prologue '"#include <xsd/options-parser.hxx>"' # TMP: WTF?

<{hxx ixx cxx}{options}>: cli{options}
{
  cli_options += --include-prefix xsd --guard-prefix XSD
}

<cxx/{hxx ixx cxx}{options}>: cxx/cli{options} cli{options}
{
  cli_options += --include-prefix xsd/cxx --guard-prefix XSD_CXX
}

<cxx/parser/{hxx ixx cxx}{options}>: cxx/parser/cli{options} cxx/cli{options} \
                                     cli{options}
{
  cli_options += --include-prefix xsd/cxx/parser --guard-prefix XSD_CXX_PARSER
}

<cxx/tree/{hxx ixx cxx}{options}>: cxx/tree/cli{options} cxx/cli{options} \
                                   cli{options}
{
  cli_options += --include-prefix xsd/cxx/tree --guard-prefix XSD_CXX_TREE
}

<hxx{~'/(.*)/'} ixx{~'/\1/'} cxx{~'/\1/'}>: cli{~'/\1/'} $cli
{
  # Symlink the generated code in src for convenience of development.
  #
  backlink = true
}
{{
  $cli $cli_options -o $directory($path($>[0])) $path($<[0])
}}

# Build options.
#
# Pass the copyright notice extracted from the LICENSE file.
#
obj{xsd cxx/parser/generator cxx/tree/generator}: \
  cxx.poptions += -DXSD_COPYRIGHT=\"$copyright\"