-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (33 loc) · 1.24 KB
/
Makefile
File metadata and controls
44 lines (33 loc) · 1.24 KB
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
.PHONY: build release dashboard test fmt fmt-check lint go-lint dashboard-lint clean install
build: dashboard
go build -o clawpatrol ./cmd/clawpatrol
# release mirrors .github/workflows/release.yml: strip the symbol
# table and DWARF (-s -w) and rewrite source paths (-trimpath). On
# this tree that drops the binary from ~88 MB to ~62 MB without
# changing runtime behaviour. Use this when packaging for users —
# `make build` stays unstripped so panics keep file:line info.
release: dashboard
go build -ldflags "-s -w" -trimpath -o clawpatrol ./cmd/clawpatrol
dashboard:
cd dashboard && deno install && deno task build
test:
go test ./...
fmt:
gofmt -w .
cd dashboard && deno task format
fmt-check:
test -z "$$(gofmt -l .)"
cd dashboard && deno task format:check
lint: go-lint dashboard-lint
# `go-lint` requires the dashboard bundle so the //go:embed in
# dashboard/embed.go resolves at compile time. Depending on
# `dashboard` here makes a clean checkout work without manual ordering.
go-lint: dashboard
golangci-lint run --timeout 5m ./...
dashboard-lint:
cd dashboard && deno task lint
clean:
rm -f clawpatrol
rm -rf dashboard/dist dashboard/node_modules
install: build
install -m 0755 clawpatrol $${PREFIX:-$$HOME/.local/bin}/clawpatrol