[enh][build] improve build script