Files
mc/buildscripts/build.sh
T
Harshavardhana 4ef3dcffc4 build: Now builds for all platforms and builds into 'release/experimental' directory.
Two Makefile options are

- make release
- make experimental

Currently supported OS and arch -

- linux/386
- linux/amd64
- linux/arm
- windows/386
- windows/amd64
- darwin/amd64
2016-02-09 14:18:35 -08:00

27 lines
785 B
Bash
Executable File

#!/bin/bash
# Save release LDFLAGS
LDFLAGS=$(go run buildscripts/gen-ldflags.go)
# Extract of release tag
release_tag=$(echo $LDFLAGS | awk {'print $4'} | cut -f2 -d=)
# Extract release string.
release_str=$(echo $MC_RELEASE | tr '[:upper:]' '[:lower:]')
# List of supported architectures
SUPPORTED_OSARCH='linux/386 linux/amd64 linux/arm windows/386 windows/amd64 darwin/amd64'
# Builds.
echo "Executing $release_str builds."
for osarch in ${SUPPORTED_OSARCH}; do
os=$(echo $osarch | cut -f1 -d'/')
arch=$(echo $osarch | cut -f2 -d'/')
package=$(go list -f '{{.ImportPath}}')
echo -n "-->"
printf "%15s:%s\n" "${osarch}" "${package}"
GOOS=$os GOARCH=$arch go build --ldflags "${LDFLAGS}" -o $release_str/$os-$arch/$(basename $package).$release_tag
done