2021-03-13 11:12:50 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Put instructions to compile source code, remove this file if the language does not require this stage
|
|
|
|
|
|
|
|
|
2021-04-25 03:11:33 +02:00
|
|
|
case "${PISTON_LANGUAGE}" in
|
|
|
|
c)
|
2021-04-24 09:46:36 +02:00
|
|
|
rename 's/$/\.c/' "$@" # Add .c extension
|
|
|
|
gcc -std=c11 *.c -lm
|
2021-03-13 11:12:50 +01:00
|
|
|
;;
|
2021-04-25 03:11:33 +02:00
|
|
|
c++)
|
2021-04-24 09:46:36 +02:00
|
|
|
rename 's/$/\.cpp/' "$@" # Add .cpp extension
|
|
|
|
g++ -std=c++17 *.cpp
|
2021-03-13 11:12:50 +01:00
|
|
|
;;
|
2021-04-25 03:11:33 +02:00
|
|
|
d)
|
2021-04-24 09:46:36 +02:00
|
|
|
rename 's/$/\.d/' "$@" # Add .d extension
|
|
|
|
gdc *.d
|
2021-03-13 11:12:50 +01:00
|
|
|
;;
|
|
|
|
*)
|
2021-04-25 03:11:33 +02:00
|
|
|
echo "How did you get here? (${PISTON_LANGUAGE})"
|
2021-03-13 11:12:50 +01:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
chmod +x a.out
|