1
0
mirror of https://github.com/rancher/os.git synced 2025-09-02 07:15:41 +00:00
Files
os/scripts/build-target

19 lines
435 B
Plaintext
Raw Normal View History

2016-05-06 10:12:09 -07:00
#!/bin/bash
set -e
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
2016-05-31 21:11:03 -07:00
go build -tags "selinux cgo daemon netgo" -installsuffix netgo -ldflags "-X github.com/rancher/os/config.VERSION=${VERSION} -linkmode external -extldflags -static" -o ${OUTPUT}
strip --strip-all ${OUTPUT}