forked from hootrhino/rulex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (42 loc) · 834 Bytes
/
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
APP=rulex
.PHONY: all
all:
make build
.PHONY: build
build:
go mod tidy
chmod +x gen_info.sh
go generate
CGO_ENABLED=1 GOOS=linux
go build -v -ldflags "-s -w" -o ${APP}
.PHONY: xx
xx:
make build
.PHONY: windows
windows:
go mod tidy
SET GOOS=windows
SET CGO_ENABLED=1
go build -ldflags "-s -w" -o ${APP}.exe
.PHONY: arm32
arm32:
CGO_ENABLED=1 GOOS=linux GOARCH=arm CC=arm-linux-gnueabi-gcc\
go build -ldflags "-s -w -linkmode external -extldflags -static"
.PHONY: arm64
arm64:
CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc\
go build -ldflags "-s -w -linkmode external -extldflags -static"
.PHONY: run
run:
go run -race run
.PHONY: test
test:
go test rulex/test -v
.PHONY: cover
cover:
go test rulex/test -v -cover
.PHONY: clean
clean:
go clean
rm _release -rf
rm *.db *log.txt -rf