Generalize build.sh