]> Cypherpunks repositories - gostls13.git/commitdiff
build: add make.bash --no-clean option
authorRuss Cox <rsc@golang.org>
Wed, 15 Feb 2012 16:48:17 +0000 (11:48 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 15 Feb 2012 16:48:17 +0000 (11:48 -0500)
Makes it possible to run

GOARCH=amd64 make.bash
GOARCH=386 make.bash --no-clean

to avoid deleting some of the work done by the first one.

R=golang-dev
CC=golang-dev
https://golang.org/cl/5673056

src/cmd/dist/build.c
src/make.bash

index 67860cdf33572f278e60984f45449ae03f95f87a..9d168b364fbdab8f35112c4b5e808feb3bce47a2 100644 (file)
@@ -314,12 +314,12 @@ setup(void)
        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.
@@ -337,7 +337,8 @@ setup(void)
 
        // 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
@@ -1330,7 +1331,8 @@ cmdbootstrap(int argc, char **argv)
        if(argc > 0)
                usage();
 
-       clean();
+       if(rebuildall)
+               clean();
        goversion = findgoversion();
        setup();
        
index 43183e786bfe62162945e0219194dc0604b624d2..cb7051bab3b1fc1d16a11257bc9873b9c780d365 100755 (executable)
@@ -75,8 +75,12 @@ if [ "$1" = "--dist-tool" ]; then
 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