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}'
@@ -90,6 +92,25 @@ format-md: ## Format all markdown files to wrap at 80 characters
9092lint : # # Run linter (clippy)
9193 cargo clippy --all-targets -- -D warnings --allow clippy::mutable_key_type
9294
95+ .PHONY : setup-wasm-toolchain
96+ setup-wasm-toolchain : # # Setup the WebAssembly toolchain, using nightly
97+ @ARCH=$$(uname -m ) ; \
98+ OS=$$(uname -s | tr A-Z a-z ) ; \
99+ case $$ OS in \
100+ linux) OS_PART=" unknown-linux-gnu" ;; \
101+ darwin) OS_PART=" apple-darwin" ;; \
102+ * ) echo " Unsupported OS: $$ OS" && exit 1 ;; \
103+ esac ; \
104+ case $$ ARCH in \
105+ x86_64) ARCH_PART=" x86_64" ;; \
106+ aarch64) ARCH_PART=" aarch64" ;; \
107+ arm64) ARCH_PART=" aarch64" ;; \
108+ * ) echo " Unsupported architecture: $$ ARCH" && exit 1 ;; \
109+ esac ; \
110+ TARGET=" $$ ARCH_PART-$$ OS_PART" ; \
111+ echo " Installing rust-src and rustfmt for ${NIGHTLY_RUST_VERSION} -$$ TARGET with wasm32 target" ; \
112+ rustup target add wasm32-unknown-unknown --toolchain ${NIGHTLY_RUST_VERSION} -$$ TARGET
113+
93114.PHONY : test
94115test : # # Run tests
95116 cargo test
You can’t perform that action at this time.
0 commit comments