blob: b1a0071d3be76e370a14785f89f3b30f96ddf8f9 [file] [log] [blame]
#!/bin/bash
# Copyright 2022 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
set -x
set -o pipefail
PREFIX="$1"
DEPS="$2"
export GOROOT_BOOTSTRAP=$DEPS
export CGO_ENABLED=0
(cd src && ./make.bash)
mkdir $PREFIX/{bin,pkg,pkg/tool,src,lib}
SUFFIX=${GOOS}_${GOARCH}
if [ $SUFFIX = "linux_arm64" ]
then
cp -a bin/$SUFFIX/* $PREFIX/bin/
else
cp -a bin/* $PREFIX/bin/
fi
cp -a lib/* $PREFIX/lib/
cp -a pkg/tool/$SUFFIX/* $PREFIX/pkg/tool/
cp -a src/* $PREFIX/src/