-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathMakefile
62 lines (51 loc) · 1.43 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
# Binary name
BINARY=ptg
GOBUILD=go build -ldflags "-s -w" -o ${BINARY}
GOCLEAN=go clean
RMTARGZ=rm -rf *.gz
RMMACAPP=rm -rf ptg.app
VERSION=1.0.5
# Build
build:
$(GOCLEAN)
$(GOBUILD)
clean:
$(GOCLEAN)
$(RMTARGZ)
git-tag:
git tag $(VERSION); \
git push origin $(VERSION); \
release:
# Clean
$(GOCLEAN)
$(RMTARGZ)
# Build for mac
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GOBUILD)
tar czvf ${BINARY}-mac64-${VERSION}.tar.gz ./${BINARY}
# Build for arm
$(GOCLEAN)
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $(GOBUILD)
tar czvf ${BINARY}-arm64-${VERSION}.tar.gz ./${BINARY}
# Build for linux
$(GOCLEAN)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD)
tar czvf ${BINARY}-linux64-${VERSION}.tar.gz ./${BINARY}
# Build for win
$(GOCLEAN)
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GOBUILD).exe
tar czvf ${BINARY}-win64-${VERSION}.tar.gz ./${BINARY}.exe
$(GOCLEAN)
gen-go-proto:
@protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
reflect/gen/test.proto
gen-log-proto:
@protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
gui/io/log.proto
pkg-win:
fyne package -os windows -src gui/ -icon pic/gopher.png -name ${BINARY} -appVersion $(VERSION)
pkg-macos:
fyne package -os darwin -src gui/ -icon pic/gopher.png -name ${BINARY} -appVersion $(VERSION)
tar czvf ${BINARY}-mac-gui.tar ./${BINARY}.app
$(RMMACAPP)