From c245768377e5b713146312d40ac330b204c909fa Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 7 Dec 2017 13:25:35 -0600 Subject: [PATCH] [tm-bench] update Makefile --- tm-bench/LICENSE | 1 + tm-bench/Makefile | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tm-bench/LICENSE b/tm-bench/LICENSE index 8fd56597f..f48913967 100644 --- a/tm-bench/LICENSE +++ b/tm-bench/LICENSE @@ -1,3 +1,4 @@ +Tendermint Bench Copyright 2017 Tendermint Apache License diff --git a/tm-bench/Makefile b/tm-bench/Makefile index a3300faea..b50f42cb9 100644 --- a/tm-bench/Makefile +++ b/tm-bench/Makefile @@ -1,31 +1,31 @@ DIST_DIRS := find * -type d -exec VERSION := $(shell perl -ne '/^var version.*"([^"]+)".*$$/ && print "v$$1\n"' main.go) GOTOOLS = \ - github.com/Masterminds/glide \ github.com/mitchellh/gox tools: - go get -v $(GOTOOLS) + go get $(GOTOOLS) -get_vendor_deps: tools +get_vendor_deps: + @hash glide 2>/dev/null || go get github.com/Masterminds/glide glide install build: - go build -ldflags "-X main.version=${VERSION}" + go build install: - go install -ldflags "-X main.version=${VERSION}" + go install test: - go test + go test -race build-all: tools rm -rf ./dist gox -verbose \ - -ldflags "-X main.version=${VERSION}" \ + -ldflags "-s -w" \ + -arch="amd64 386" \ -os="linux darwin windows" \ - -arch="amd64 386 armv6 arm64" \ - -osarch="!darwin/arm64" \ + -osarch="!darwin/386" \ -output="dist/{{.OS}}-{{.Arch}}/{{.Dir}}" . dist: build-all @@ -38,7 +38,7 @@ dist: build-all build-docker: rm -f ./tm-bench - docker run -it --rm -v "$(PWD):/go/src/app" -w "/go/src/app" -e "CGO_ENABLED=0" golang:alpine go build -ldflags "-X main.version=${VERSION}" -o tm-bench + docker run -it --rm -v "$(PWD):/go/src/app" -w "/go/src/app" -e "CGO_ENABLED=0" golang:alpine go build -ldflags "-s -w" -o tm-bench docker build -t "tendermint/bench" . clean: