forked from yqchilde/wxbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (49 loc) · 2.14 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
.PHONY: plugins release build
release: plugins build upx compress
GO_FLAGS = -ldflags="-s -w -X github.com/yqchilde/wxbot/engine/robot.version=${version}"
plugins:
go generate -tags plugins ./engine/plugins && go mod tidy
build:
@$(MAKE) --no-print-directory \
build-darwin-amd64 build-darwin-arm64 \
build-windows-amd64 build-windows-arm64 \
build-linux-amd64 build-linux-arm64
build-darwin-amd64:
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build ${GO_FLAGS} -o build/darwin-amd64/wxbot
build-darwin-arm64:
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build ${GO_FLAGS} -o build/darwin-arm64/wxbot
build-windows-amd64:
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build ${GO_FLAGS} -o build/windows-amd64/wxbot.exe
build-windows-arm64:
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build ${GO_FLAGS} -o build/windows-arm64/wxbot.exe
build-linux-amd64:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ${GO_FLAGS} -o build/linux-amd64/wxbot
build-linux-arm64:
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build ${GO_FLAGS} -o build/linux-arm64/wxbot
upx:
upx --best --lzma build/darwin-amd64/wxbot; \
upx --best --lzma build/windows-amd64/wxbot.exe; \
upx --best --lzma build/linux-amd64/wxbot;
compress:
@$(MAKE) --no-print-directory \
compress-darwin-amd64 compress-darwin-arm64 \
compress-windows-amd64 compress-windows-arm64 \
compress-linux-amd64 compress-linux-arm64
compress-darwin-amd64:
tar -czvf build/wxbot-darwin-amd64.tar.gz -C build/darwin-amd64/ wxbot; \
rm -rf build/darwin-amd64
compress-darwin-arm64:
tar -czvf build/wxbot-darwin-arm64.tar.gz -C build/darwin-arm64/ wxbot; \
rm -rf build/darwin-arm64
compress-windows-amd64:
tar -czvf build/wxbot-windows-amd64.tar.gz -C build/windows-amd64/ wxbot.exe; \
rm -rf build/windows-amd64
compress-windows-arm64:
tar -czvf build/wxbot-windows-arm64.tar.gz -C build/windows-arm64/ wxbot.exe; \
rm -rf build/windows-arm64
compress-linux-amd64:
tar -czvf build/wxbot-linux-amd64.tar.gz -C build/linux-amd64/ wxbot; \
rm -rf build/linux-amd64
compress-linux-arm64:
tar -czvf build/wxbot-linux-arm64.tar.gz -C build/linux-arm64/ wxbot; \
rm -rf build/linux-arm64