1
0
mirror of https://github.com/rancher/os.git synced 2025-06-20 12:11:56 +00:00
os/scripts/build-target

21 lines
507 B
Plaintext
Raw Normal View History

2016-05-06 17:12:09 +00:00
#!/bin/bash
set -ex
2016-05-06 17:12:09 +00:00
ros="$1"
source $(dirname $0)/version
cd $(dirname $0)/..
if [ "${!TOOLCHAIN}" != "" ]; then
export CC=/usr/bin/${!TOOLCHAIN}-gcc
export CGO_ENABLED=1
fi
OUTPUT=${OUTPUT:-bin/ros}
echo Building $OUTPUT
BUILDDATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
2016-06-01 04:38:10 +00:00
2018-02-28 07:43:08 +00:00
CONST="-X github.com/rancher/os/config.Version=${VERSION} -X github.com/rancher/os/config.OsRepo=${OS_REPO} -X github.com/rancher/os/config.BuildDate='${BUILDDATE}'"
go build -ldflags "$CONST -extldflags -static -s -w" -o ${OUTPUT}