For simple C or C++ programs I add this snippet at the beginning of the file:
#if 0
set -e; [ "$0" -nt "$0.bin" ] &&
gcc -Wall -Wextra -pedantic -std=c99 "$0" -o "$0.bin"
exec "$0.bin" "$@"
#endif
Then make the file executable and you can use it like a script. All the flags are just there and visible.However it would be preferable to just have a smart enough language tooling to do it without such tricks.