-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 827 Bytes
/
Copy pathMakefile
File metadata and controls
39 lines (28 loc) · 827 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
.PHONY: build install clean test lint fmt help
BINARY := rgm
BUILD_DIR := bin
GO_FILES := $(shell find . -name '*.go' -type f)
## Build
build: ## Build the binary
@mkdir -p $(BUILD_DIR)
go build -o $(BUILD_DIR)/$(BINARY) ./cmd/rgm
install: build ## Install to GOPATH/bin
go install ./cmd/rgm
## Development
fmt: ## Format code
gofmt -s -w .
lint: ## Run linter
golangci-lint run ./...
test: ## Run tests
go test -v ./...
## Setup
deps: ## Download dependencies
go mod tidy
init-config: build ## Initialize default config
./$(BUILD_DIR)/$(BINARY) config init
## Cleanup
clean: ## Remove build artifacts
rm -rf $(BUILD_DIR)
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help