2015-04-19 00:21:45 +03: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.
|
|
|
|
|
2022-09-26 12:31:16 +03:00
|
|
|
.PHONY: geth android ios evm all test truffle-test clean
|
2022-07-20 07:07:00 +03:00
|
|
|
.PHONY: docker
|
2022-09-26 12:31:16 +03:00
|
|
|
.PHONY: geth-linux-arm geth-linux-arm64 geth-linux-arm5 geth-linux-arm6 geth-linux-arm7
|
2015-11-20 16:06:35 +02:00
|
|
|
|
2019-09-11 15:41:22 +03:00
|
|
|
GOBIN = ./build/bin
|
2015-11-20 16:06:35 +02:00
|
|
|
GO ?= latest
|
2020-01-14 15:13:14 +03:00
|
|
|
GORUN = env GO111MODULE=on go run
|
2022-11-28 17:20:54 +03:00
|
|
|
GIT_COMMIT=$(shell git rev-parse HEAD)
|
|
|
|
GIT_COMMIT_DATE=$(shell git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d')
|
2015-11-20 16:06:35 +02:00
|
|
|
|
2015-04-19 00:21:45 +03:00
|
|
|
geth:
|
2020-01-14 15:13:14 +03:00
|
|
|
$(GORUN) build/ci.go install ./cmd/geth
|
2015-04-19 00:21:45 +03:00
|
|
|
@echo "Done building."
|
|
|
|
@echo "Run \"$(GOBIN)/geth\" to launch geth."
|
|
|
|
|
2022-11-28 17:20:54 +03:00
|
|
|
ldflags = -X main.gitCommit=$(GIT_COMMIT) \
|
|
|
|
-X main.gitDate=$(GIT_COMMIT_DATE)
|
|
|
|
|
2022-09-26 12:31:16 +03:00
|
|
|
geth-linux-arm: geth-linux-arm5 geth-linux-arm6 geth-linux-arm7 geth-linux-arm64
|
|
|
|
|
|
|
|
geth-linux-arm5:
|
2022-11-28 17:20:54 +03:00
|
|
|
env GO111MODULE=on GOARCH=arm GOARM=5 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm-5 ./cmd/geth
|
2022-09-26 12:31:16 +03:00
|
|
|
|
|
|
|
geth-linux-arm6:
|
2022-11-28 17:20:54 +03:00
|
|
|
env GO111MODULE=on GOARCH=arm GOARM=6 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm-6 ./cmd/geth
|
2022-09-26 12:31:16 +03:00
|
|
|
|
|
|
|
geth-linux-arm7:
|
2022-11-28 17:20:54 +03:00
|
|
|
env GO111MODULE=on GOARCH=arm GOARM=7 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm-7 ./cmd/geth
|
2022-09-26 12:31:16 +03:00
|
|
|
|
|
|
|
geth-linux-arm64:
|
2022-11-28 17:20:54 +03:00
|
|
|
env GO111MODULE=on GOARCH=arm64 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm64 ./cmd/geth
|
2022-09-26 12:31:16 +03:00
|
|
|
|
2016-05-25 15:07:57 +03:00
|
|
|
all:
|
2020-01-14 15:13:14 +03:00
|
|
|
$(GORUN) build/ci.go install
|
2016-05-25 15:07:57 +03:00
|
|
|
|
2016-11-25 13:34:19 +03:00
|
|
|
android:
|
2020-01-14 15:13:14 +03:00
|
|
|
$(GORUN) build/ci.go aar --local
|
2016-11-25 13:34:19 +03:00
|
|
|
@echo "Done building."
|
|
|
|
@echo "Import \"$(GOBIN)/geth.aar\" to use the library."
|
2020-09-28 21:11:30 +03:00
|
|
|
@echo "Import \"$(GOBIN)/geth-sources.jar\" to add javadocs"
|
|
|
|
@echo "For more info see https://stackoverflow.com/questions/20994336/android-studio-how-to-attach-javadoc"
|
2021-05-04 14:01:20 +03:00
|
|
|
|
2016-11-25 13:34:19 +03:00
|
|
|
ios:
|
2020-01-14 15:13:14 +03:00
|
|
|
$(GORUN) build/ci.go xcode --local
|
2016-11-25 13:34:19 +03:00
|
|
|
@echo "Done building."
|
|
|
|
@echo "Import \"$(GOBIN)/Geth.framework\" to use the library."
|
|
|
|
|
2016-05-25 15:07:57 +03:00
|
|
|
test: all
|
2022-07-05 06:14:21 +03:00
|
|
|
$(GORUN) build/ci.go test -timeout 1h
|
|
|
|
|
|
|
|
truffle-test:
|
|
|
|
docker build . -f ./docker/Dockerfile --target bsc-genesis -t bsc-genesis
|
|
|
|
docker build . -f ./docker/Dockerfile --target bsc -t bsc
|
|
|
|
docker build . -f ./docker/Dockerfile.truffle -t truffle-test
|
|
|
|
docker-compose -f ./tests/truffle/docker-compose.yml up genesis
|
|
|
|
docker-compose -f ./tests/truffle/docker-compose.yml up -d bsc-rpc bsc-validator1
|
|
|
|
sleep 30
|
|
|
|
docker-compose -f ./tests/truffle/docker-compose.yml up --exit-code-from truffle-test truffle-test
|
|
|
|
docker-compose -f ./tests/truffle/docker-compose.yml down
|
2016-05-25 15:07:57 +03:00
|
|
|
|
2018-04-18 01:53:50 +03:00
|
|
|
lint: ## Run linters.
|
2020-01-14 15:13:14 +03:00
|
|
|
$(GORUN) build/ci.go lint
|
2018-04-18 01:53:50 +03:00
|
|
|
|
2016-05-25 15:07:57 +03:00
|
|
|
clean:
|
2020-01-14 15:13:14 +03:00
|
|
|
env GO111MODULE=on go clean -cache
|
2016-11-03 15:44:16 +03:00
|
|
|
rm -fr build/_workspace/pkg/ $(GOBIN)/*
|
2016-05-25 15:07:57 +03:00
|
|
|
|
2017-02-27 01:52:10 +03: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'.
|
|
|
|
|
|
|
|
devtools:
|
2021-05-04 14:01:20 +03:00
|
|
|
env GOBIN= go install golang.org/x/tools/cmd/stringer@latest
|
|
|
|
env GOBIN= go install github.com/kevinburke/go-bindata/go-bindata@latest
|
|
|
|
env GOBIN= go install github.com/fjl/gencodec@latest
|
|
|
|
env GOBIN= go install github.com/golang/protobuf/protoc-gen-go@latest
|
2017-04-06 11:38:21 +03:00
|
|
|
env GOBIN= go install ./cmd/abigen
|
2018-01-08 15:15:57 +03:00
|
|
|
@type "solc" 2> /dev/null || echo 'Please install solc'
|
|
|
|
@type "protoc" 2> /dev/null || echo 'Please install protoc'
|
2022-07-20 07:07:00 +03:00
|
|
|
|
|
|
|
docker:
|
|
|
|
docker build --pull -t bnb-chain/bsc:latest -f Dockerfile .
|