Skip to content

Instantly share code, notes, and snippets.

@daniyel
Last active June 24, 2018 08:33
Show Gist options
  • Save daniyel/d5e86f529c74189cfbca87da859059f1 to your computer and use it in GitHub Desktop.
Save daniyel/d5e86f529c74189cfbca87da859059f1 to your computer and use it in GitHub Desktop.
Example Makefile for building go binary file for linux 64 platform
init:
./dep_wrapper.sh init
./dep_wrapper.sh ensure
ensure:
./dep_wrapper.sh ensure
build:
mkdir -p ./src
cp -R ./vendor/. ./src/
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./target/mybinary ./source/myprogram.go
rm -rf ./src
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment