mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-23 18:15:24 +00:00
26 lines
632 B
Bash
Executable File
26 lines
632 B
Bash
Executable File
#!/bin/sh
|
|
PKGSRC=${PKGSRC:-github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil}
|
|
PKGNAME=${PKGNAME:-$(sh contrib/semver/name.sh)}
|
|
PKGVER=${PKGVER:-$(sh contrib/semver/version.sh --bare)}
|
|
while getopts "ud" option
|
|
do
|
|
case "${option}"
|
|
in
|
|
u) UPX=true;;
|
|
d) DEBUG=true;;
|
|
esac
|
|
done
|
|
echo "Downloading..."
|
|
for CMD in `ls cmd/` ; do
|
|
echo "Building: $CMD"
|
|
IMPRINT="-X $PKGSRC.buildName=$PKGNAME -X $PKGSRC.buildVersion=$PKGVER"
|
|
if [ $DEBUG ]; then
|
|
go build -ldflags="$IMPRINT" -tags debug -v ./cmd/$CMD
|
|
else
|
|
go build -ldflags="$IMPRINT -s -w" -v ./cmd/$CMD
|
|
fi
|
|
if [ $UPX ]; then
|
|
upx --brute $CMD
|
|
fi
|
|
done
|