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.1 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. tools:
  6. go get $(GOTOOLS)
  7. get_vendor_deps:
  8. @hash glide 2>/dev/null || go get github.com/Masterminds/glide
  9. glide install
  10. build:
  11. go build
  12. install:
  13. go install
  14. test:
  15. go test -race
  16. build-all: tools
  17. rm -rf ./dist
  18. gox -verbose \
  19. -ldflags "-s -w" \
  20. -arch="amd64 386 arm arm64" \
  21. -os="linux darwin windows freebsd" \
  22. -osarch="!darwin/arm !darwin/arm64" \
  23. -output="dist/{{.OS}}-{{.Arch}}/{{.Dir}}" .
  24. dist: build-all
  25. cd dist && \
  26. $(DIST_DIRS) cp ../LICENSE {} \; && \
  27. $(DIST_DIRS) cp ../README.rst {} \; && \
  28. $(DIST_DIRS) tar -zcf tm-bench-${VERSION}-{}.tar.gz {} \; && \
  29. shasum -a256 ./*.tar.gz > "./tm-bench_${VERSION}_SHA256SUMS" && \
  30. cd ..
  31. build-docker:
  32. rm -f ./tm-bench
  33. 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
  34. docker build -t "tendermint/bench" .
  35. clean:
  36. rm -f ./tm-bench
  37. rm -rf ./dist
  38. .PHONY: tools get_vendor_deps build install test build-all dist clean build-docker