-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (40 loc) · 1.21 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
# 获取最后的tag
TAG = $(shell git tag -l --sort=v:refname | tail -n 1)
all: web generate build pack changelog
web:
@echo 编译 web
ionic build --prod
generate:
@echo 生成密钥和资源文件
rm ./keys/bindata.go
rm ./rich/bindata.go
go generate
build:
@echo 交叉编译
CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags="-s -w" -o rich-i386.exe main.go
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o rich-amd64.exe main.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o rich-linux main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o rich-darwin main.go
pack:
@echo 打包 $(TAG)
mv rich-i386.exe go-rich.exe
zip go-rich-$(TAG)-windows_i386.zip go-rich.exe rich.bat
rm go-rich.exe
mv rich-amd64.exe go-rich.exe
zip go-rich-$(TAG)-windows_amd64.zip go-rich.exe rich.bat
rm go-rich.exe
mv rich-linux go-rich
zip go-rich-$(TAG)-linux_amd64.zip go-rich
rm go-rich
mv rich-darwin go-rich
zip go-rich-$(TAG)-darwin_amd64.zip go-rich
rm go-rich
changelog:
@echo 修改记录
conventional-changelog -p angular -i CHANGELOG.md -s -r 0
todo:
@echo 寻找未完成代码
grep -rnw "TODO" rich src
test:
@echo 测试
go test ./rich