Merge pull request #247 from Alexpux/develop

Optimize build script