-
Notifications
You must be signed in to change notification settings - Fork 86
/
Makefile
102 lines (80 loc) · 3.19 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
.PHONY: tomo tomo-cross evm all test clean
.PHONY: tomo-linux tomo-linux-386 tomo-linux-amd64 tomo-linux-mips64 tomo-linux-mips64le
.PHONY: tomo-darwin tomo-darwin-386 tomo-darwin-amd64
GOBIN = $(shell pwd)/build/bin
GOFMT = gofmt
GO ?= 1.13.1
GO_PACKAGES = .
GO_FILES := $(shell find $(shell go list -f '{{.Dir}}' $(GO_PACKAGES)) -name \*.go)
GIT = git
tomo:
go run build/ci.go install ./cmd/tomo
@echo "Done building."
@echo "Run \"$(GOBIN)/tomo\" to launch tomo."
gc:
go run build/ci.go install ./cmd/gc
@echo "Done building."
@echo "Run \"$(GOBIN)/gc\" to launch gc."
bootnode:
go run build/ci.go install ./cmd/bootnode
@echo "Done building."
@echo "Run \"$(GOBIN)/bootnode\" to launch a bootnode."
puppeth:
go run build/ci.go install ./cmd/puppeth
@echo "Done building."
@echo "Run \"$(GOBIN)/puppeth\" to launch puppeth."
all:
go run build/ci.go install
test: all
go run build/ci.go test
clean:
rm -fr build/_workspace/pkg/ $(GOBIN)/*
# Cross Compilation Targets (xgo)
tomo-cross: tomo-windows-amd64 tomo-darwin-amd64 tomo-linux
@echo "Full cross compilation done:"
@ls -ld $(GOBIN)/tomo-*
tomo-linux: tomo-linux-386 tomo-linux-amd64 tomo-linux-mips64 tomo-linux-mips64le
@echo "Linux cross compilation done:"
@ls -ld $(GOBIN)/tomo-linux-*
tomo-linux-386:
go run build/ci.go xgo -- --go=$(GO) --targets=linux/386 -v ./cmd/tomo
@echo "Linux 386 cross compilation done:"
@ls -ld $(GOBIN)/tomo-linux-* | grep 386
tomo-linux-amd64:
go run build/ci.go xgo -- --go=$(GO) --targets=linux/amd64 -v ./cmd/tomo
@echo "Linux amd64 cross compilation done:"
@ls -ld $(GOBIN)/tomo-linux-* | grep amd64
tomo-linux-mips:
go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips --ldflags '-extldflags "-static"' -v ./cmd/tomo
@echo "Linux MIPS cross compilation done:"
@ls -ld $(GOBIN)/tomo-linux-* | grep mips
tomo-linux-mipsle:
go run build/ci.go xgo -- --go=$(GO) --targets=linux/mipsle --ldflags '-extldflags "-static"' -v ./cmd/tomo
@echo "Linux MIPSle cross compilation done:"
@ls -ld $(GOBIN)/tomo-linux-* | grep mipsle
tomo-linux-mips64:
go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64 --ldflags '-extldflags "-static"' -v ./cmd/tomo
@echo "Linux MIPS64 cross compilation done:"
@ls -ld $(GOBIN)/tomo-linux-* | grep mips64
tomo-linux-mips64le:
go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64le --ldflags '-extldflags "-static"' -v ./cmd/tomo
@echo "Linux MIPS64le cross compilation done:"
@ls -ld $(GOBIN)/tomo-linux-* | grep mips64le
tomo-darwin: tomo-darwin-386 tomo-darwin-amd64
@echo "Darwin cross compilation done:"
@ls -ld $(GOBIN)/tomo-darwin-*
tomo-darwin-386:
go run build/ci.go xgo -- --go=$(GO) --targets=darwin/386 -v ./cmd/tomo
@echo "Darwin 386 cross compilation done:"
@ls -ld $(GOBIN)/tomo-darwin-* | grep 386
tomo-darwin-amd64:
go run build/ci.go xgo -- --go=$(GO) --targets=darwin/amd64 -v ./cmd/tomo
@echo "Darwin amd64 cross compilation done:"
@ls -ld $(GOBIN)/tomo-darwin-* | grep amd64
tomo-windows-amd64:
go run build/ci.go xgo -- --go=$(GO) -buildmode=mode -x --targets=windows/amd64 -v ./cmd/tomo
@echo "Windows amd64 cross compilation done:"
@ls -ld $(GOBIN)/tomo-windows-* | grep amd64
gofmt:
$(GOFMT) -s -w $(GO_FILES)
$(GIT) checkout vendor