common library build routine