-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
executable file
·179 lines (143 loc) · 6.38 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# 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: gptn android ios gptn-cross swarm evm all test clean
.PHONY: gptn-linux gptn-linux-386 gptn-linux-amd64 gptn-linux-mips64 gptn-linux-mips64le
.PHONY: gptn-linux-arm gptn-linux-arm-5 gptn-linux-arm-6 gptn-linux-arm-7 gptn-linux-arm64
.PHONY: gptn-darwin gptn-darwin-386 gptn-darwin-amd64
.PHONY: gptn-windows gptn-windows-386 gptn-windows-amd64
# Define variables needed for mirroring
DOCKER_TAG = 0.6
BASE_DOCKER_TAG = $(DOCKER_TAG)
DOCKER_NS = palletone
BASE_DOCKER_NS = $(DOCKER_NS)
GOBIN = $(shell pwd)/build/bin
GO ?= latest
BUILD_DIR = $(shell pwd)/build
gptn:
go run -mod=vendor build/ci.go install ./cmd/gptn
@echo "Done building."
@echo "Run \"$(GOBIN)/gptn\" to launch gptn."
mainnet:
go build -mod=vendor -tags "mainnet" ./cmd/gptn
@echo "Done building."
@echo "Run \"./gptn\" to launch mainnet node."
acme:
go build -mod=vendor -tags "gm" ./cmd/gptn
@echo "Done building."
@echo "Run \"./gptn\" to launch acme node."
all:
build/env.sh go run -mod=vendor build/ci.go install
golang-baseimage:
./images/goimg/pull.sh
golang-baseimage-dev:
./images/dev/dev.sh
docker:
@mkdir -p $(BUILD_DIR)/images/gptn
@cat images/gptn/Dockerfile.in \
| sed -e 's|_BASE_NS_|$(BASE_DOCKER_NS)|g' \
| sed -e 's|_NS_|$(DOCKER_NS)|g' \
| sed -e 's|_BASE_TAG_|$(BASE_DOCKER_TAG)|g' \
| sed -e 's|_TAG_|$(DOCKER_TAG)|g' \
| sed -e 's|_GPTN_PATH_|$(GOBIN)|g' \
> $(BUILD_DIR)/images/gptn/Dockerfile
@cp -rf $(GOBIN)/gptn $(BUILD_DIR)/images/gptn
@cp -rf images/gptn/entrypoint.sh $(BUILD_DIR)/images/gptn
@echo "Successful generation of mirror files"
android:
build/env.sh go run build/ci.go aar --local
@echo "Done building."
@echo "Import \"$(GOBIN)/gptn.aar\" to use the library."
ios:
build/env.sh go run build/ci.go xcode --local
@echo "Done building."
@echo "Import \"$(GOBIN)/Geth.framework\" to use the library."
test: all
build/env.sh go run -mod=vendor build/ci.go test
lint: ## Run linters.
build/env.sh go run -mod=vendor build/ci.go lint
clean:
rm -fr build/_workspace $(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:
env GOBIN= go get -u golang.org/x/tools/cmd/stringer
env GOBIN= go get -u github.com/kevinburke/go-bindata/go-bindata
env GOBIN= go get -u github.com/fjl/gencodec
env GOBIN= go get -u github.com/golang/protobuf/protoc-gen-go
env GOBIN= go install ./cmd/abigen
@type "npm" 2> /dev/null || echo 'Please install node.js and npm'
@type "solc" 2> /dev/null || echo 'Please install solc'
@type "protoc" 2> /dev/null || echo 'Please install protoc'
# Cross Compilation Targets (xgo)
gptn-cross: gptn-linux gptn-darwin gptn-windows gptn-android gptn-ios
@echo "Full cross compilation done:"
@ls -ld $(GOBIN)/gptn-*
gptn-linux: gptn-linux-386 gptn-linux-amd64 gptn-linux-arm gptn-linux-mips64 gptn-linux-mips64le
@echo "Linux cross compilation done:"
@ls -ld $(GOBIN)/gptn-linux-*
gptn-linux-386:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/386 -v ./cmd/gptn
@echo "Linux 386 cross compilation done:"
@ls -ld $(GOBIN)/gptn-linux-* | grep 386
gptn-linux-amd64:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/amd64 -v ./cmd/gptn
@echo "Linux amd64 cross compilation done:"
@ls -ld $(GOBIN)/gptn-linux-* | grep amd64
gptn-linux-arm: gptn-linux-arm-5 gptn-linux-arm-6 gptn-linux-arm-7 gptn-linux-arm64
@echo "Linux ARM cross compilation done:"
@ls -ld $(GOBIN)/gptn-linux-* | grep arm
gptn-linux-arm-5:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/arm-5 -v ./cmd/gptn
@echo "Linux ARMv5 cross compilation done:"
@ls -ld $(GOBIN)/gptn-linux-* | grep arm-5
gptn-linux-arm-6:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/arm-6 -v ./cmd/gptn
@echo "Linux ARMv6 cross compilation done:"
@ls -ld $(GOBIN)/gptn-linux-* | grep arm-6
gptn-linux-arm-7:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/arm-7 -v ./cmd/gptn
@echo "Linux ARMv7 cross compilation done:"
@ls -ld $(GOBIN)/gptn-linux-* | grep arm-7
gptn-linux-arm64:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/arm64 -v ./cmd/gptn
@echo "Linux ARM64 cross compilation done:"
@ls -ld $(GOBIN)/gptn-linux-* | grep arm64
gptn-linux-mips:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips --ldflags '-extldflags "-static"' -v ./cmd/gptn
@echo "Linux MIPS cross compilation done:"
@ls -ld $(GOBIN)/gptn-linux-* | grep mips
gptn-linux-mipsle:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mipsle --ldflags '-extldflags "-static"' -v ./cmd/gptn
@echo "Linux MIPSle cross compilation done:"
@ls -ld $(GOBIN)/gptn-linux-* | grep mipsle
gptn-linux-mips64:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64 --ldflags '-extldflags "-static"' -v ./cmd/gptn
@echo "Linux MIPS64 cross compilation done:"
@ls -ld $(GOBIN)/gptn-linux-* | grep mips64
gptn-linux-mips64le:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64le --ldflags '-extldflags "-static"' -v ./cmd/gptn
@echo "Linux MIPS64le cross compilation done:"
@ls -ld $(GOBIN)/gptn-linux-* | grep mips64le
gptn-darwin: gptn-darwin-386 gptn-darwin-amd64
@echo "Darwin cross compilation done:"
@ls -ld $(GOBIN)/gptn-darwin-*
gptn-darwin-386:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=darwin/386 -v ./cmd/gptn
@echo "Darwin 386 cross compilation done:"
@ls -ld $(GOBIN)/gptn-darwin-* | grep 386
gptn-darwin-amd64:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=darwin/amd64 -v ./cmd/gptn
@echo "Darwin amd64 cross compilation done:"
@ls -ld $(GOBIN)/gptn-darwin-* | grep amd64
gptn-windows: gptn-windows-386 gptn-windows-amd64
@echo "Windows cross compilation done:"
@ls -ld $(GOBIN)/gptn-windows-*
gptn-windows-386:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=windows/386 -v ./cmd/gptn
@echo "Windows 386 cross compilation done:"
@ls -ld $(GOBIN)/gptn-windows-* | grep 386
gptn-windows-amd64:
build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=windows/amd64 -v ./cmd/gptn
@echo "Windows amd64 cross compilation done:"
@ls -ld $(GOBIN)/gptn-windows-* | grep amd64