[tm-monitor] update Makefile
This commit is contained in:
parent
38d51cf9cd
commit
9ffbb92e1a
|
@ -1,3 +1,4 @@
|
||||||
|
Tendermint Monitor
|
||||||
Copyright 2017 Tendermint
|
Copyright 2017 Tendermint
|
||||||
|
|
||||||
Apache License
|
Apache License
|
||||||
|
|
|
@ -1,32 +1,32 @@
|
||||||
DIST_DIRS := find * -type d -exec
|
DIST_DIRS := find * -type d -exec
|
||||||
VERSION := $(shell perl -ne '/^var version.*"([^"]+)".*$$/ && print "v$$1\n"' main.go)
|
VERSION := $(shell perl -ne '/^var version.*"([^"]+)".*$$/ && print "v$$1\n"' main.go)
|
||||||
GOTOOLS = \
|
GOTOOLS = \
|
||||||
github.com/Masterminds/glide \
|
|
||||||
github.com/mitchellh/gox
|
github.com/mitchellh/gox
|
||||||
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
|
PACKAGES=$(shell go list ./... | grep -v '/vendor')
|
||||||
|
|
||||||
tools:
|
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
|
glide install
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build -ldflags "-X main.version=${VERSION}"
|
go build
|
||||||
|
|
||||||
install:
|
install:
|
||||||
go install -ldflags "-X main.version=${VERSION}"
|
go install
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@go test $(PACKAGES)
|
@go test -race $(PACKAGES)
|
||||||
|
|
||||||
build-all: tools
|
build-all: tools
|
||||||
rm -rf ./dist
|
rm -rf ./dist
|
||||||
gox -verbose \
|
gox -verbose \
|
||||||
-ldflags "-X main.version=${VERSION}" \
|
-ldflags "-s -w" \
|
||||||
|
-arch="amd64 386" \
|
||||||
-os="linux darwin windows" \
|
-os="linux darwin windows" \
|
||||||
-arch="amd64 386 armv6 arm64" \
|
-osarch="!darwin/386" \
|
||||||
-osarch="!darwin/arm64" \
|
|
||||||
-output="dist/{{.OS}}-{{.Arch}}/{{.Dir}}" .
|
-output="dist/{{.OS}}-{{.Arch}}/{{.Dir}}" .
|
||||||
|
|
||||||
dist: build-all
|
dist: build-all
|
||||||
|
@ -39,7 +39,7 @@ dist: build-all
|
||||||
|
|
||||||
build-docker:
|
build-docker:
|
||||||
rm -f ./tm-monitor
|
rm -f ./tm-monitor
|
||||||
docker run -it --rm -v "$(PWD):/go/src/github.com/tendermint/tools/tm-monitor" -w "/go/src/github.com/tendermint/tools/tm-monitor" -e "CGO_ENABLED=0" golang:alpine go build -ldflags "-X main.version=${VERSION}" -o tm-monitor
|
docker run -it --rm -v "$(PWD):/go/src/github.com/tendermint/tools/tm-monitor" -w "/go/src/github.com/tendermint/tools/tm-monitor" -e "CGO_ENABLED=0" golang:alpine go build -ldflags "-s -w" -o tm-monitor
|
||||||
docker build -t "tendermint/monitor" .
|
docker build -t "tendermint/monitor" .
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
Loading…
Reference in New Issue