File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 11# OpenMina Makefile
22
3+ NIGHTLY_RUST_VERSION = "nightly"
4+
35.PHONY : help
46help : # # Ask for help!
57 @grep -E ' ^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@@ -62,6 +64,25 @@ format: ## Format code using rustfmt
6264lint : # # Run linter (clippy)
6365 cargo clippy --all-targets -- -D warnings --allow clippy::mutable_key_type
6466
67+ .PHONY : setup-wasm-toolchain
68+ setup-wasm-toolchain : # # Setup the WebAssembly toolchain, using nightly
69+ @ARCH=$$(uname -m ) ; \
70+ OS=$$(uname -s | tr A-Z a-z ) ; \
71+ case $$ OS in \
72+ linux) OS_PART=" unknown-linux-gnu" ;; \
73+ darwin) OS_PART=" apple-darwin" ;; \
74+ * ) echo " Unsupported OS: $$ OS" && exit 1 ;; \
75+ esac ; \
76+ case $$ ARCH in \
77+ x86_64) ARCH_PART=" x86_64" ;; \
78+ aarch64) ARCH_PART=" aarch64" ;; \
79+ arm64) ARCH_PART=" aarch64" ;; \
80+ * ) echo " Unsupported architecture: $$ ARCH" && exit 1 ;; \
81+ esac ; \
82+ TARGET=" $$ ARCH_PART-$$ OS_PART" ; \
83+ echo " Installing rust-src and rustfmt for ${NIGHTLY_RUST_VERSION} -$$ TARGET with wasm32 target" ; \
84+ rustup target add wasm32-unknown-unknown --toolchain ${NIGHTLY_RUST_VERSION} -$$ TARGET
85+
6586.PHONY : test
6687test : # # Run tests
6788 cargo test
You can’t perform that action at this time.
0 commit comments