build script with support for -a flag