-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·39 lines (35 loc) · 789 Bytes
/
build.sh
File metadata and controls
executable file
·39 lines (35 loc) · 789 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
#/bin/sh
if type -p java; then
echo found java executable in PATH
_java=java
elif [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
echo found java executable in JAVA_HOME
_java="$JAVA_HOME/bin/java"
else
echo "Java version 20 required"
exit
fi
if [[ "$_java" ]]; then
version=$("$_java" -version 2>&1 | awk -F '"' '/version/ {print $2}')
echo version "$version"
if [[ "$version" < "20" ]]; then
echo "Java version 20 required"
exit
fi
fi
(cd jlox/craftinginterpreters || exit
make get
pushd java/com/craftinginterpreters/lox || exit
git apply ../../../../../../Interpreter.diff
popd || exit
make
)
(
cd jlox || eixt
./gradlew copyJar
bin/jlox ../Lox.lox ../lib/lox.jar
)
(
cd clox || exit
gcc src/*.c -o clox -O3
)