piston/packages/gcc/10.2.0/compile
Thomas Hobson ccc1e4c08b
Add provides key to some languages
Provides key allows 1 package to provide multiple languages

Expect an API update to work with these new packages
2021-04-25 13:11:33 +12:00

25 lines
No EOL
551 B
Bash

#!/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)
rename 's/$/\.c/' "$@" # Add .c extension
gcc -std=c11 *.c -lm
;;
c++)
rename 's/$/\.cpp/' "$@" # Add .cpp extension
g++ -std=c++17 *.cpp
;;
d)
rename 's/$/\.d/' "$@" # Add .d extension
gdc *.d
;;
*)
echo "How did you get here? (${PISTON_LANGUAGE})"
exit 1
;;
esac
chmod +x a.out