blob: 8b33e81207ac1d2e83ca4b57f96c5e2741088dd1 [file] [edit]
#!/bin/bash
# Copyright 2018 The Chromium Authors
# 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"
cd go
case $CROSS_TRIPLE in
mipsel-*) # Only support 32bit mips for now
GOARCH=mipsle
;;
*)
echo "IDKWTF"
exit 1
;;
esac
export GOOS=linux
export GOARCH
export CGO_ENABLED=0
(cd src && ./make.bash)
mkdir $PREFIX/{bin,pkg,src,lib}
SUFFIX=${GOOS}_${GOARCH}
cp -a bin/$SUFFIX/* $PREFIX/bin/
cp -a lib/* $PREFIX/lib/
cp -a pkg/$SUFFIX/* $PREFIX/pkg/
cp -a src/*/ $PREFIX/src/
cp src/go.env $PREFIX/