-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from lambdaclass/makefile
Adds Makefile and env.sh
- Loading branch information
Showing
4 changed files
with
118 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
debug/ | ||
target/ | ||
|
||
.env | ||
.envrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.PHONY: usage deps build check test clean | ||
|
||
UNAME := $(shell uname) | ||
|
||
usage: | ||
@echo "Usage:" | ||
@echo " deps: Installs the necesarry dependencies." | ||
@echo " build: Builds the crate." | ||
@echo " check: Checks format and lints." | ||
@echo " test: Runs all tests." | ||
@echo " clean: Cleans the built artifacts." | ||
|
||
build: | ||
cargo build --release | ||
# cargo build --release --all-features | ||
|
||
check: | ||
cargo fmt --all -- --check | ||
cargo clippy --all-targets -- -D warnings | ||
# cargo clippy --all-targets --all-features -- -D warnings | ||
|
||
test: | ||
cargo test | ||
# cargo test --profile ci --all-features | ||
|
||
clean: | ||
cargo clean | ||
|
||
deps: | ||
ifeq ($(UNAME), Darwin) | ||
deps: deps-macos | ||
endif | ||
deps: | ||
|
||
deps-macos: | ||
-brew install llvm@18 --quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/sh | ||
# | ||
# It sets the LLVM environment variables. | ||
# | ||
# You can copy this file to .envrc/.env and adapt it for your environment. | ||
|
||
case $(uname) in | ||
Darwin) | ||
# If installed with brew | ||
LLVM_SYS_181_PREFIX="$(brew --prefix llvm@18)" | ||
MLIR_SYS_180_PREFIX="$(brew --prefix llvm@18)" | ||
TABLEGEN_180_PREFIX="$(brew --prefix llvm@18)" | ||
|
||
export LLVM_SYS_181_PREFIX | ||
export MLIR_SYS_180_PREFIX | ||
export TABLEGEN_180_PREFIX | ||
;; | ||
Linux) | ||
# If installed from Debian/Ubuntu repository: | ||
LLVM_SYS_181_PREFIX=/usr/lib/llvm-18 | ||
MLIR_SYS_180_PREFIX=/usr/lib/llvm-18 | ||
TABLEGEN_180_PREFIX=/usr/lib/llvm-18 | ||
|
||
export LLVM_SYS_181_PREFIX | ||
export MLIR_SYS_180_PREFIX | ||
export TABLEGEN_180_PREFIX | ||
;; | ||
esac | ||
|
||
# export CAIRO_NATIVE_RUNTIME_LIBRARY= | ||
# export RPC_ENDPOINT_MAINNET= | ||
# export RPC_ENDPOINT_TESTNET= | ||
|
||
echo "loaded LLVM environment variables" | ||
echo "remember you must manually set:" | ||
echo "- RPC_ENDPOINT_MAINNET=rpc.endpoint.mainnet.com" | ||
echo "- RPC_ENDPOINT_TESTNET=rpc.endpoint.testnet.com" | ||
echo "- CAIRO_NATIVE_RUNTIME_LIBRARY=path/to/cairo_native/target/release/libcairo_native_runtime.a" |