代码拉取完成,页面将自动刷新
GO ?= go
GOLANGCI_LINT ?= $$($(GO) env GOPATH)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.30.0
GOGOPROTOBUF ?= protoc-gen-gogofaster
GOGOPROTOBUF_VERSION ?= v1.3.1
BEEKEEPER ?= $$($(GO) env GOPATH)/bin/beekeeper
BEELOCAL_BRANCH ?= main
COMMIT ?= "$(shell git describe --long --dirty --always --match "" || true)"
LDFLAGS ?= -s -w -X github.com/ethersphere/bee.commit="$(COMMIT)"
.PHONY: all
all: build lint vet test-race binary
.PHONY: binary
binary: export CGO_ENABLED=0
binary: dist FORCE
$(GO) version
$(GO) build -trimpath -ldflags "$(LDFLAGS)" -o dist/bee ./cmd/bee
dist:
mkdir $@
.PHONY: beekeeper
beekeeper:
test -f $(BEEKEEPER) || curl -sSfL https://raw.githubusercontent.com/ethersphere/beekeeper/master/install.sh | BEEKEEPER_INSTALL_DIR=$$($(GO) env GOPATH)/bin USE_SUDO=false bash
.PHONY: beelocal
beelocal:
curl -sSfL https://raw.githubusercontent.com/ethersphere/beelocal/$(BEELOCAL_BRANCH)/beelocal.sh | bash
.PHONY: lint
lint: linter
$(GOLANGCI_LINT) run
.PHONY: linter
linter:
test -f $(GOLANGCI_LINT) || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$($(GO) env GOPATH)/bin $(GOLANGCI_LINT_VERSION)
.PHONY: vet
vet:
$(GO) vet ./...
.PHONY: test-race
test-race:
$(GO) test -race -v ./...
.PHONY: test-integration
test-integration:
$(GO) test -tags=integration -v ./...
.PHONY: test
test:
$(GO) test -v ./...
.PHONY: build
build: export CGO_ENABLED=0
build:
$(GO) build -trimpath -ldflags "$(LDFLAGS)" ./...
.PHONY: githooks
githooks:
ln -f -s ../../.githooks/pre-push.bash .git/hooks/pre-push
.PHONY: protobuftools
protobuftools:
which protoc || ( echo "install protoc for your system from https://github.com/protocolbuffers/protobuf/releases" && exit 1)
which $(GOGOPROTOBUF) || ( cd /tmp && GO111MODULE=on $(GO) get -u github.com/gogo/protobuf/$(GOGOPROTOBUF)@$(GOGOPROTOBUF_VERSION) )
.PHONY: protobuf
protobuf: GOFLAGS=-mod=mod # use modules for protobuf file include option
protobuf: protobuftools
$(GO) generate -run protoc ./...
.PHONY: clean
clean:
$(GO) clean
rm -rf dist/
FORCE:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。