mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
little improvement for compiler
This commit is contained in:
parent
f05cb5e1bb
commit
f790f2cf2c
@ -13,6 +13,7 @@ file=$(readlink -f "$1")
|
|||||||
dir=${file%/*}
|
dir=${file%/*}
|
||||||
base="${file%.*}"
|
base="${file%.*}"
|
||||||
ext="${file##*.}"
|
ext="${file##*.}"
|
||||||
|
cc='tcc' # choose your prefered C compiler. Some options: tcc, gcc, clang, musl-clang, musl-gcc. `cc` is (a symlink) the system default.
|
||||||
|
|
||||||
cd "$dir" || exit 1
|
cd "$dir" || exit 1
|
||||||
|
|
||||||
@ -29,11 +30,11 @@ textype() { \
|
|||||||
case "$ext" in
|
case "$ext" in
|
||||||
# Try to keep these cases in alphabetical order.
|
# Try to keep these cases in alphabetical order.
|
||||||
[0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf > "$base".pdf ;;
|
[0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf > "$base".pdf ;;
|
||||||
c) cc "$file" -o "$base" && "$base" ;;
|
c) "$cc" "$file" -o "$base" && "$base" ;;
|
||||||
cpp) g++ "$file" -o "$base" && "$base" ;;
|
cpp) g++ "$file" -o "$base" && "$base" ;;
|
||||||
cs) mcs "$file" && mono "$base".exe ;;
|
cs) mcs "$file" && mono "$base".exe ;;
|
||||||
go) go run "$file" ;;
|
go) go run "$file" ;;
|
||||||
h) sudo make install ;;
|
h) sudo make -j"$(nproc)" CC="${cc}" install ;;
|
||||||
java) javac -d classes "$file" && java -cp classes "${1%.*}" ;;
|
java) javac -d classes "$file" && java -cp classes "${1%.*}" ;;
|
||||||
m) octave "$file" ;;
|
m) octave "$file" ;;
|
||||||
md) if [ -x "$(command -v lowdown)" ]; then
|
md) if [ -x "$(command -v lowdown)" ]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user