-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (65 loc) · 1.64 KB
/
Makefile
File metadata and controls
79 lines (65 loc) · 1.64 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
# Variables
TARGET = wasm32-wasip1
RELEASE_TARGET = ./target/$(TARGET)/release/bless_plugins.wasm
DEBUG_TARGET = ./target/$(TARGET)/debug/bless_plugins.wasm
FINAL_WASM = bless_plugins.wasm
# Default target
.PHONY: all
all: build
# Build release version
.PHONY: build
build: $(FINAL_WASM)
$(FINAL_WASM): $(RELEASE_TARGET)
./javy init-plugin $< -o $@
$(RELEASE_TARGET):
cargo build --target=$(TARGET) --release
# Build debug version
.PHONY: debug
debug: $(DEBUG_TARGET)
javy init-plugin $< -o debug_$(FINAL_WASM)
$(DEBUG_TARGET):
cargo build --target=$(TARGET)
# Check code without building
.PHONY: check
check:
cargo check --target=$(TARGET)
# Run tests
.PHONY: test
test:
cargo test
# Format code
.PHONY: fmt
fmt:
cargo fmt
# Check formatting
.PHONY: fmt-check
fmt-check:
cargo fmt -- --check
# Run clippy lints
.PHONY: lint
lint:
cargo clippy --target=$(TARGET) -- -D warnings
# Clean build artifacts
.PHONY: clean
clean:
cargo clean
rm -f $(FINAL_WASM)
rm -f debug_$(FINAL_WASM)
# Install required tools
.PHONY: install-tools
install-tools:
rustup target add $(TARGET)
@echo "Please install javy-cli manually from: https://github.com/bytecodealliance/javy"
# Help target
.PHONY: help
help:
@echo "Available targets:"
@echo " build - Build release version (default)"
@echo " debug - Build debug version"
@echo " check - Check code without building"
@echo " test - Run tests"
@echo " fmt - Format code"
@echo " fmt-check - Check code formatting"
@echo " lint - Run clippy lints"
@echo " clean - Clean build artifacts"
@echo " install-tools - Install required tools (except javy-cli)"