-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (51 loc) · 1.74 KB
/
Makefile
File metadata and controls
63 lines (51 loc) · 1.74 KB
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
GITCOMMIT ?= $(shell git rev-parse HEAD)
GITDATE ?= $(shell git show -s --format='%ct')
# Find the github tag that points to this commit. If none are found, set the version string to "untagged"
# Prioritizes release tag, if one exists, over tags suffixed with "-rc"
VERSION ?= $(shell tags=$$(git tag --points-at $(GITCOMMIT) | grep '^op-batcher/' | sed 's/op-batcher\///' | sort -V); \
preferred_tag=$$(echo "$$tags" | grep -v -- '-rc' | tail -n 1); \
if [ -z "$$preferred_tag" ]; then \
if [ -z "$$tags" ]; then \
echo "untagged"; \
else \
echo "$$tags" | tail -n 1; \
fi \
else \
echo $$preferred_tag; \
fi)
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
LDFLAGSSTRING +=-X main.Version=$(VERSION)
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
# Include .env file if it exists
-include .env
# first so that make defaults to building the benchmark
.PHONY: build
build:
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CGO_ENABLED=0 go build -v $(LDFLAGS) -o ./bin/base-bench ./benchmark/cmd
.PHONY: contracts
contracts:
make -C contracts
.PHONY: clean
clean:
rm bin/base-bench
.PHONY: test
test:
go test -v ./...
.PHONY: build-reth
build-reth:
cd clients && ./build-reth.sh
.PHONY: build-geth
build-geth:
cd clients && ./build-geth.sh
.PHONY: build-builder
build-builder:
cd clients && ./build-builder.sh
.PHONY: build-binaries
build-binaries: build-reth build-geth build-builder
.PHONY: build-frontend
build-frontend:
cd report && yarn build
.PHONY: run-frontend
run-frontend:
cd report && set -a && [ -f ../.env ] && . ../.env && set +a && yarn dev