You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.2 KiB

  1. DIST_DIRS := find * -type d -exec
  2. VERSION := $(shell perl -ne '/^var version.*"([^"]+)".*$$/ && print "v$$1\n"' main.go)
  3. GOTOOLS = \
  4. github.com/mitchellh/gox
  5. PACKAGES=$(shell go list ./... | grep -v '/vendor')
  6. tools:
  7. go get $(GOTOOLS)
  8. get_vendor_deps:
  9. @hash glide 2>/dev/null || go get github.com/Masterminds/glide
  10. glide install
  11. build:
  12. go build
  13. install:
  14. go install
  15. test:
  16. @go test -race $(PACKAGES)
  17. build-all: tools
  18. rm -rf ./dist
  19. gox -verbose \
  20. -ldflags "-s -w" \
  21. -arch="amd64 386 arm arm64" \
  22. -os="linux darwin windows freebsd" \
  23. -osarch="!darwin/arm !darwin/arm64" \
  24. -output="dist/{{.OS}}-{{.Arch}}/{{.Dir}}" .
  25. dist: build-all
  26. cd dist && \
  27. $(DIST_DIRS) cp ../LICENSE {} \; && \
  28. $(DIST_DIRS) tar -zcf tm-monitor-${VERSION}-{}.tar.gz {} \; && \
  29. shasum -a256 ./*.tar.gz > "./tm-monitor_${VERSION}_SHA256SUMS" && \
  30. cd ..
  31. build-docker:
  32. rm -f ./tm-monitor
  33. 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
  34. docker build -t "tendermint/monitor" .
  35. clean:
  36. rm -f ./tm-monitor
  37. rm -rf ./dist
  38. .PHONY: tools get_vendor_deps build install test build-all dist clean build-docker