-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
90 lines (75 loc) · 2.24 KB
/
Copy pathMakefile
File metadata and controls
90 lines (75 loc) · 2.24 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Firmalyzer Makefile
# Common development and deployment commands
.PHONY: all build install dev test lint clean docker help
PYTHON := python3
PIP := pip3
MATURIN := maturin
# Default target
all: build
# Build the Rust extension and install
build:
cd python && $(MATURIN) build --release
@echo "✅ Build complete"
# Development install (editable)
dev:
cd python && $(MATURIN) develop
@echo "✅ Development install complete"
# Install for production
install: build
$(PIP) install python/target/wheels/*.whl
@echo "✅ Installation complete"
# Run tests
test:
cd core && cargo test --no-default-features
cd python && $(PYTHON) -m pytest tests/ -v
@echo "✅ All tests passed"
# Run Rust tests only
test-rust:
cd core && cargo test --no-default-features --verbose
# Lint code
lint:
cd core && cargo fmt --check
cd core && cargo clippy --no-default-features -- -D warnings
cd python && ruff check firmalyzer/
@echo "✅ Linting complete"
# Format code
format:
cd core && cargo fmt
cd python && ruff format firmalyzer/
@echo "✅ Formatting complete"
# Clean build artifacts
clean:
cd core && cargo clean
rm -rf python/target
rm -rf python/*.egg-info
rm -rf python/dist
rm -f *.html
rm -f *.bin
rm -rf ~/.firmalyzer/logs/*
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true
@echo "✅ Cleaned"
# Build Docker image
docker:
docker build -t firmalyzer:latest .
@echo "✅ Docker image built"
# Run Docker container
docker-run:
docker run -it --rm -v $(PWD):/data firmalyzer:latest analyze /data/sample.bin
# Generate documentation
docs:
@echo "📚 Documentation available in docs/ directory"
# Show help
help:
@echo "Firmalyzer Development Commands"
@echo "================================"
@echo " make build - Build release wheel"
@echo " make dev - Install in development mode"
@echo " make install - Build and install"
@echo " make test - Run all tests"
@echo " make test-rust - Run Rust tests only"
@echo " make lint - Check code style"
@echo " make format - Format code"
@echo " make clean - Remove build artifacts"
@echo " make docker - Build Docker image"
@echo " make help - Show this message"