-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (22 loc) · 750 Bytes
/
Copy pathMakefile
File metadata and controls
31 lines (22 loc) · 750 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
.PHONY: help build run test vet lint tidy clean
GO ?= go
BIN_DIR := bin
BIN := $(BIN_DIR)/prism-api
help: ## Show available make targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-10s\033[0m %s\n", $$1, $$2}'
build: ## Build the prism-api binary into ./bin
@mkdir -p $(BIN_DIR)
$(GO) build -trimpath -o $(BIN) ./cmd/prism-api
run: build ## Build and run the binary locally
./$(BIN)
test: ## Run unit tests with race detector
$(GO) test -race -count=1 ./...
vet: ## Run go vet
$(GO) vet ./...
lint: ## Run golangci-lint (requires golangci-lint in PATH)
golangci-lint run
tidy: ## Run go mod tidy
$(GO) mod tidy
clean: ## Remove build artifacts
rm -rf $(BIN_DIR)