From ac11f4ac9dec8f2435e6974e10387a9a0415c068 Mon Sep 17 00:00:00 2001 From: Justin McCarthy Date: Thu, 10 May 2018 16:43:02 -0700 Subject: [PATCH] introduce brew make target --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 517004c..f65c47c 100644 --- a/Makefile +++ b/Makefile @@ -13,11 +13,19 @@ dist: clean $(eval VERSION := $(shell git describe --tags --always --dirty="-dev")) $(eval LDFLAGS := -ldflags='-X "cli.Version=$(VERSION)"') mkdir dist - GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -gcflags=-trimpath=$(GOPATH) -asmflags=-trimpath=$(GOPATH) $(LDFLAGS) -o dist/comply-$(VERSION)-darwin-amd64 github.com/strongdm/comply/cmd/comply - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -gcflags=-trimpath=$(GOPATH) -asmflags=-trimpath=$(GOPATH) $(LDFLAGS) -o dist/comply-$(VERSION)-linux-amd64 github.com/strongdm/comply/cmd/comply + GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -gcflags=-trimpath=$(GOPATH) -asmflags=-trimpath=$(GOPATH) $(LDFLAGS) -o dist/comply-$(VERSION)-darwin-amd64 ./cmd/comply + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -gcflags=-trimpath=$(GOPATH) -asmflags=-trimpath=$(GOPATH) $(LDFLAGS) -o dist/comply-$(VERSION)-linux-amd64 ./cmd/comply cd dist && tar -czvf comply-$(VERSION)-darwin-amd64.tgz comply-$(VERSION)-darwin-amd64 cd dist && tar -czvf comply-$(VERSION)-linux-amd64.tgz comply-$(VERSION)-linux-amd64 + +brew: clean + $(eval VERSION := $(shell cat version)) + $(eval LDFLAGS := -ldflags='-X "cli.Version=$(VERSION)"') + mkdir bin + GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -gcflags=-trimpath=$(GOPATH) -asmflags=-trimpath=$(GOPATH) $(LDFLAGS) -o bin/comply ./cmd/comply + clean: + rm -rf bin rm -rf dist rm -f comply