-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (63 loc) · 1.85 KB
/
Copy pathMakefile
File metadata and controls
77 lines (63 loc) · 1.85 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
68
69
70
71
72
73
74
75
76
.PHONY: help check fmt clippy build build-release test run run-release clean ci install-hooks
# Default target
help:
@echo "Available commands:"
@echo " make check - Run all checks (fmt, clippy, build, test)"
@echo " make fmt - Check code formatting"
@echo " make fmt-fix - Fix code formatting"
@echo " make clippy - Run clippy linter"
@echo " make build - Build the project (debug)"
@echo " make build-release - Build the project (release)"
@echo " make test - Run tests"
@echo " make run - Run the game (debug)"
@echo " make run-release - Run the game (release)"
@echo " make clean - Clean build artifacts"
@echo " make ci - Run CI checks (same as CI pipeline)"
@echo " make install-hooks - Install pre-commit hook"
# Run all checks
check: fmt clippy build test
# Check formatting
fmt:
@echo "Checking code formatting..."
cargo fmt -- --check
# Fix formatting
fmt-fix:
@echo "Fixing code formatting..."
cargo fmt
# Run clippy
clippy:
@echo "Running clippy..."
cargo clippy -- -D warnings
# Build the project
build:
@echo "Building project (debug)..."
cargo build --verbose
# Build the project (release)
build-release:
@echo "Building project (release)..."
cargo build --release --verbose
# Run tests
test:
@echo "Running tests..."
cargo test --verbose
# Run the game
run:
@echo "Running the game (debug)..."
cargo run
# Run the game (release)
run-release:
@echo "Running the game (release)..."
cargo run --release
# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
cargo clean
# CI checks (same as CI pipeline)
ci: fmt clippy build test
# Install pre-commit hook
install-hooks:
@echo "Installing pre-commit hook..."
@mkdir -p .git/hooks
@cp scripts/pre-commit .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@echo "Pre-commit hook installed successfully!"