forked from kframework/javascript-semantics
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·35 lines (30 loc) · 1015 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·35 lines (30 loc) · 1015 Bytes
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
#!/bin/bash
error() { echo "error: $@"; exit 1; }
echo "Bootstrapping build..."
rm -f js-config.k && \
touch js-config.k && \
./kbuild.sh || error "failed bootstrapping build"
echo "Self-hosted standard built-in objects..."
{ cat stdlib/00.debug.js
cat stdlib/01.global.js
cat stdlib/02.object.js
cat stdlib/03.function.js
cat stdlib/04.array.js
cat stdlib/05.string.js
cat stdlib/06.boolean.js
cat stdlib/07.number.js
cat stdlib/08.math.js
cat stdlib/09.date.js
cat stdlib/10.regexp.js
cat stdlib/11.error.js
# cat stdlib/12.json.js
} >stdlib.js || error "failed to create stdlib.js"
echo "Hard-wiring standard built-in objects..."
{ echo "<objs> ( _ =>" && \
./k/bin/krun stdlib.js >stdlib.out 2>&1 && \
cat stdlib.out | awk '/<objs>/ {p=1; next} /<\/objs>/ {p=0} p' | sed 's/@o/@oo/g' && \
echo ") </objs>" && \
echo "syntax Oid ::= \"@oo\" \"(\" Int \")\""
} >js-config.k || error "failed to create js-config.k"
echo "Final build..."
./kbuild.sh || error "failed final build"