-
Notifications
You must be signed in to change notification settings - Fork 25
/
gsl.generate_artifacts.sh
executable file
·60 lines (51 loc) · 1.61 KB
/
gsl.generate_artifacts.sh
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
.template 0
###############################################################################
# Copyright (c) 2014-2023 libbitcoin developers (see COPYING).
#
# GSL generate generate_artifacts.sh.
#
# This is a code generator built using the iMatix GSL code generation
# language. See https://github.com/imatix/gsl for details.
###############################################################################
# Generation
###############################################################################
.endtemplate
.template 1
.macro generate_artifacts()
. define out_file = "generate_artifacts.sh"
. notify(out_file)
. output(out_file)
. shebang("bash")
. copyleft("libbitcoin-build")
# Exit this script on the first build error.
set -e
# Do everything relative to this file location.
cd `dirname "$0"`
declare -a generator=( \\
. for generate->templates.template as _template
"$(_template.name)" \\
. endfor
)
# Generate build artifacts.
for generate in "\${generator[@]}"
do
gsl -q -script:templates/\$generate $(generate->templates.source)
done
# Make generated scripts executable.
eval chmod +x "output/*/*.sh"
.endmacro generate_artifacts
.endtemplate
.template 0
###############################################################################
# Execution
###############################################################################
[global].root = ".."
[global].trace = 0
[gsl].ignorecase = 0
# Note: expected context root libbitcoin-build directory
gsl from "library/math.gsl"
gsl from "library/string.gsl"
gsl from "library/collections.gsl"
gsl from "utilities.gsl"
generate_artifacts()
.endtemplate