For this you would usually use make compile, but you can easily roll your own by creating a script called MyProject which checks $1 for a preset list of subcommands:
case "$1" in
compile)
my_compile_command(s)
shift
;;
*)
echo "$0: Unknown command: $1"
exit 1
;;
esac
References: