2023-02-24 06:20:51 +00:00
|
|
|
.PHONY: all installdeps build test clean
|
2023-01-26 03:49:55 +00:00
|
|
|
|
2023-02-24 06:20:51 +00:00
|
|
|
all: .pre-build build
|
|
|
|
|
|
|
|
.fetch-submodules:
|
|
|
|
@git submodule update --init --recursive
|
2023-01-26 03:49:55 +00:00
|
|
|
|
2023-02-24 06:20:51 +00:00
|
|
|
.pre-build: .fetch-submodules
|
2023-03-14 12:14:06 +00:00
|
|
|
@cargo install cargo-make
|
|
|
|
ifdef CI
|
2023-07-04 06:40:35 +00:00
|
|
|
@cargo install cross --git https://github.com/cross-rs/cross.git --rev 1511a28
|
2023-01-26 03:49:55 +00:00
|
|
|
endif
|
|
|
|
|
2023-02-24 06:20:51 +00:00
|
|
|
installdeps: .pre-build
|
2023-03-24 04:00:48 +00:00
|
|
|
ifeq ($(shell uname),Darwin)
|
2024-04-30 10:14:33 +00:00
|
|
|
# commented due to https://github.com/orgs/Homebrew/discussions/4612
|
|
|
|
# @brew update
|
2023-03-24 04:00:48 +00:00
|
|
|
@brew install cmake ninja
|
|
|
|
else ifeq ($(shell uname),Linux)
|
|
|
|
@sudo apt-get update
|
|
|
|
@sudo apt-get install -y cmake ninja-build
|
|
|
|
endif
|
2024-04-30 10:14:33 +00:00
|
|
|
@git -C "wabt" pull || git clone --recursive https://github.com/WebAssembly/wabt.git "wabt"
|
|
|
|
@cd wabt && mkdir -p build && cd build && cmake .. -GNinja && ninja && sudo ninja install
|
|
|
|
@which wasm-pack || cargo install wasm-pack
|
|
|
|
# nvm already checks if it's installed, and no-ops if it is
|
|
|
|
@curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
|
|
|
@. ${HOME}/.nvm/nvm.sh && nvm install 18.20.2 && nvm use 18.20.2;
|
2023-02-24 06:20:51 +00:00
|
|
|
|
|
|
|
build: .pre-build
|
|
|
|
@cargo make build
|
|
|
|
|
2023-01-26 03:49:55 +00:00
|
|
|
test: .pre-build
|
|
|
|
@cargo make test
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@cargo clean
|