forked from oils-for-unix/oils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNINJA-config.sh
executable file
·104 lines (78 loc) · 2.14 KB
/
NINJA-config.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
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
#!/usr/bin/env bash
#
# Creates build.ninja. Crawls dynamic dependencies.
#
# Usage:
# ./NINJA-config.sh
set -o nounset
set -o pipefail
set -o errexit
source build/dynamic-deps.sh # py-tool, etc
asdl-main() { py-tool asdl.asdl_main; }
optview-gen() { py-tool core.optview_gen; }
consts-gen() { py-tool frontend.consts_gen; }
flag-gen() { py-tool frontend.flag_gen; }
lexer-gen() { py-tool frontend.lexer_gen; }
option-gen() { py-tool frontend.option_gen; }
grammar-gen() { py-tool oil_lang.grammar_gen; }
arith-parse-gen() { py-tool osh.arith_parse_gen; }
signal-gen() { py-tool frontend.signal_gen; }
osh-eval() {
### bin/osh_eval is oil-native
local dir=$DIR/osh_eval
mkdir -p $dir
PYTHONPATH=$PY_PATH /usr/bin/env python2 \
build/dynamic_deps.py py-manifest bin.osh_eval \
> $dir/all.txt
set +o errexit
cat $dir/all.txt | repo-filter | exclude-filter typecheck | mysort \
> $dir/typecheck.txt
cat $dir/typecheck.txt | exclude-filter translate | mysort \
> $dir/translate.txt
echo DEPS $dir/*
}
oils-cpp() {
### bin/osh_eval is oil-native
local dir=$DIR/oils_cpp
mkdir -p $dir
PYTHONPATH=$PY_PATH /usr/bin/env python2 \
build/dynamic_deps.py py-manifest bin.oils_cpp \
> $dir/all.txt
set +o errexit
cat $dir/all.txt | repo-filter | exclude-filter typecheck | mysort \
> $dir/typecheck.txt
cat $dir/typecheck.txt | exclude-filter translate | mysort \
> $dir/translate.txt
echo DEPS $dir/*
}
main() {
# _build/NINJA/ # Part of the Ninja graph
# asdl.asdl_main/
# all-pairs.txt
# deps.txt
# osh_eval/
# typecheck.txt
# translate.txt
mkdir -p _build/NINJA
# Implicit dependencies for tools
asdl-main
optview-gen
consts-gen
flag-gen
lexer-gen
option-gen
grammar-gen
arith-parse-gen
signal-gen
# Explicit dependencies for translating and type checking
# Baked into mycpp/NINJA.
osh-eval
oils-cpp
echo DEPS prebuilt/ninja/*/deps.txt
echo
# TODO: remove --without-readline once frontend_pyreadline is complete.
_OIL_DEV=1 ./configure --without-readline
# Reads the deps.txt files above
PYTHONPATH=. build/ninja_main.py
}
main "$@"