forked from concrete-eth/concrete-geth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (68 loc) · 2.87 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# 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.
.PHONY: geth android ios evm all test clean
GOBIN = ./build/bin
GO ?= latest
GORUN = go run
#? geth: Build geth
geth:
$(GORUN) build/ci.go install ./cmd/geth
@echo "Done building."
@echo "Run \"$(GOBIN)/geth\" to launch geth."
#? all: Build all packages and executables
all:
$(GORUN) build/ci.go install
#? test: Run the tests
test: all
$(GORUN) build/ci.go test
#? lint: Run certain pre-selected linters
lint: ## Run linters.
$(GORUN) build/ci.go lint
#? clean: Clean go cache, built executables, and the auto generated folder
clean:
go clean -cache
rm -fr build/_workspace/pkg/ $(GOBIN)/*
# 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: Install recommended developer tools
devtools:
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
env GOBIN= go install ./cmd/abigen
@type "solc" 2> /dev/null || echo 'Please install solc'
@type "protoc" 2> /dev/null || echo 'Please install protoc'
forkdiff:
docker run --rm \
--mount src=$(shell pwd),target=/host-pwd,type=bind \
protolambda/forkdiff:latest \
-repo /host-pwd/ -fork /host-pwd/fork.yaml -out /host-pwd/forkdiff.html
#? help: Get more info on make commands.
help: Makefile
@echo " Choose a command run in go-ethereum:"
@sed -n 's/^#?//p' $< | column -t -s ':' | sort | sed -e 's/^/ /'
.PHONY: help
.PHONY: concrete concrete-wasm concrete-solidity concrete-datamod
concrete: concrete-wasm concrete-solidity concrete-datamod
E2E_DIR = ./concrete/e2e
TINYGO_PCS_DIR = ./tinygo/precompiles
WASM_TESTDATA_DIR = ./concrete/wasm/testdata
concrete-wasm:
mkdir -p $(E2E_DIR)/build
tinygo build -opt=2 -o $(E2E_DIR)/build/blank.wasm -target=wasi $(TINYGO_PCS_DIR)/blank/blank.go
tinygo build -opt=2 -o $(E2E_DIR)/build/add.wasm -target=wasi $(TINYGO_PCS_DIR)/add/add.go
tinygo build -opt=2 -o $(E2E_DIR)/build/kkv.wasm -target=wasi $(TINYGO_PCS_DIR)/kkv/kkv.go
tinygo build -opt=2 -o $(E2E_DIR)/build/gas.wasm -target=wasi $(TINYGO_PCS_DIR)/gas/gas.go
mkdir -p $(WASM_TESTDATA_DIR)
cp $(E2E_DIR)/build/blank.wasm $(WASM_TESTDATA_DIR)/blank.wasm
cp $(E2E_DIR)/build/gas.wasm $(WASM_TESTDATA_DIR)/gas.wasm
concrete-solidity:
cd ./concrete/testtool/testdata && forge build
DATAMOD_CMD_DIR = ./concrete/cmd/concrete
DATAMOD_DIR = ./concrete/codegen/datamod
concrete-datamod:
go run $(DATAMOD_CMD_DIR) datamod $(DATAMOD_DIR)/testdata/good-datamod.json \
--pkg testdata --out $(DATAMOD_DIR)/testdata --table-type-experimental
go run $(DATAMOD_CMD_DIR) datamod concrete/e2e/datamod.json \
--pkg datamod --out concrete/e2e/datamod