-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (31 loc) · 979 Bytes
/
Copy pathMakefile
File metadata and controls
43 lines (31 loc) · 979 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
.PHONY: all build clean test test-race lint vuln ci fmt
# Binary output directory and name (overridable)
BINDIR ?= ./bin
BINARY ?= coder-ssh-gateway
# Version link flags (overridable)
VERSION ?= dev
COMMIT ?= dev
DATE ?= dev
LDFLAGS ?= -X github.com/HamStudy/coder-ssh-gateway/internal/version.Version=$(VERSION) \
-X github.com/HamStudy/coder-ssh-gateway/internal/version.Commit=$(COMMIT) \
-X github.com/HamStudy/coder-ssh-gateway/internal/version.Date=$(DATE)
.DEFAULT_GOAL := all
all: build
build:
mkdir -p $(BINDIR)
go build -ldflags "$(LDFLAGS)" -o $(BINDIR)/$(BINARY) ./cmd/coder-ssh-gateway
clean:
rm -rf $(BINDIR)
test:
go test ./... -count=1
test-race:
go test ./... -race -count=1
lint:
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@v0.8.1 ./...
vuln:
go run golang.org/x/vuln/cmd/govulncheck@v1.7.0 ./...
ci: test test-race lint vuln
fmt:
gofmt -l .
@if command -v goimports >/dev/null 2>&1; then goimports -l .; fi