The Go Programming Language

Text file src/clean.bash

     1	#!/usr/bin/env bash
     2	# Copyright 2009 The Go Authors. All rights reserved.
     3	# Use of this source code is governed by a BSD-style
     4	# license that can be found in the LICENSE file.
     5	
     6	set -e
     7	
     8	if [ ! -f env.bash ]; then
     9		echo 'clean.bash must be run from $GOROOT/src' 1>&2
    10		exit 1
    11	fi
    12	. ./env.bash
    13	if [ ! -f Make.inc ] ; then
    14	    GOROOT_FINAL=${GOROOT_FINAL:-$GOROOT}
    15	    sed 's!@@GOROOT@@!'"$GOROOT_FINAL"'!' Make.inc.in >Make.inc
    16	fi
    17	
    18	if [ "$1" != "--nopkg" ]; then
    19		rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH
    20	fi
    21	rm -f "$GOROOT"/lib/*.a
    22	for i in lib9 libbio libmach cmd pkg \
    23		../misc/cgo/gmp ../misc/cgo/stdio \
    24		../misc/cgo/life ../misc/cgo/test \
    25		../test/bench ../test/garbage
    26	do
    27		# Do not use gomake here. It may not be available.
    28		$MAKE -C "$GOROOT/src/$i" clean
    29	done

release.r60.3. Except as noted, this content is licensed under a Creative Commons Attribution 3.0 License.