-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·43 lines (35 loc) · 798 Bytes
/
build.sh
File metadata and controls
executable file
·43 lines (35 loc) · 798 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
36
37
38
39
40
41
42
43
#!/bin/sh
#V_GIT=https://github.com/Naheel-Azawy/v-bak
V_GIT=https://github.com/vlang/v
info() {
printf "\e[1;34m%s\e[0m\n" "$*"
}
if command -v v >/dev/null; then
V=v
info 'USING SYSTEM V'
else
V=./build/v/v
fi
build_v() {
[ $V = v ] && return
[ ! -f ./build/v/v ] &&
info BUILDING V... &&
cd build &&
git clone "$V_GIT" v &&
cd v &&
make &&
cd ../..
}
mkdir -p build
build_v
$V -o ./build/tmprn runner.v || exit
[ -f ./build/runners.v ] ||
info BUILDING LANGS... &&
./build/tmprn -outlangs > ./build/runners.v
info BUILDING "'rn'"...
sed -e '/\/\/ ### FILL FROM ITSELF ###/ {' \
-e 'r ./build/runners.v' -e 'd' -e '}' \
runner.v > ./build/rn.v
$V -o ./build/rn ./build/rn.v
mv ./build/rn .
info DONE