forked from vitelabs/go-vite
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
95 lines (65 loc) · 3.06 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
.PHONY: all clean
.PHONY: gvite_linux gvite-linux-386 gvite-linux-amd64 gvite-darwin-amd64
.PHONY: gvite-darwin gvite-darwin-amd64
.PHONY: gvite-windows gvite-windows-386 gvite-windows-amd64
.PHONY: gitversion
GO ?= latest
MAINDIR = rpc
SERVERMAIN = $(shell pwd)/cmd/$(MAINDIR)/main.go
BUILDDIR = $(shell pwd)/build
GOBIN = $(BUILDDIR)/cmd/$(MAINDIR)
TESTCLIENTMAIN = $(shell pwd)/testdata/main/ipc_client.go
GITREV = $(shell git rev-parse HEAD)
gitversion:
@echo "$(shell git rev-parse HEAD)" > $(shell pwd)/gitversion
gvite: gitversion
go build -i -o $(GOBIN)/gvite $(SERVERMAIN)
@echo "Build server done."
@echo "Run \"$(GOBIN)/gvite\" to start gvite."
go build -i -o $(GOBIN)/gvite-test-client $(TESTCLIENTMAIN)
@echo "Build test client done."
@echo "Run \"$(GOBIN)/gvite-test-client\" to start test client."
all: gvite-darwin gvite-windows gvite-linux
clean:
rm -r $(BUILDDIR)/
gvite-linux: gvite-linux-386 gvite-linux-amd64
@echo "Linux cross compilation done:"
@ls -ld $(GOBIN)/linux/gvite-linux-*
gvite-linux-386: gitversion
env GOOS=linux GOARCH=386 go build -i -o $(GOBIN)/linux/gvite-linux-386 $(SERVERMAIN)
@echo "Build server done."
@ls -ld $(GOBIN)/linux/gvite-linux-386
env GOOS=linux GOARCH=386 go build -i -o $(GOBIN)/linux/gvite-test-client-linux-386 $(TESTCLIENTMAIN)
@echo "Build test client done."
@ls -ld $(GOBIN)/linux/gvite-test-client-linux-386
gvite-linux-amd64: gitversion
env GOOS=linux GOARCH=amd64 go build -i -o $(GOBIN)/linux/gvite-linux-amd64 $(SERVERMAIN)
@echo "Build server done."
@ls -ld $(GOBIN)/linux/gvite-linux-amd64
env GOOS=linux GOARCH=amd64 go build -i -o $(GOBIN)/linux/gvite-test-client-linux-amd64 $(TESTCLIENTMAIN)
@echo "Build test client done."
@ls -ld $(GOBIN)/linux/gvite-test-client-linux-amd64
gvite-darwin: gitversion
env GOOS=darwin GOARCH=amd64 go build -i -o $(GOBIN)/darwin/gvite-darwin $(SERVERMAIN)
@echo "Build server done."
@ls -ld $(GOBIN)/darwin/gvite-darwin
env GOOS=darwin GOARCH=amd64 go build -i -o $(GOBIN)/darwin/gvite-test-client-darwin $(TESTCLIENTMAIN)
@echo "Build test client done."
@ls -ld $(GOBIN)/darwin/gvite-test-client-darwin
gvite-windows: gvite-windows-386 gvite-windows-amd64
@echo "Windows cross compilation done:"
@ls -ld $(GOBIN)/windows/gvite-windows-*
gvite-windows-386: gitversion
env GOOS=windows GOARCH=386 go build -i -o $(GOBIN)/windows/gvite-windows-386.exe $(SERVERMAIN)
@echo "Build server done."
@ls -ld $(GOBIN)/windows/gvite-windows-386.exe
env GOOS=windows GOARCH=386 go build -i -o $(GOBIN)/windows/gvite-test-client-windows-386.exe $(TESTCLIENTMAIN)
@echo "Build test client done."
@ls -ld $(GOBIN)/windows/gvite-test-client-windows-386.exe
gvite-windows-amd64: gitversion
env GOOS=windows GOARCH=amd64 go build -i -o $(GOBIN)/windows/gvite-windows-amd64.exe $(SERVERMAIN)
@echo "Build server done."
@ls -ld $(GOBIN)/windows/gvite-windows-amd64.exe
env GOOS=windows GOARCH=amd64 go build -i -o $(GOBIN)/windows/gvite-test-client-windows-amd64.exe $(TESTCLIENTMAIN)
@echo "Build test client done."
@ls -ld $(GOBIN)/windows/gvite-test-client-windows-amd64.exe