I think this all looks pretty good, although here, perhaps you want to try to see if $GITROOT/build exists, and use that?

I'm not sure, maybe that is a bad idea, but that is where my build dir is. ...