-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
67 lines (45 loc) · 1.42 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
#!/usr/bin/env make
GO ?= go
TARGETDIR := target
HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
HOSTARCH := $(shell uname -m)
GOOS ?= ${HOSTOS}
GOARCH ?= ${HOSTARCH}
GOCMD = ./src/node/cmd
TAGS = nocgo
# Set the execution extension for Windows.
ifeq (${GOOS},windows)
EXE := .exe
endif
OS_ARCH := $(GOOS)_$(GOARCH)$(EXE)
OPERATOR := ${TARGETDIR}/operator_$(OS_ARCH)
VERIFIER := ${TARGETDIR}/verifier_$(OS_ARCH)
all: fmt vet test build
fmt:
@echo "+ $@"
@test -z "$$(gofmt -s -l . 2>&1 | grep -v ^vendor/ | tee /dev/stderr)" || \
(echo >&2 "+ please format Go code with 'gofmt -s'" && false)
vet:
@echo "+ $@"
@go tool vet $(shell ls -1 -d */ | grep -v -e vendor)
test:
@echo "+ $@"
${GO} test -tags nocgo $(shell go list ./...)
coverage:
@echo "+ $@"
${GO} test -tags nocgo $(shell go list ./...) -coverprofile=coverage.out && ${GO} tool cover -html=coverage.out
contracts:
@echo "+ $@"
@$(MAKE) -C src/contracts all
build: build/operator build/verifier
build/operator:
@echo "+ $@"
${GO} build -tags "$(TAGS)" -ldflags "$(LDFLAGS)" -o ${OPERATOR} ${GOCMD}/operator
build/verifier:
@echo "+ $@"
${GO} build -tags "$(TAGS)" -ldflags "$(LDFLAGS)" -o ${VERIFIER} ${GOCMD}/verifier
docker: docker/operator docker/verifier
docker/operator:
docker build -t plasma-operator:latest -f ./docker/Dockerfile.operator .
docker/verifier:
docker build -t plasma-verifier:latest -f ./docker/Dockerfile.operator .