-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (40 loc) · 1.43 KB
/
Makefile
File metadata and controls
54 lines (40 loc) · 1.43 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
45
46
47
48
49
50
51
52
53
54
NAME:=nxtp
SOURCE:=$(wildcard *.go)
.PHONY: help
help: ## Show this help message
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
.PHONY: build
build: go.mod $(NAME) ## Build the nxtp binary
.PHONY: clean
clean: ## Clean build artifacts
rm -rf $(NAME) dist coverage.out coverage.html
$(NAME): $(SOURCE)
CGO_ENABLED=0 go build -v -tags netgo,timetzdata -trimpath -ldflags '-s -w' -o $@ .
zones.go: tools/windowsZones.xml
tools/generatezones.py $^ > $@
go fmt $@
.PHONY: fmt
fmt: ## Format the code
go fmt ./...
.PHONY: lint
lint: ## Lint the code
go vet ./...
golangci-lint run ./...
.PHONY: tests
tests: ## Run the tests
go test -cover -coverprofile=coverage.out -v ./...
coverage.out: tests
.PHONY: coverage-html
coverage-html: coverage.out ## Generate HTML report from coverage data
go tool cover -html=coverage.out -o coverage.html
.PHONY: test-release
test-release: ## Run `goreleaser release` without publishing anything
goreleaser release --auto-snapshot --clean --skip publish
.PHONY: rebuild-zones
rebuild-zones: update-zones zones.go ## Update Windows timezone data and regenerate zones.go
.PHONY: update-zones
update-zones: ## Download the latest Windows timezone data
curl -sL https://raw.githubusercontent.com/unicode-org/cldr/main/common/supplemental/windowsZones.xml -o tools/windowsZones.xml