2015-04-18 21:21:45 +00: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.
|
|
|
|
|
2021-10-25 14:49:44 +00:00
|
|
|
.PHONY: geth android ios evm all test clean
|
2015-11-20 14:06:35 +00:00
|
|
|
|
2023-03-30 18:40:53 +00:00
|
|
|
BIN = $(GOPATH)/bin
|
|
|
|
|
|
|
|
## Migration tool
|
|
|
|
GOOSE = $(BIN)/goose
|
|
|
|
$(BIN)/goose:
|
|
|
|
go get -u github.com/pressly/goose/cmd/goose
|
|
|
|
|
2019-09-11 12:41:22 +00:00
|
|
|
GOBIN = ./build/bin
|
2015-11-20 14:06:35 +00:00
|
|
|
GO ?= latest
|
2020-01-14 12:13:14 +00:00
|
|
|
GORUN = env GO111MODULE=on go run
|
2015-11-20 14:06:35 +00:00
|
|
|
|
2023-03-30 18:40:53 +00:00
|
|
|
#Database
|
|
|
|
HOST_NAME = localhost
|
|
|
|
PORT = 5432
|
|
|
|
USER = vdbm
|
|
|
|
PASSWORD = password
|
|
|
|
|
|
|
|
# Set env variable
|
|
|
|
# `PGPASSWORD` is used by `createdb` and `dropdb`
|
|
|
|
export PGPASSWORD=$(PASSWORD)
|
|
|
|
|
|
|
|
#Test
|
|
|
|
TEST_DB = cerc_testing
|
|
|
|
TEST_CONNECT_STRING = postgresql://$(USER):$(PASSWORD)@$(HOST_NAME):$(PORT)/$(TEST_DB)?sslmode=disable
|
|
|
|
|
2015-04-18 21:21:45 +00:00
|
|
|
geth:
|
2020-01-14 12:13:14 +00:00
|
|
|
$(GORUN) build/ci.go install ./cmd/geth
|
2015-04-18 21:21:45 +00:00
|
|
|
@echo "Done building."
|
|
|
|
@echo "Run \"$(GOBIN)/geth\" to launch geth."
|
|
|
|
|
2016-05-25 12:07:57 +00:00
|
|
|
all:
|
2020-01-14 12:13:14 +00:00
|
|
|
$(GORUN) build/ci.go install
|
2016-05-25 12:07:57 +00:00
|
|
|
|
|
|
|
test: all
|
2023-03-30 21:04:10 +00:00
|
|
|
$(GORUN) build/ci.go test
|
2016-05-25 12:07:57 +00:00
|
|
|
|
2018-04-17 22:53:50 +00:00
|
|
|
lint: ## Run linters.
|
2020-01-14 12:13:14 +00:00
|
|
|
$(GORUN) build/ci.go lint
|
2018-04-17 22:53:50 +00:00
|
|
|
|
2016-05-25 12:07:57 +00:00
|
|
|
clean:
|
2020-01-14 12:13:14 +00:00
|
|
|
env GO111MODULE=on go clean -cache
|
2016-11-03 12:44:16 +00:00
|
|
|
rm -fr build/_workspace/pkg/ $(GOBIN)/*
|
2016-05-25 12:07:57 +00:00
|
|
|
|
2017-02-26 22:52:10 +00: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 11:01:20 +00:00
|
|
|
env GOBIN= go install golang.org/x/tools/cmd/stringer@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 08:38:21 +00:00
|
|
|
env GOBIN= go install ./cmd/abigen
|
2018-01-08 12:15:57 +00:00
|
|
|
@type "solc" 2> /dev/null || echo 'Please install solc'
|
|
|
|
@type "protoc" 2> /dev/null || echo 'Please install protoc'
|
2023-03-30 18:40:53 +00:00
|
|
|
|
|
|
|
.PHONY: statedifftest
|
|
|
|
statedifftest: | $(GOOSE)
|
|
|
|
GO111MODULE=on go get github.com/stretchr/testify/assert@v1.7.0
|
|
|
|
GO111MODULE=on MODE=statediff go test -p 1 ./statediff/... -v
|
|
|
|
|
|
|
|
.PHONY: statediff_filewriting_test
|
|
|
|
statediff_filetest: | $(GOOSE)
|
|
|
|
GO111MODULE=on go get github.com/stretchr/testify/assert@v1.7.0
|
|
|
|
GO111MODULE=on MODE=statediff STATEDIFF_DB=file go test -p 1 ./statediff/... -v
|