Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
98 lines (82 loc) · 2.78 KB
/
Copy pathMakefile
File metadata and controls
98 lines (82 loc) · 2.78 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
92
93
94
95
96
97
98
# Makefile for fls - ARM64 static builds
.PHONY: all build clean test arm64-static remote-wh remote-wh-native lint fmt clippy check help
# Default target
all: build
# Build for native target
build:
cargo build --release
# Build for ARM64 static (musl) using cross
arm64-static:
rustup target add aarch64-unknown-linux-musl
cross build --release --target aarch64-unknown-linux-musl
@if [ -f "target/aarch64-unknown-linux-musl/release/fls" ]; then \
cp "target/aarch64-unknown-linux-musl/release/fls" "fls-arm64-static"; \
echo "✓ ARM64 static binary saved as: fls-arm64-static"; \
file fls-arm64-static; \
ls -lh fls-arm64-static; \
fi
# Build for all targets (native + ARM64 static)
all-targets:
./build.sh
# Build the remote write head (fls/remote) for QNX aarch64
remote-wh:
$(MAKE) -C remote
# Build the remote write head for the host (native)
remote-wh-native:
$(MAKE) -C remote native
# Run tests
test:
cargo test
# Run all lints (format check + clippy)
lint: fmt-check clippy
# Check code formatting
fmt-check:
@echo "Checking code formatting..."
cargo fmt -- --check
# Format code
fmt:
@echo "Formatting code..."
cargo fmt
# Run clippy linter
clippy:
@echo "Running clippy..."
cargo clippy --all-targets --all-features -- -D warnings
# Run cargo check (quick compile check)
check:
@echo "Running cargo check..."
cargo check --all-targets
# Clean build artifacts
clean:
cargo clean
rm -f fls-*
$(MAKE) -C remote clean
# Install dependencies for ARM64 cross-compilation
install-deps:
@echo "Installing cross for cross-compilation..."
cargo install cross
@echo "Make sure Podman is installed and running:"
@echo " macOS: brew install podman"
@echo " Then run: podman machine init && podman machine start"
# Show help
help:
@echo "Available targets:"
@echo ""
@echo "Build targets:"
@echo " build - Build for native target"
@echo " arm64-static - Build for ARM64 static (musl)"
@echo " all-targets - Build for native + ARM64 static"
@echo " remote-wh - Build the remote write head for QNX aarch64"
@echo " remote-wh-native - Build the remote write head for the host"
@echo ""
@echo "Testing and Quality:"
@echo " test - Run tests"
@echo " lint - Run all lints (format check + clippy)"
@echo " fmt - Format code with rustfmt"
@echo " fmt-check - Check code formatting without modifying files"
@echo " clippy - Run clippy linter"
@echo " check - Quick compile check"
@echo ""
@echo "Maintenance:"
@echo " clean - Clean build artifacts"
@echo " install-deps - Install cross-compilation dependencies"
@echo " help - Show this help"