This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
update
executable file
·97 lines (81 loc) · 2.11 KB
/
update
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
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env bash
DESCRIPTION="\
Description: Update the LunarGLASS project, and rebuild the needed files.
This is a quicker option than doing './install build'.
If you get an error message talking about intrinsics, try running
with the -f option.
"
DEPENDENCIES="\
Dependencies: LunarGLASS
"
USAGE="\
Usage: ./update [options]
Options:
-h --help Print out this Usage info
-f --force-llvm Force a clean recompilation of LLVM
"
# Main functionality
function showHelp {
echo "$DESCRIPTION"
echo "$DEPENDENCIES"
echo "$USAGE"
}
function all {
echo "Updating SVN"
rm -rf tests # TODO: make less hackish
svn update
echo "Building LLVM"
pushd LLVM/llvm-2.9/build || exit 1
if [[ -n $FORCE ]]; then
cd ..
rm -rf build
mkdir -p build
cd build
../configure || exit 1
make || exit 1
make install DESTDIR=`pwd`/install || exit 1
else
make || exit 1
fi
popd
echo "LLVM built"
echo "Building LunarGLASS"
pushd mesa/src/glsl
make -f StandAlone.makefile clean || exit 1
make -f StandAlone.makefile StandAlone || exit 1
rm -rf ../../../bin/LunarGLASS || exit 1
rm -rf ../../../tests || exit 1
mkdir -p ../../../tests/glsl || exit 1
mkdir -p ../../../tests/tgsi || exit 1
install StandAlone ../../../bin/LunarGLASS || exit 1
install ../LunarGLASS/test/* ../../../tests || exit 1
popd
echo "LunarGLASS built"
echo
echo "Building done, binary located at bin/LunarGLASS"
echo "Tests located in tests"
echo "Example run: bin/LunarGLASS tests/test.frag"
}
# Command-line argument Handling
# No arguments passed
if [[ -z "$*" ]]; then all; fi;
FORCE=""
# Arguments passed
for i in $*; do
case $i in
-f|--force-llvm)
FORCE="true"
echo "Forcing a recompilation of LLVM"
all
;;
-h|--h)
showHelp
exit 0
;;
*)
showHelp
exit 1
;;
esac
done
echo "Done"