2015-04-18 23:21:45 +02:00
|
|
|
# This Makefile is meant to be used by people that do not usually work
|
|
|
|
# with Go source code. If you know what GOPATH is then you probably
|
|
|
|
# don't need to bother with make.
|
|
|
|
|
2024-05-23 15:26:32 +05:30
|
|
|
.PHONY: geth all test lint fmt clean devtools help
|
2015-11-20 16:06:35 +02:00
|
|
|
|
2019-09-11 14:41:22 +02:00
|
|
|
GOBIN = ./build/bin
|
2015-11-20 16:06:35 +02:00
|
|
|
GO ?= latest
|
2023-08-23 18:54:30 +03:00
|
|
|
GORUN = go run
|
2015-11-20 16:06:35 +02:00
|
|
|
|
2024-05-23 15:26:32 +05:30
|
|
|
#? geth: Build geth.
|
2015-04-18 23:21:45 +02:00
|
|
|
geth:
|
2020-01-14 13:13:14 +01:00
|
|
|
$(GORUN) build/ci.go install ./cmd/geth
|
2015-04-18 23:21:45 +02:00
|
|
|
@echo "Done building."
|
|
|
|
@echo "Run \"$(GOBIN)/geth\" to launch geth."
|
|
|
|
|
2024-05-23 15:26:32 +05:30
|
|
|
#? all: Build all packages and executables.
|
2016-05-25 14:07:57 +02:00
|
|
|
all:
|
2020-01-14 13:13:14 +01:00
|
|
|
$(GORUN) build/ci.go install
|
2016-05-25 14:07:57 +02:00
|
|
|
|
2024-05-23 15:26:32 +05:30
|
|
|
#? test: Run the tests.
|
2016-05-25 14:07:57 +02:00
|
|
|
test: all
|
2020-01-14 13:13:14 +01:00
|
|
|
$(GORUN) build/ci.go test
|
2016-05-25 14:07:57 +02:00
|
|
|
|
2024-05-23 15:26:32 +05:30
|
|
|
#? lint: Run certain pre-selected linters.
|
2018-04-18 00:53:50 +02:00
|
|
|
lint: ## Run linters.
|
2020-01-14 13:13:14 +01:00
|
|
|
$(GORUN) build/ci.go lint
|
2018-04-18 00:53:50 +02:00
|
|
|
|
2024-05-23 15:26:32 +05:30
|
|
|
#? fmt: Ensure consistent code formatting.
|
|
|
|
fmt:
|
|
|
|
gofmt -s -w $(shell find . -name "*.go")
|
|
|
|
|
|
|
|
#? clean: Clean go cache, built executables, and the auto generated folder.
|
2016-05-25 14:07:57 +02:00
|
|
|
clean:
|
2023-08-23 18:54:30 +03:00
|
|
|
go clean -cache
|
2016-11-03 13:44:16 +01:00
|
|
|
rm -fr build/_workspace/pkg/ $(GOBIN)/*
|
2016-05-25 14:07:57 +02:00
|
|
|
|
2017-02-26 23:52:10 +01:00
|
|
|
# The devtools target installs tools required for 'go generate'.
|
|
|
|
# You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'.
|
|
|
|
|
2024-05-23 15:26:32 +05:30
|
|
|
#? devtools: Install recommended developer tools.
|
2017-02-26 23:52:10 +01:00
|
|
|
devtools:
|
2021-05-04 13:01:20 +02:00
|
|
|
env GOBIN= go install golang.org/x/tools/cmd/stringer@latest
|
|
|
|
env GOBIN= go install github.com/fjl/gencodec@latest
|
2024-08-01 22:25:55 +08:00
|
|
|
env GOBIN= go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
2017-04-06 10:38:21 +02:00
|
|
|
env GOBIN= go install ./cmd/abigen
|
2018-01-08 13:15:57 +01:00
|
|
|
@type "solc" 2> /dev/null || echo 'Please install solc'
|
|
|
|
@type "protoc" 2> /dev/null || echo 'Please install protoc'
|
2024-02-06 05:48:19 +08:00
|
|
|
|
|
|
|
#? help: Get more info on make commands.
|
|
|
|
help: Makefile
|
2024-05-23 15:26:32 +05:30
|
|
|
@echo ''
|
|
|
|
@echo 'Usage:'
|
|
|
|
@echo ' make [target]'
|
|
|
|
@echo ''
|
|
|
|
@echo 'Targets:'
|
2024-02-06 05:48:19 +08:00
|
|
|
@sed -n 's/^#?//p' $< | column -t -s ':' | sort | sed -e 's/^/ /'
|