-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (38 loc) · 853 Bytes
/
Copy pathMakefile
File metadata and controls
48 lines (38 loc) · 853 Bytes
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
current_os := $(shell uname -s | tr '[:upper:]' '[:lower:]')
bin_ext :=
ifeq ($(OS),Windows_NT)
current_os = windows
bin_ext = .exe
endif
.PHONY: deps
deps:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
.PHONY: setup
setup: deps
mkdir -p .draw
.PHONY: build
build:
go build -v -o build/bin/gcs_$(current_os)$(bin_ext)
.PHONY: install
install:
go install
.PHONY: test
test: setup
go test -v ./pkg/...
.PHONY: lint
lint: deps
golangci-lint run
.PHONY: fmt
fmt:
@go fmt ./...
.PHONY: coverage
coverage:
mkdir -p .cov
-go test ./pkg/... -cover -args -test.gocoverdir="${PWD}/.cov"
go tool covdata func -i=.cov/
FUNC?=CycloA
.PHONY: graph/test
graph/test: setup
-go test ./pkg/parser/graph_test.go -v -failfast
dot -Tsvg -O .draw/$(FUNC).gv
firefox-developer-edition --new-tab .draw/$(FUNC).gv.svg &