-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
56 lines (41 loc) · 832 Bytes
/
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
NAME:=mercury
SOURCE:=$(wildcard internal/*.go internal/*/*.go cmd/*/*.go)
DOCS:=$(wildcard docs/*.md mkdocs.yml)
.PHONY: build
build: go.mod $(NAME)
.PHONY: tidy
tidy: go.mod fmt
.PHONY: clean
clean:
rm -rf $(NAME) dist site
$(NAME): $(SOURCE) go.sum
CGO_ENABLED=0 go build -v -tags netgo,timetzdata -trimpath -ldflags '-s -w' -o $(NAME) ./cmd/$(NAME)
.PHONY: update
update:
go get -u ./...
go mod tidy
go.sum: go.mod
go mod verify
@touch go.sum
go.mod: $(SOURCE)
go mod tidy
.PHONY: fmt
fmt:
go fmt ./...
.PHONY: lint
lint:
go vet ./...
.PHONY: serve-docs
serve-docs: .venv
.venv/bin/mkdocs serve
.PHONY: docs
docs: .venv $(DOCS)
.venv/bin/mkdocs build
.venv: requirements.txt
uv venv
uv pip install -r requirements.txt
%.txt: %.in
uv pip compile $< > $@
.PHONY: tests
tests:
go test -cover -v ./...