-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (41 loc) · 1.28 KB
/
Copy pathMakefile
File metadata and controls
55 lines (41 loc) · 1.28 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
55
.PHONY: help build tests clean run fmt lint
# Default target - show help
.DEFAULT_GOAL := help
# Variables
BINARY_NAME := art
BINARY_PATH := ./$(BINARY_NAME)
BUILD_FLAGS := -race
OUT_DIR := /tmp
##@ Help
help: ## Display this help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
##@ Building
build: ## Build the application
go build $(BUILD_FLAGS) -o $(BINARY_PATH)
build-release: ## Build optimized release binary
go build -o $(BINARY_PATH)
##@ Testing
tests: ## Run all tests
go test -v ./...
test-coverage: ## Run tests with coverage report
go test -v -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report generated: coverage.html"
##@ Development
run: build ## Build and run the application
$(BINARY_PATH)
fmt: ## Format code
go fmt ./...
lint: ## Run Go linter (requires golangci-lint)
golangci-lint run
##@ Cleanup
clean: ## Remove build artifacts and generated files
rm -f $(BINARY_PATH) coverage.out coverage.html
rm -rf output/
##@ Utility
version: ## Show Go version
go version
deps: ## Download dependencies
go mod download
go mod tidy
.PHONY: help build build-release tests test-coverage run fmt lint clean version deps