Skip to content

Commit

Permalink
Minor makefile improvements (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgaughan authored Sep 21, 2024
1 parent 2e63aa8 commit 3c6b1b7
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ 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 -tags netgo,timetzdata -trimpath -ldflags '-s -w' -o $(NAME) ./cmd/$(NAME)
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
Expand All @@ -24,28 +28,29 @@ go.sum: go.mod
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

requirements.txt: requirements.in
%.txt: %.in
uv pip compile $< > $@

.PHONY: tests
tests:
go test -cover ./...

.DEFAULT: build

.PHONY: build clean tidy update fmt lint docs tests serve-docs
go test -cover -v ./...

0 comments on commit 3c6b1b7

Please sign in to comment.