-
Notifications
You must be signed in to change notification settings - Fork 7
/
deep-rebuild
executable file
·71 lines (50 loc) · 1.7 KB
/
deep-rebuild
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
#!/usr/bin/env bash
# This script does a deep rebuild of the Silver compiler, which should be done
# when there are changes to the translation.
# If you have made changes to core or the runtime that are needed in the rest of
# the standard libraries or compiler, you should run ./make-core-runtime before
# running this script.
set -euo pipefail
export SILVER_HOME=$PWD
trap 'echo -e "\a"' EXIT
mkdir -p build
if [ -d generated/bin/common ]; then
# oh man, let's make sure stale runtimes aren't causing us serious problems here
rm -rf generated/bin/common
fi
# Modifications may have been made to how the translation is done
echo "First pass, no need to be clean ..."
echo ""
echo " > Pass 1"
echo " Pass 2"
echo " Pass 3"
echo ""
# There might be translation changes with corresponding runtime changes,
# so we hold off on recompling core and the runtime until the second pass.
# Doesn't need to be clean, since we are starting with a known good state of generated/.
# Only pass along flags like --clean, --mwda, etc. in the first pass.
NOINSTALL=1 ./make-stdlib "$@"
./make-compiler "$@"
echo "One full cycle ..."
echo ""
echo " Pass 1"
echo " > Pass 2"
echo " Pass 3"
echo ""
# Clean out stale generated files from the last pass
rm -rf generated/*/
# Build everything, including the runtime now.
time ./make-all
# Finally, we should have a fully working binary on all the new code. Run it again to reach a fixed point:
echo "One more full cycle ..."
echo ""
echo " Pass 1"
echo " Pass 2"
echo " > Pass 3"
echo ""
# Clean out stale generated files from the last pass
rm -rf generated/*/
time ./make-all
echo "Cleaning out stale runtime class files..."
rm -rf generated/bin/common
echo "deep-rebuild success"