cd to builddir before loop