-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
87 lines (69 loc) · 2.28 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
PROFILING_FOLDER = profiling
GO_VERSION=$(shell go version | grep -o 'go[[:digit:]]\.[[:digit:]]')
default: test lint
ci: deps-main lint test-main
internal: deps-internal lint test-internal
deps-main:
ifeq ($(GO_VERSION), go1.6)
echo "$(GO_VERSION) is not a supported Go release. Skipping golint."
else ifeq ($(GO_VERSION), go1.7)
echo "$(GO_VERSION) is not a supported Go release. Skipping golint."
else ifeq ($(GO_VERSION), go1.8)
echo "$(GO_VERSION) is not a supported Go release. Skipping golint."
else
go get -u golang.org/x/lint/golint
endif
go get -t -v ./
deps-internal:
ifeq ($(GO_VERSION), go1.6)
echo "$(GO_VERSION) is not a supported Go release. Skipping golint."
else ifeq ($(GO_VERSION), go1.7)
echo "$(GO_VERSION) is not a supported Go release. Skipping golint."
else ifeq ($(GO_VERSION), go1.8)
echo "$(GO_VERSION) is not a supported Go release. Skipping golint."
else
go get -u golang.org/x/lint/golint
endif
go get -t -v ./internal
lint:
ifeq ($(GO_VERSION), go1.6)
echo "$(GO_VERSION) is not a supported Go release. Skipping golint."
else ifeq ($(GO_VERSION), go1.7)
echo "$(GO_VERSION) is not a supported Go release. Skipping golint."
else ifeq ($(GO_VERSION), go1.8)
echo "$(GO_VERSION) is not a supported Go release. Skipping golint."
else
golint ./...
endif
vet:
go vet ./...
test-all:
go test -cover -v ./...
test-internal:
go test -cover -v -run=^ ./internal
test-main:
go test -cover -v -run=^ ./
test-v:
go test -check.vv -cover ./...
bench:
mkdir -p $(PROFILING_FOLDER)
go test -check.vv -check.b -outputdir $(PROFILING_FOLDER) -cpuprofile cpu.pprof -memprofile memory.pprof $(RUN)
mv ed448.test $(PROFILING_FOLDER)
go tool pprof -top -output=$(PROFILING_FOLDER)/cpu-top.txt $(PROFILING_FOLDER)/ed448.test $(PROFILING_FOLDER)/cpu.pprof
go tool pprof -top -output=$(PROFILING_FOLDER)/mem-top.txt $(PROFILING_FOLDER)/ed448.test $(PROFILING_FOLDER)/memory.pprof
clean:
rm -rf $(PROFILING_FOLDER)
tidy:
go mod tidy
ci-lint:
golangci-lint run
race:
go test -race -short $(go list ./... | grep -v /vendor/)
android:
@go get -d golang.org/x/mobile/cmd/gomobile
@gomobile init
@gomobile bind -v -o ed448.aar -target=android ./mobile
ios:
@go get -d golang.org/x/mobile/cmd/gomobile
@gomobile init
@gomobile bind -v -o ed448.xcframework -target=ios ./mobile