p = bpathf(&b, "%s/pkg/%s_%s", goroot, gohostos, gohostarch);
if(rebuildall)
xremoveall(p);
- xmkdir(p);
+ xmkdirall(p);
if(!streq(goos, gohostos) || !streq(goarch, gohostarch)) {
p = bpathf(&b, "%s/pkg/%s_%s", goroot, goos, goarch);
if(rebuildall)
xremoveall(p);
- xmkdir(p);
+ xmkdirall(p);
}
// Create object directory.
// Create tool directory.
// We keep it in pkg/, just like the object directory above.
- xremoveall(tooldir);
+ if(rebuildall)
+ xremoveall(tooldir);
xmkdirall(tooldir);
// Remove tool binaries from before the tool/gohostos_gohostarch
if(argc > 0)
usage();
- clean();
+ if(rebuildall)
+ clean();
goversion = findgoversion();
setup();
fi
echo "# Building compilers and Go bootstrap tool for host, $GOHOSTOS/$GOHOSTARCH."
-./cmd/dist/dist bootstrap -a -v # builds go_bootstrap
-# Delay move of dist tool to now, because bootstrap cleared tool directory.
+buildall="-a"
+if [ "$1" = "--no-clean" ]; then
+ buildall=""
+fi
+./cmd/dist/dist bootstrap $buildall -v # builds go_bootstrap
+# Delay move of dist tool to now, because bootstrap may clear tool directory.
mv cmd/dist/dist $GOTOOLDIR/dist
$GOTOOLDIR/go_bootstrap clean -i std
echo