Skip to content

Instantly share code, notes, and snippets.

@wofeiwo
Forked from FiloSottile/build.sh
Created February 7, 2018 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wofeiwo/50699447358dcdf6022fe7241cd139b4 to your computer and use it in GitHub Desktop.
Save wofeiwo/50699447358dcdf6022fe7241cd139b4 to your computer and use it in GitHub Desktop.
#! /bin/sh
GOOS=linux go build -o $2 "$1"
GOOS=linux go build -ldflags="-s -w" -o $2.-sw "$1"
upx -f --brute -o $2.upx $2
upx -f --brute -o $2.-sw.upx $2.-sw
GOOS=linux gotip build -o $2.tip "$1"
GOOS=linux gotip build -ldflags="-s -w" -o $2.tip.-sw "$1"
upx -f --brute -o $2.tip.upx $2.tip
upx -f --brute -o $2.tip.-sw.upx $2.tip.-sw
ls -l $2*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment