split up library build into dir