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
.PHONY: build install install-dev test clean help
# Default target
help:
@echo "Available targets:"
@echo " make build - Build release binary"
@echo " make install - Build and safely install to ~/.claude/statusline/"
@echo " make install-dev - Build debug binary and install (faster for development)"
@echo " make test - Run all tests"
@echo " make clean - Clean build artifacts"
# Build release binary
build:
@echo "Building release binary..."
@cargo build --release
# Build debug binary (faster for development)
build-dev:
@echo "Building debug binary..."
@cargo build
# Safe installation (release mode)
install: build
@echo "Installing statusline binary..."
@mkdir -p ~/.claude/statusline
@# Atomic installation: copy to temp, then move
@cp target/release/claude-code-status-line ~/.claude/statusline/claude-code-status-line.new
@chmod +x ~/.claude/statusline/claude-code-status-line.new
@mv -f ~/.claude/statusline/claude-code-status-line.new ~/.claude/statusline/claude-code-status-line
@echo "✓ Successfully installed to ~/.claude/statusline/claude-code-status-line"
# Safe installation (debug mode - faster for development)
install-dev: build-dev
@echo "Installing debug statusline binary..."
@mkdir -p ~/.claude/statusline
@# Atomic installation: copy to temp, then move
@cp target/debug/claude-code-status-line ~/.claude/statusline/claude-code-status-line.new
@chmod +x ~/.claude/statusline/claude-code-status-line.new
@mv -f ~/.claude/statusline/claude-code-status-line.new ~/.claude/statusline/claude-code-status-line
@echo "✓ Successfully installed debug build to ~/.claude/statusline/claude-code-status-line"
# Run tests
test:
@cargo test
# Clean build artifacts
clean:
@cargo clean
@echo "✓ Cleaned build artifacts"