-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
48 lines (36 loc) · 1.02 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
EXE =
ifeq ($(shell go env GOOS),windows)
EXE = .exe
endif
## The following tasks delegate to `script/build.go` so they can be run cross-platform.
.PHONY: bin/vulncheck$(EXE)
bin/vulncheck$(EXE): script/build$(EXE)
@script/build$(EXE) $@
script/build$(EXE): script/build.go
ifeq ($(EXE),)
GOOS= GOARCH= GOARM= GOFLAGS= CGO_ENABLED= go build -o $@ $<
else
go build -o $@ $<
endif
.PHONY: clean
clean: script/build$(EXE)
@$< $@
.PHONY: manpages
manpages: script/build$(EXE)
@$< $@
.PHONY: completions
completions: bin/gh$(EXE)
mkdir -p ./share/bash-completion/completions ./share/fish/vendor_completions.d ./share/zsh/site-functions
bin/gh$(EXE) completion -s bash > ./share/bash-completion/completions/gh
bin/gh$(EXE) completion -s fish > ./share/fish/vendor_completions.d/gh.fish
bin/gh$(EXE) completion -s zsh > ./share/zsh/site-functions/_gh
# just a convenience task around `go test`
.PHONY: test
test:
go test ./...
ray:
@go get github.com/octoper/go-ray
update:
go get -u ./... && go mod tidy
lint:
@golangci-lint run