piston/packages/gcc/10.2.0/compile

25 lines
569 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_ALIAS}" in
gcc | c)
2021-04-24 09:46:36 +02:00
rename 's/$/\.c/' "$@" # Add .c extension
gcc -std=c11 *.c -lm
;;
g++ | c++ | cpp)
2021-04-24 09:46:36 +02:00
rename 's/$/\.cpp/' "$@" # Add .cpp extension
g++ -std=c++17 *.cpp
;;
gdc | d)
2021-04-24 09:46:36 +02:00
rename 's/$/\.d/' "$@" # Add .d extension
gdc *.d
;;
*)
echo "How did you get here? (${PISTON_ALIAS})"
exit 1
;;
esac
chmod +x a.out