aboutsummaryrefslogtreecommitdiff
path: root/build2/buildfile
blob: 2d650010c4678d6de74707f1d12942b726942e5b (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# file      : build2/buildfile
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

import libs = libbutl%lib{butl}

exe{b}:                                                   \
            {hxx ixx     cxx}{ algorithm                } \
            {            cxx}{ b                        } \
            {hxx ixx     cxx}{ b-options                } \
            {hxx ixx     cxx}{ context                  } \
            {hxx         cxx}{ depdb                    } \
            {hxx         cxx}{ diagnostics              } \
            {hxx         cxx}{ dump                     } \
            {hxx ixx     cxx}{ file                     } \
            {hxx     txx cxx}{ filesystem               } \
            {hxx         cxx}{ function                 } \
            {            cxx}{ functions-builtin        } \
            {            cxx}{ functions-path           } \
            {            cxx}{ functions-process-path   } \
            {            cxx}{ functions-string         } \
            {            cxx}{ functions-target-triplet } \
            {hxx         cxx}{ lexer                    } \
            {hxx         cxx}{ module                   } \
            {hxx ixx     cxx}{ name                     } \
            {hxx         cxx}{ operation                } \
            {hxx         cxx}{ parser                   } \
            {hxx         cxx}{ prerequisite             } \
            {hxx     txx cxx}{ regex                    } \
            {hxx         cxx}{ rule                     } \
            {hxx            }{ rule-map                 } \
            {hxx     txx cxx}{ scheduler                } \
            {hxx ixx     cxx}{ scope                    } \
            {hxx         cxx}{ search                   } \
            {hxx         cxx}{ spec                     } \
            {hxx ixx txx cxx}{ target                   } \
            {hxx            }{ target-key               } \
            {hxx            }{ target-type              } \
            {hxx         cxx}{ token                    } \
            {hxx            }{ types                    } \
            {hxx         cxx}{ types-parsers            } \
            {hxx ixx txx cxx}{ utility                  } \
            {hxx ixx txx cxx}{ variable                 } \
            {hxx            }{ version                  } \
        bin/{hxx         cxx}{ guess                    } \
        bin/{hxx         cxx}{ init                     } \
        bin/{hxx         cxx}{ rule                     } \
        bin/{hxx         cxx}{ target                   } \
          c/{hxx         cxx}{ init                     } \
          c/{hxx            }{ target                   } \
         cc/{hxx         cxx}{ common                   } \
         cc/{hxx         cxx}{ compile                  } \
         cc/{            cxx}{ gcc                      } \
         cc/{hxx         cxx}{ guess                    } \
         cc/{hxx         cxx}{ init                     } \
         cc/{hxx         cxx}{ install                  } \
         cc/{hxx         cxx}{ link                     } \
         cc/{hxx         cxx}{ module                   } \
         cc/{            cxx}{ msvc                     } \
         cc/{            cxx}{ pkgconfig                } \
         cc/{hxx         cxx}{ target                   } \
         cc/{hxx            }{ types                    } \
         cc/{hxx ixx     cxx}{ utility                  } \
         cc/{            cxx}{ windows-manifest         } \
         cc/{            cxx}{ windows-rpath            } \
        cli/{hxx         cxx}{ init                     } \
        cli/{hxx         cxx}{ rule                     } \
        cli/{hxx         cxx}{ target                   } \
     config/{hxx         cxx}{ init                     } \
     config/{hxx         cxx}{ module                   } \
     config/{hxx         cxx}{ operation                } \
     config/{hxx     txx cxx}{ utility                  } \
        cxx/{hxx         cxx}{ init                     } \
        cxx/{hxx         cxx}{ target                   } \
       dist/{hxx         cxx}{ init                     } \
       dist/{hxx         cxx}{ module                   } \
       dist/{hxx         cxx}{ operation                } \
       dist/{hxx         cxx}{ rule                     } \
  pkgconfig/{hxx         cxx}{ init                     } \
    install/{hxx         cxx}{ init                     } \
    install/{hxx         cxx}{ operation                } \
    install/{hxx         cxx}{ rule                     } \
    install/{hxx            }{ utility                  } \
       test/{hxx         cxx}{ common                   } \
       test/{hxx         cxx}{ init                     } \
       test/{hxx            }{ module                   } \
       test/{hxx         cxx}{ operation                } \
       test/{hxx         cxx}{ rule                     } \
       test/{hxx         cxx}{ target                   } \
test/script/{hxx         cxx}{ builtin                  } \
test/script/{hxx         cxx}{ lexer                    } \
test/script/{hxx         cxx}{ parser                   } \
test/script/{hxx ixx     cxx}{ regex                    } \
test/script/{hxx         cxx}{ runner                   } \
test/script/{hxx ixx     cxx}{ script                   } \
test/script/{hxx         cxx}{ token                    } \
    version/{hxx         cxx}{ init                     } \
    version/{hxx         cxx}{ module                   } \
    version/{hxx         cxx}{ rule                     } \
    version/{hxx         cxx}{ snapshot                 } \
    version/{            cxx}{ snapshot-git             } \
                               liba{b} $libs

#\
exe{b}: {hxx ixx txx cxx}{** -b-options -dummy} \
        {hxx ixx cxx}{b-options}                \
        liba{b} $libs
#\

hxx{version}: in{version} $src_root/file{manifest}
hxx{version}: dist = true

# Fake utility library (without it code generation does not work).
#
liba{b}: {cxx}{ dummy }
liba{b}: cxx.export.poptions = "-I$out_root" "-I$src_root"
liba{b}: install = false

# Pass our compiler target to be used as build2 host.
#
obj{b context}: cxx.poptions += -DBUILD2_HOST_TRIPLET=\"$cxx.target\"

if ($cxx.target.class != "windows")
  cxx.libs += -lpthread

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

  cli.options += -I $src_root --include-with-brackets --include-prefix build2 \
--guard-prefix BUILD2 --cxx-prologue "#include <build2/types-parsers.hxx>"    \
--cli-namespace build2::cl --generate-file-scanner --generate-parse           \
--generate-specifier

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

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