-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
91 lines (77 loc) · 2.45 KB
/
Copy pathMakefile
File metadata and controls
91 lines (77 loc) · 2.45 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
91
# Makefile for Solana Secure Signer
.PHONY: all build release test clean install help
# Default target
all: build
# Build in debug mode
build:
@echo "Building in debug mode..."
cd rust_signer && cargo build
# Build in release mode (optimized)
release:
@echo "Building in release mode..."
cd rust_signer && cargo build --release
@echo ""
@echo "✓ Build complete!"
@echo " Library: rust_signer/target/release/libsolana_secure_signer.*"
@echo " Binary: rust_signer/target/release/solana-signer"
# Run tests
test:
@echo "Running Rust tests..."
cd rust_signer && cargo test
@echo ""
@echo "Running Python example..."
python python_signer_example.py
# Run tests with coverage
coverage:
@echo "Running tests with coverage..."
cd rust_signer && cargo tarpaulin --out Html
@echo "Coverage report: rust_signer/tarpaulin-report.html"
# Run clippy (linter)
lint:
@echo "Running clippy..."
cd rust_signer && cargo clippy -- -D warnings
# Format code
format:
@echo "Formatting code..."
cd rust_signer && cargo fmt
# Check formatting
check-format:
@echo "Checking code formatting..."
cd rust_signer && cargo fmt -- --check
# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
cd rust_signer && cargo clean
rm -rf **/__pycache__
rm -f *.so *.dylib *.dll
# Install (copy binaries to system)
install: release
@echo "Installing binaries..."
@echo "Note: This requires appropriate permissions"
install -m 755 rust_signer/target/release/solana-signer /usr/local/bin/ || \
echo "Failed to install. Try: sudo make install"
# Development workflow
dev: format lint test
@echo "✓ Development checks passed!"
# CI workflow
ci: check-format lint test
@echo "✓ CI checks passed!"
# Help
help:
@echo "Solana Secure Signer - Build Commands"
@echo ""
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@echo " build - Build in debug mode"
@echo " release - Build optimized release version"
@echo " test - Run all tests (Rust + Python)"
@echo " coverage - Generate test coverage report"
@echo " lint - Run clippy linter"
@echo " format - Format code with rustfmt"
@echo " check-format - Check if code is formatted"
@echo " clean - Remove build artifacts"
@echo " install - Install binaries to /usr/local/bin"
@echo " dev - Format, lint, and test (development workflow)"
@echo " ci - Check format, lint, and test (CI workflow)"
@echo " help - Show this help message"