1- .PHONY : all build test fmt clean run check lint help parse validate emit-js emit-html coverage
1+ .PHONY : all build test fmt clean run check lint help parse validate emit-js emit-html coverage minimal
2+
3+ CARGO_FLAGS ?=
24
35# Default target
46all : build
57
68# Build the project
79build :
8- cargo build
10+ cargo build $(CARGO_FLAGS )
11+
12+ # Build with --no-default-features
13+ minimal :
14+ cargo build --no-default-features
915
1016# Build with release optimizations
1117release :
12- cargo build --release
18+ cargo build --release $( CARGO_FLAGS )
1319
1420# Run all tests
1521test :
16- cargo test
22+ cargo test $( CARGO_FLAGS )
1723
1824# Run tests with output
1925test-verbose :
20- cargo test -- --nocapture
26+ cargo test $( CARGO_FLAGS ) -- --nocapture
2127
2228# Format code
2329fmt :
@@ -29,37 +35,37 @@ fmt-check:
2935
3036# Run clippy linter
3137lint :
32- cargo clippy -- -D warnings
38+ cargo clippy $( CARGO_FLAGS ) -- -D warnings
3339
3440# Quick compile check without building
3541check :
36- cargo check
42+ cargo check $( CARGO_FLAGS )
3743
3844# Clean build artifacts
3945clean :
4046 cargo clean
4147
4248# Run the CLI tool (parse example)
4349run :
44- cargo run --bin webnn-graph -- parse examples/resnet_head.webnn
50+ cargo run $( CARGO_FLAGS ) --bin webnn-graph -- parse examples/resnet_head.webnn
4551
4652# Parse example graph
4753parse :
48- cargo run --bin webnn-graph -- parse examples/resnet_head.webnn
54+ cargo run $( CARGO_FLAGS ) --bin webnn-graph -- parse examples/resnet_head.webnn
4955
5056# Validate example graph
5157validate :
52- cargo run --bin webnn-graph -- parse examples/resnet_head.webnn > /tmp/graph.json && \
53- cargo run --bin webnn-graph -- validate /tmp/graph.json --weights-manifest examples/weights.manifest.json
58+ cargo run $( CARGO_FLAGS ) --bin webnn-graph -- parse examples/resnet_head.webnn > /tmp/graph.json && \
59+ cargo run $( CARGO_FLAGS ) --bin webnn-graph -- validate /tmp/graph.json --weights-manifest examples/weights.manifest.json
5460
5561# Emit JavaScript for example graph
5662emit-js :
57- cargo run --bin webnn-graph -- parse examples/resnet_head.webnn > /tmp/graph.json && \
58- cargo run --bin webnn-graph -- emit-js /tmp/graph.json
63+ cargo run $( CARGO_FLAGS ) --bin webnn-graph -- parse examples/resnet_head.webnn > /tmp/graph.json && \
64+ cargo run $( CARGO_FLAGS ) --bin webnn-graph -- emit-js /tmp/graph.json
5965
6066# Generate HTML visualizer for example graph
6167emit-html :
62- cargo run --bin webnn-graph -- emit-html examples/resnet_head.webnn > /tmp/webnn_viz.html
68+ cargo run $( CARGO_FLAGS ) --bin webnn-graph -- emit-html examples/resnet_head.webnn > /tmp/webnn_viz.html
6369 @echo " Visualizer generated: /tmp/webnn_viz.html"
6470 @echo " Open it with: open /tmp/webnn_viz.html"
6571
0 commit comments