out of tree builds

This is a first pass at out-of-tree builds. It builds, but the TOC isn't getting written out correctly. I'd love some advice on how to modify this so that it's easier, @aturon . "Hacky" is... charitable.