-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
39 lines (26 loc) · 1.18 KB
/
Copy pathmakefile
File metadata and controls
39 lines (26 loc) · 1.18 KB
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
include build.conf
init:
go mod tidy
dev:
go run ./src/main.go
# 需要集成发布器 goreleaser
build:
# Mac
GOOS=darwin GOARCH=amd64 go build -ldflags "-X seeed-cli/commands/configs.Version=$(VERSION)" -o bin/seeed-cli-darwin-amd64
GOOS=darwin GOARCH=arm64 go build -ldflags "-X seeed-cli/commands/configs.Version=$(VERSION)" -o bin/seeed-cli-darwin-arm64
# Linux
GOOS=linux GOARCH=amd64 go build -ldflags "-X seeed-cli/commands/configs.Version=$(VERSION)" -o bin/seeed-cli-linux-amd64
GOOS=linux GOARCH=arm64 go build -ldflags "-X seeed-cli/commands/configs.Version=$(VERSION)" -o bin/seeed-cli-linux-arm64
# Windows
GOOS=windows GOARCH=amd64 go build -ldflags "-X seeed-cli/commands/configs.Version=$(VERSION)" -o bin/seeed-cli.exe
run:
./bin/seeed-cli
install:
go install -ldflags "-X seeed-cli/commands/configs.Version=$(VERSION)"
# 安装后确认是否安装成功
# ls $(go env GOPATH)/bin
# 如命令在 go env GOPATH 目录下,则可以直接执行,但是无法执行,请将 go env GOPATH 目录添加到环境变量 PATH 中
# echo 'export PATH="$(go env GOPATH)/bin:$PATH"' >> ~/.zshrc
# source ~/.zshrc
clean:
rm -rf ./bin