-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (32 loc) · 895 Bytes
/
Copy pathMakefile
File metadata and controls
40 lines (32 loc) · 895 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
APP_NAME := godedup
OUTPUT := $(APP_NAME)
INSTALL_DIR := /usr/local/bin
ifeq ($(OS),Windows_NT)
OUTPUT := $(APP_NAME).exe
endif
.PHONY: build
build:
CGO_ENABLED=0 go build -ldflags="-s -w" -o bin/$(OUTPUT) main.go
.PHONY: lint
lint:
golangci-lint run --output.tab.path=stdout
.PHONY: install
install: build
@echo "Installing bin/$(OUTPUT) to $(INSTALL_DIR)..."
@sudo chmod +x bin/$(OUTPUT) && sudo cp bin/$(OUTPUT) $(INSTALL_DIR)
.PHONY: test
test:
go test -v -race -cover ./...
.PHONY: clean
clean:
@rm -rf bin/ dist/ *.log
.PHONY: snapshot
snapshot:
GORELEASER_FORCE_TOKEN=github goreleaser release --skip sign --skip publish --snapshot --clean
.PHONY: help
help:
@echo "Usage: make <target>"
@echo ""
@echo "Available targets:"
@grep -E '^[a-zA-Z0-9_.-]+:.*?## ' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-24s\033[0m %s\n", $$1, $$2}'