-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (37 loc) · 1.41 KB
/
Copy pathMakefile
File metadata and controls
50 lines (37 loc) · 1.41 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
.PHONY: build test test-podman vet lint vulncheck check clean install run help
# Project variables
BINARY_NAME=late
VERSION?=2.0.0
# Go compiler flags
LDFLAGS=-ldflags "-X late/internal/common.Version=${VERSION}"
help: ## Show this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
build: ## Build the late binary
@echo "Building ${BINARY_NAME}..."
@go build ${LDFLAGS} -o bin/${BINARY_NAME} ./cmd/late
test: ## Run tests for the entire project
@echo "Running tests..."
@go test -v -race ./...
@./test/late-podman-test.sh
test-podman: ## Test the Podman launcher without requiring Podman
@./test/late-podman-test.sh
vet: ## Catch suspicious Go code
@echo "Running go vet..."
@go vet ./...
lint: ## Run linter (golangci-lint)
@echo "Running golangci-lint..."
@golangci-lint run ./...
vulncheck: ## Run vulnerability scanner (govulncheck)
@echo "Running govulncheck..."
@govulncheck ./...
check: test vet lint vulncheck ## Run all quality and security checks
clean: ## Remove build artifacts
@echo "Cleaning..."
@rm -rf bin/
install: build ## Build and install the binary to your Go bin path
@echo "Installing to ~/.local/bin/late..."
@go build ${LDFLAGS} -o bin/${BINARY_NAME} ./cmd/late
@mv bin/${BINARY_NAME} ~/.local/bin/late
@install -m 0755 late-podman ~/.local/bin/late-podman
run: build ## Build and run the project
@./bin/${BINARY_NAME}