1 Star 0 Fork 1

Joy/hyperbench

forked from hyperbench/hyperbench 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 1.68 KB
一键复制 编辑 原始数据 按行查看 历史
# Go parameters
GOCMD=go
PACKR=packr
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGEN=$(GOCMD) generate
GOGET=$(GOCMD) get
GOLIST=$(GOCMD) list
BINARY_NAME=hyperbench
SKIP_DIR=benchmark
# version info
branch=$(shell git rev-parse --abbrev-ref HEAD)
commitID=$(shell git log --pretty=format:"%h" -1)
date=$(shell date +%Y%m%d)
importpath=github.com/hyperbench/hyperbench/cmd
ldflags=-X ${importpath}.branch=${branch} -X ${importpath}.commitID=${commitID} -X ${importpath}.date=${date}
# path
ASSETS=filesystem/assets
DIRS=benchmark
GET=github.com/gobuffalo/packr/v2/... github.com/gobuffalo/packr/v2/packr2
FAILPOINT=github.com/pingcap/failpoint/failpoint-ctl
# export gomodule
export GO111MODULE=on
all: build
## build: build the binary with pre-packed static resource
build: dep assets
@export GOPROXY=https://goproxy.cn,direct
@packr2 build -o $(BINARY_NAME) -trimpath -ldflags "${ldflags}"
@-rm -rf $(ASSETS)
## pack: build the binary with local static resource
pack: assets
@packr2 build -o $(BINARY_NAME) -ldflags "${ldflags}"
@-rm -rf $(ASSETS)
## test: run all test
test:
@go get $(FAILPOINT)
@failpoint-ctl enable
@$(GOTEST) `go list ./... | grep -v $(SKIP_DIR)`
@failpoint-ctl disable
## clean: clean all file generated by make
clean:
@packr2 clean
@-rm -rf $(BINARY_NAME)
@-rm -rf $(ASSETS)
.PHONY: assets
## assets: prepare asserts
assets:
@-rm -rf $(ASSETS)
@mkdir $(ASSETS)
@cp -r $(DIRS) $(ASSETS)
.PHONY: dep
## dep: install the dependencies outside (may need to use proxy to download some packages)
dep:
@go get -u $(GET)
help: Makefile
@echo " Choose a command run in "$(PROJECTNAME)":"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/cuiyuchain/hyperbench.git
git@gitee.com:cuiyuchain/hyperbench.git
cuiyuchain
hyperbench
hyperbench
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385