c_exercises/compile.sh

6 lines
221 B
Bash
Raw Permalink Normal View History

2022-11-05 17:49:34 -03:00
#!/bin/bash
2022-11-09 23:46:47 -03:00
[ -z "${1}" ] && echo "error: no arguments given" && exit 2
[ "${1}" == "clean" ] && rm -v $(ls --color=no -1 | grep -v "\(\.c\|\.sh\)$") && exit
2022-11-13 00:27:16 -03:00
gcc -Wall -Wextra -Wpedantic -O2 -g -o "${1:0:-2}" "${1}"
2022-11-05 17:49:34 -03:00
exit