-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (61 loc) · 2.27 KB
/
Makefile
File metadata and controls
74 lines (61 loc) · 2.27 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
all: run
run:
cargo run --release
dev:
cargo run
lint:
cargo fmt -- --check --color always
cargo clippy --all-targets --all-features -- -D warnings
test:
make lint
RUST_BACKTRACE=full cargo test --release
RUST_BACKTRACE=full cargo test --test integration_tests
# Run in a single thread is often useful to catch infinite loops early on
test-single-thread:
make lint
RUST_BACKTRACE=full cargo test --release -- --test-threads=1
RUST_BACKTRACE=full cargo test --test integration_tests -- --test-threads=1
test-if:
@echo "Building Flash for if/elif/else functionality tests..."
@cargo build --release
@echo "Running if/elif/else functionality tests..."
@./test_if_functionality.sh
test-case:
@echo "Building Flash for case/esac functionality tests..."
@cargo build --release
@echo "Running case/esac functionality tests..."
@./test_case_functionality.sh
test-all: test test-if test-case
@echo "All tests completed successfully!"
# WebAssembly demo targets
wasm-demo-build:
@echo "Building Flash WebAssembly Demo..."
@if ! command -v wasm-pack >/dev/null 2>&1; then \
echo "wasm-pack is not installed. Installing..."; \
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh; \
fi
@echo "Building WebAssembly module..."
@cd docs && wasm-pack build --release --target web --out-dir pkg
@echo "Removing wasm-pack generated .gitignore to allow committing WASM files..."
@rm -f docs/pkg/.gitignore
@echo "Build complete!"
@echo "WASM files can be committed directly to git."
wasm-demo-serve: wasm-demo-build
@echo "Starting Flash WebAssembly Demo server..."
@echo "Open http://localhost:8000 in your browser"
@echo "Press Ctrl+C to stop the server"
@echo ""
@if ! command -v cargo-server >/dev/null 2>&1; then \
echo "Installing cargo-server..."; \
cargo install cargo-server; \
fi
@cd docs && cargo server --port 8000
wasm-demo-clean:
@echo "Cleaning WebAssembly demo build artifacts..."
@rm -rf docs/pkg docs/target
wasm-demo-commit: wasm-demo-build
@echo "Adding WebAssembly demo files to git..."
@git add docs/pkg/
@echo "WebAssembly files added to git"
@echo "You can now commit with: git commit -m 'Add WebAssembly demo files'"
.PHONY: all run dev lint test test-if test-case test-all wasm-demo-build wasm-demo-serve wasm-demo-clean wasm-demo-commit