-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (54 loc) · 1.49 KB
/
Makefile
File metadata and controls
67 lines (54 loc) · 1.49 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
56
57
58
59
60
61
62
63
64
65
66
67
SHELL := /bin/bash
# Binary name
BINARY_NAME=osc2hue
# Build the application
build:
go build -o ${BINARY_NAME} .
# Run the application
run:
go run .
# Clean build artifacts
clean:
go clean
rm -f ${BINARY_NAME}*
# Run tests
test:
go test -v ./...
# Run tests with coverage
test-coverage:
go test -v -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
# Install dependencies
deps:
go mod tidy
go mod download
# Format code
fmt:
go fmt ./...
# Lint code (requires golangci-lint)
lint:
golangci-lint run
# Build for multiple platforms
build-all:
GOOS=linux GOARCH=amd64 go build -o ${BINARY_NAME}-linux-amd64 .
GOOS=windows GOARCH=amd64 go build -o ${BINARY_NAME}-windows-amd64.exe .
GOOS=darwin GOARCH=amd64 go build -o ${BINARY_NAME}-darwin-amd64 .
GOOS=darwin GOARCH=arm64 go build -o ${BINARY_NAME}-darwin-arm64 .
# Install the binary
install:
go install .
# Show help
help:
@echo "Available commands:"
@echo " build - Build the application"
@echo " run - Run the application"
@echo " clean - Clean build artifacts"
@echo " test - Run tests"
@echo " test-coverage- Run tests with coverage"
@echo " deps - Install dependencies"
@echo " fmt - Format code"
@echo " lint - Lint code"
@echo " build-all - Build for multiple platforms"
@echo " install - Install the binary"
@echo " help - Show this help message"
.PHONY: build run clean test test-coverage deps fmt lint build-all install help