forked from ljnchn/cocopilot2gpt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (44 loc) · 1.71 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
# Binary name
BINARY=copilot2gpt
# 构建目录
DIST_DIR := ./dist
# Builds the project
build:
GO111MODULE=on go build -o ${BINARY} -ldflags "-X main.Version=${VERSION}"
# GO111MODULE=on go test -v
# Installs our project: copies binaries
install:
GO111MODULE=on go install
release:
# Clean
go clean
rm -rf ${DIST_DIR}/*.gz
# Build for mac
GO111MODULE=on go build -ldflags "-s -w -X main.Version=${VERSION}"
tar czvf ${DIST_DIR}/${BINARY}-mac64-${VERSION}.tar.gz ./${BINARY} .env.example
# Build for arm
go clean
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go build -ldflags "-s -w -X main.Version=${VERSION}"
tar czvf ${DIST_DIR}/${BINARY}-linux-arm64-${VERSION}.tar.gz ./${BINARY} .env.example
# Build for linux386
go clean
CGO_ENABLED=0 GOOS=linux GOARCH=386 GO111MODULE=on go build -ldflags "-s -w -X main.Version=${VERSION}"
tar czvf ${DIST_DIR}/${BINARY}-linux-386-${VERSION}.tar.gz ./${BINARY} .env.example
# Build for linux
go clean
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags "-s -w -X main.Version=${VERSION}"
tar czvf ${DIST_DIR}/${BINARY}-linux-64-${VERSION}.tar.gz ./${BINARY} .env.example
# Build for win386
go clean
CGO_ENABLED=0 GOOS=windows GOARCH=386 GO111MODULE=on go build -ldflags "-s -w -X main.Version=${VERSION}"
tar czvf ${DIST_DIR}/${BINARY}-win-386-${VERSION}.tar.gz ./${BINARY}.exe .env.example
# Build for win
go clean
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 GO111MODULE=on go build -ldflags "-s -w -X main.Version=${VERSION}"
tar czvf ${DIST_DIR}/${BINARY}-win-64-${VERSION}.tar.gz ./${BINARY}.exe .env.example
go clean
# Cleans our projects: deletes binaries
clean:
go clean
rm -rf ${DIST_DIR}/*.gz
.PHONY: clean build