-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·72 lines (60 loc) · 1.47 KB
/
build.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
#!/bin/env bash
if [ "$1" == "-h" -o "$1" == "--help" -o "$1" == "help" ]; then
echo "bash build.sh [ -h | --help | help | test | dist | install | uninstall ]"
exit
fi
FILES="aulang aulang.util aulang.node aulang.item aulang.lexer aulang.parser aulang.writer aulang.codegen aulang.compiler"
# Este comando remplaza todas las palabras por aulang.palabra
# echo $X | sed -E 's/\w+/aulang.&/g'
if [ "$1" == "temp" ]; then
cd dist; cp $FILES ..; cd ..
fi
if [ "$1" == "bootstrap" ]; then
bash build.sh &&
(cd dist; cp $FILES ..) &&
echo Bootstrapping &&
bash build.sh
rm -f $FILES
exit
fi
if [ "$1" == "test" ]; then
bash build.sh &&
echo compiling out &&
auro --dir dist/ aulang test.au out &&
echo running out &&
auro out
rm -f $FILES
exit
fi
if [ "$1" == "uninstall" ]; then
for a in $FILES; do
auro --remove $a
done
exit
fi
if [ "$1" != "install" ]; then
rm dist/*
compile () { echo compiling $1; auro culang src/$1.cu dist/aulang.$1; }
aucompile () { echo compiling $1; auro aulang src/$1.au dist/aulang.$1; }
compile util &&
compile node &&
compile item &&
aucompile lexer &&
aucompile parser &&
compile writer &&
compile codegen &&
compile compiler &&
echo compiling aulang &&
auro aulang src/aulang.au dist/aulang
if [ $? == 1 ]; then
echo "Could not compile files"
exit 1
fi
fi
if [ "$1" == "install" -o "$1" == "install-build" ]; then
cd dist
for a in $FILES; do
auro --install $a
done
exit
fi