2 # Copyright 2015 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.
6 # Usage: buildall.sh [-e] [pattern]
8 # buildall.bash builds the standard library for all Go-supported
9 # architectures. It is used by the "all-compile" trybot builder,
10 # as a smoke test to quickly flag portability issues.
13 # -e: stop at first failure
15 if [ ! -f run.bash ]; then
16 echo 'buildall.bash must be run from $GOROOT/src' 1>&2
21 if [ "$1" = "-e" ]; then
26 if [ "$sete" = true ]; then
31 if [ "$pattern" = "" ]; then
35 # put linux, nacl first in the target list to get all the architectures up front.
36 targets="$((ls runtime | sed -n 's/^rt0_\(.*\)_\(.*\)\.s/\1-\2/p'; echo linux-386-387 linux-arm-arm5) | sort | sed -e 's|linux-mips64x|linux-mips64 linux-mips64le|' | egrep -v android-arm | egrep "$pattern" | egrep 'linux|nacl')
37 $(ls runtime | sed -n 's/^rt0_\(.*\)_\(.*\)\.s/\1-\2/p' | egrep -v 'android-arm|darwin-arm' | egrep "$pattern" | egrep -v 'linux|nacl')"
40 GOROOT="$(cd .. && pwd)"
43 for target in $targets
46 echo "### Building $target"
47 export GOOS=$(echo $target | sed 's/-.*//')
48 export GOARCH=$(echo $target | sed 's/.*-//')
50 if [ "$GOARCH" = "arm5" ]; then
54 if [ "$GOARCH" = "387" ]; then
58 if ! "$GOROOT/bin/go" build -a std cmd; then
66 if [ "$failed" = "true" ]; then
68 echo "Build(s) failed." 1>&2