From e92f7c18812f605c1738f7b07be7fb964309d663 Mon Sep 17 00:00:00 2001 From: Felix Geller Date: Thu, 4 Feb 2016 07:17:45 +1300 Subject: [PATCH] Adds helpers for building a release. --- Makefile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index dcf925d..c760ce5 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,27 @@ export SHELL:=/usr/local/bin/bash -O extglob -c export GO15VENDOREXPERIMENT:=1 +build: GOOS ?= darwin +build: GOARCH ?= amd64 build: - go build . + rm -f kt + GOOS=${GOOS} GOARCH=${GOARCH} go build . + +release-linux: + GOOS=linux $(MAKE) build + file kt + tar Jcf kt-`git describe --abbrev=0 --tags`-linux-amd64.xz kt + +release-darwin: + GOOS=darwin $(MAKE) build + file kt + tar Jcf kt-`git describe --abbrev=0 --tags`-darwin-amd64.xz kt + +release: clean release-linux release-darwin + +clean: + rm -f kt + rm -f kt-*.xz run: build ./kt