-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (23 loc) · 880 Bytes
/
Copy pathMakefile
File metadata and controls
31 lines (23 loc) · 880 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: build test clean install run help
# Project variables
BINARY_NAME=late
VERSION?=1.4.2
# 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 ./...
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
run: build ## Build and run the project
@./bin/${BINARY_NAME}