-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
install-toolchain.sh
executable file
·86 lines (76 loc) · 1.58 KB
/
install-toolchain.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
#!/bin/bash
# changed: install to /home/foo/bin instead to /usr/local/bin!
echo "building compiler, assembler and VM..."
export CC=~/l1vm-clang-12.0.0/bin/clang
export CCPP=~/l1vm-clang-12.0.0/bin/clang++
# check if ~/bin exists
DIR="~/bin"
if [ -d "$DIR" ]; then
### Take action if $DIR exists ###
echo "${DIR} already exists!"
else
### Control will jump here if $DIR does NOT exists ###
echo "${DIR} will be created now..."
mkdir ~/bin
fi
# check if zerobuild installed into ~/bin
FILE=~/bin/zerobuild
if test -f "$FILE"; then
echo "$FILE exists!"
else
echo "zerobuild not installed into $FILE!"
echo "cloning and building it now..."
git clone https://github.com/koder77/zerobuild.git
cd zerobuild
./make.sh
cp zerobuild ~/bin/
cd ..
fi
cd assemb
if zerobuild force; then
echo "l1asm build ok!"
else
echo "l1asm build error!"
exit 1
fi
cd ../comp
if zerobuild force; then
echo "l1com build ok!"
else
echo "l1com build error!"
exit 1
fi
cd ../vm
if zerobuild zerobuild-nojit.txt force; then
echo "l1vm JIT build ok!"
else
echo "l1vm JIT build error!"
exit 1
fi
cp l1vm l1vm-nojit
cd ..
cp assemb/l1asm ~/bin
cp comp/l1com ~/bin
cp vm/l1vm-jit ~/bin
echo "VM binaries installed into ~/bin"
cd modules
echo "installing modules..."
chmod +x *.sh
./build.sh
if ./install.sh; then
echo "modules build ok!"
else
echo "modules build FAILED!"
exit 1
fi
echo "all modules installed. building programs..."
cd ../prog
chmod +x *.sh
if ./build-all.sh; then
echo "building programs successfully!"
else
echo "building programs FAILED!"
fi
cd ..
echo "installation finished!"
exit 0