Files
tendermint/tools/tm-bench/Makefile
T
ValarDragon 99e582d79a crypto: Refactor to move files out of the top level directory
Currently the top level directory contains basically all of the code
for the crypto package. This PR moves the crypto code into submodules
in a similar manner to what `golang/x/crypto` does. This improves code
organization.

Ref discussion: https://github.com/tendermint/tendermint/pull/1966

Closes #1956
2018-07-18 08:38:44 -07:00

51 lines
1.3 KiB
Makefile

DIST_DIRS := find * -type d -exec
VERSION := $(shell perl -ne '/^var version.*"([^"]+)".*$$/ && print "v$$1\n"' main.go)
all: build test install
########################################
### Build
build:
@go build
install:
@go install
test:
@go test -race
build-all: check_tools
rm -rf ./dist
gox -verbose \
-ldflags "-s -w" \
-arch="amd64 386 arm arm64" \
-os="linux darwin windows freebsd" \
-osarch="!darwin/arm !darwin/arm64" \
-output="dist/{{.OS}}-{{.Arch}}/{{.Dir}}" .
dist: build-all
cd dist && \
$(DIST_DIRS) cp ../LICENSE {} \; && \
$(DIST_DIRS) cp ../README.rst {} \; && \
$(DIST_DIRS) tar -zcf tm-bench-${VERSION}-{}.tar.gz {} \; && \
shasum -a256 ./*.tar.gz > "./tm-bench_${VERSION}_SHA256SUMS" && \
cd ..
########################################
### Docker
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 "-s -w" -o tm-bench
docker build -t "tendermint/bench" .
clean:
rm -f ./tm-bench
rm -rf ./dist
# To avoid unintended conflicts with file names, always add to .PHONY
# unless there is a reason not to.
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: check check_tools get_tools update_tools get_vendor_deps build install test build-all dist fmt metalinter metalinter_all build-docker clean