fixed build process but generate_version needs a serious tidy-up pass