Hoist build function to top level of Cakefile