Make build script more sensible