-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
65 lines (50 loc) · 1.16 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
BINARY_NAME=globalssh
init:
go mod init ${BINARY_NAME}
tools:
go install github.com/mgechev/revive@latest
go install golang.org/x/tools/gopls@latest
go install golang.org/x/vuln/cmd/govulncheck@latest
deps:
go get github.com/redis/go-redis/v9
go get github.com/creack/pty
go get github.com/mattn/go-isatty
go get github.com/json-iterator/go
build:
go build -o ${BINARY_NAME}
gopls check
revive ./...
govulncheck ./...
test:
go test -v globalssh/net
gopls check
revive
viewcpu:
go tool pprof cpu.prof
viewmem:
go tool pprof mem.prof
prof:
go test ${BINARY_NAME}/server -cpuprofile cpu.prof -memprofile mem.prof
go tool pprof -raw -output=cpu.txt cpu.prof
./helpers/stackcollapse-go.pl cpu.txt | ./helpers/flamegraph.pl > cpu.svg
mem:
go build -gcflags=-m ./...
runc:
go build -o ${BINARY_NAME}
./${BINARY_NAME} client
runs:
go build -o ${BINARY_NAME}
./${BINARY_NAME} server
release:
./helpers/build_platforms.sh
git add .
git commit . -m "release"
git push
clean:
go clean
rm ${BINARY_NAME}
install:
go build -o ${BINARY_NAME}
echo "this part will only work on unix"
sudo mv ${BINARY_NAME} /usr/local/bin
go build -o ${BINARY_NAME}