github.com/evdatsion/aphelion-dpos-bft@v0.32.1/tools/tm-monitor/Makefile (about)

     1  DIST_DIRS := find * -type d -exec
     2  VERSION := $(shell perl -ne '/^TMCoreSemVer = "([^"]+)"$$/ && print "v$$1\n"' ../../version/version.go)
     3  
     4  all: build test install
     5  
     6  ########################################
     7  ###  Build
     8  
     9  build:
    10  	@go build
    11  
    12  install:
    13  	@go install
    14  
    15  test:
    16  	@go test -race $(PACKAGES)
    17  
    18  build-all:
    19  	rm -rf ./dist
    20  	gox -verbose \
    21  		-ldflags "-s -w" \
    22  		-arch="amd64 386 arm arm64" \
    23  		-os="linux darwin windows freebsd" \
    24  		-osarch="!darwin/arm !darwin/arm64" \
    25  		-output="dist/{{.OS}}-{{.Arch}}/{{.Dir}}" .
    26  
    27  dist: build-all
    28  	cd dist && \
    29  		$(DIST_DIRS) cp ../LICENSE {} \; && \
    30  		$(DIST_DIRS) tar -zcf tm-monitor-${VERSION}-{}.tar.gz {} \; && \
    31  		shasum -a256 ./*.tar.gz > "./tm-monitor_${VERSION}_SHA256SUMS" && \
    32  		cd ..
    33  
    34  ########################################
    35  ### Docker
    36  
    37  build-docker:
    38  	rm -f ./tm-monitor
    39  	docker run -it --rm -v "$(PWD)/../../:/go/src/github.com/evdatsion/aphelion-dpos-bft" -w "/go/src/github.com/evdatsion/aphelion-dpos-bft/tools/tm-monitor" -e "GO111MODULE=on" -e "CGO_ENABLED=0" golang:1.12 go build -ldflags "-s -w" -o tm-monitor
    40  	docker build -t "tendermint/monitor" .
    41  
    42  clean:
    43  	rm -f ./tm-monitor
    44  	rm -rf ./dist
    45  
    46  # To avoid unintended conflicts with file names, always add to .PHONY
    47  # unless there is a reason not to.
    48  # https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
    49  .PHONY: build install test build-all dist build-docker clean