piston/packages/gcc/10.2.0/compile

29 lines
662 B
Plaintext
Raw Normal View History

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