From 8a5486ec76e40c52fda51966eae997cb76dfa3e3 Mon Sep 17 00:00:00 2001 From: Miguel de la Cruz Date: Wed, 17 Apr 2019 19:25:14 +0100 Subject: [PATCH] Add package Makefile target --- .gitignore | 1 + Makefile | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/.gitignore b/.gitignore index 1035e6666..e93aa999b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ mmctl bin +build \ No newline at end of file diff --git a/Makefile b/Makefile index a77276419..820149ccd 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,23 @@ build: vendor check install: vendor check go install -mod=vendor +package: vendor check + mkdir -p build + + @echo Build Linux amd64 + env GOOS=linux GOARCH=amd64 go build -mod=vendor + tar cf build/linux_amd64.tar mmctl + + @echo Build OSX amd64 + env GOOS=darwin GOARCH=amd64 go build -mod=vendor + tar cf build/darwin_amd64.tar mmctl + + @echo Build Windows amd64 + env GOOS=windows GOARCH=amd64 go build -mod=vendor + zip build/windows_amd64.zip mmctl.exe + + rm mmctl mmctl.exe + fmt: go fmt $(GO_PACKAGES)