-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathxic-build
executable file
·27 lines (22 loc) · 924 Bytes
/
xic-build
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
#!/bin/bash
#
# Xi compiler build script
#
# Clean old files
make clean
# Run JFlex on the lexer spec
java -jar lib/jflex-full-1.7.0.jar src/main/java/kc875/lexer/xilexer.flex -d src/main/java/kc875/lexer/
#Run cup
./lib/cup -nowarn -parser "XiParser" -destdir ./src/main/java/kc875/xi_parser -locations ./src/main/java/kc875/xi_parser/xi.cup
./lib/cup -nowarn -parser "IxiParser" -destdir ./src/main/java/kc875/xi_parser -locations ./src/main/java/kc875/xi_parser/ixi.cup
# Create the compiler using gradle, create xic binary
./gradle_exec.sh --no-daemon customFatJar
cat make_jar_executable.sh build/libs/all-in-one-jar-1.0-SNAPSHOT.jar > xic && chmod +x xic
# Link the xic binary in ~/bin
case "$OSTYPE" in
darwin*) xic_path=$(greadlink -f xic) ;;
linux*) xic_path=$(readlink -f xic) ;;
*) echo "unknown: $OSTYPE"; exit 1 ;;
esac
mkdir -p ~/bin && cd ~/bin
ln -s -f $xic_path xic && cd - > /dev/null