27 lines
411 B
Plaintext
27 lines
411 B
Plaintext
cc-clean(){
|
|
rm -rf ./**/*.out 2>/dev/null
|
|
}
|
|
|
|
cc-run(){
|
|
local file
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: cc-run <file> [args...]" >&2
|
|
return 1
|
|
fi
|
|
|
|
cc-clean
|
|
|
|
file="$1"
|
|
shift
|
|
|
|
if command -v norminette &>/dev/null
|
|
then
|
|
norminette "${file}" -R CheckForbiddenSourceHeader
|
|
fi
|
|
|
|
cc "${file}" -o "${file}.out" -Wall -Wextra -Werror -g3 -fsanitize=address $@ && \
|
|
"./${file}.out"
|
|
|
|
cc-clean
|
|
}
|