I made a script that does just what you are looking for. It sets up the build environment and has commands for building and uploading Marlin.
You can find it here: [blog.mmone.de]
You can find it here: [blog.mmone.de]