Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit c8e81be

Browse files
Add new deps-macos target (#751)
1 parent d5aaf0e commit c8e81be

File tree

1 file changed

+34
-8
lines changed

1 file changed

+34
-8
lines changed

Makefile

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ STARKNET_ABI_TARGETS=$(patsubst %.cairo,%_abi.json,$(STARKNET_SOURCES))
2121
BUILTIN_SOURCES=$(wildcard starknet_programs/*.cairo)
2222
BUILTIN_TARGETS=$(patsubst %.cairo,%.json,$(BUILTIN_SOURCES))
2323

24-
STARKNET_COMPILE_CAIRO_1:=cairo1/target/release/starknet-compile
25-
STARKNET_SIERRA_COMPILE_CAIRO_1:=cairo1/target/release/starknet-sierra-compile
24+
STARKNET_COMPILE_CAIRO_1:=cairo1/bin/starknet-compile
25+
STARKNET_SIERRA_COMPILE_CAIRO_1:=cairo1/bin/starknet-sierra-compile
2626

27-
STARKNET_COMPILE_CAIRO_2:=cairo2/target/release/starknet-compile
28-
STARKNET_SIERRA_COMPILE_CAIRO_2:=cairo2/target/release/starknet-sierra-compile
27+
STARKNET_COMPILE_CAIRO_2:=cairo2/bin/starknet-compile
28+
STARKNET_SIERRA_COMPILE_CAIRO_2:=cairo2/bin/starknet-sierra-compile
2929

3030
#
3131
# VENV rules.
@@ -74,12 +74,21 @@ $(CAIRO_1_CONTRACTS_TEST_DIR)/%.casm: $(CAIRO_1_CONTRACTS_TEST_DIR)/%.sierra
7474

7575

7676
cairo-repo-1-dir = cairo1
77+
cairo-repo-1-dir-macos = cairo1-macos
78+
79+
build-cairo-1-compiler-macos: | $(cairo-repo-1-dir-macos)
80+
81+
$(cairo-repo-1-dir-macos):
82+
curl -L -o cairo-1.1.1.tar https://github.com/starkware-libs/cairo/releases/download/v1.1.1/release-aarch64-apple-darwin.tar \
83+
&& tar -xzvf cairo-1.1.1.tar \
84+
&& mv cairo/ cairo1/
7785

7886
build-cairo-1-compiler: | $(cairo-repo-1-dir)
7987

8088
$(cairo-repo-1-dir):
81-
git clone --depth 1 -b v1.1.1 https://github.com/starkware-libs/cairo.git $(cairo-repo-1-dir)
82-
cd cairo1; cargo b --release --bin starknet-compile --bin starknet-sierra-compile
89+
curl -L -o cairo-1.1.1.tar https://github.com/starkware-libs/cairo/releases/download/v1.1.1/release-x86_64-unknown-linux-musl.tar.gz \
90+
&& tar -xzvf cairo-1.1.1.tar \
91+
&& mv cairo/ cairo1/
8392

8493
# ======================
8594
# Test Cairo 2 Contracts
@@ -98,12 +107,21 @@ $(CAIRO_2_CONTRACTS_TEST_DIR)/%.casm: $(CAIRO_2_CONTRACTS_TEST_DIR)/%.sierra
98107

99108

100109
cairo-repo-2-dir = cairo2
110+
cairo-repo-2-dir-macos = cairo2-macos
111+
112+
build-cairo-2-compiler-macos: | $(cairo-repo-2-dir-macos)
113+
114+
$(cairo-repo-2-dir-macos):
115+
curl -L -o cairo-2.0.0.tar https://github.com/starkware-libs/cairo/releases/download/v2.0.0-rc6/release-aarch64-apple-darwin.tar \
116+
&& tar -xzvf cairo-2.0.0.tar \
117+
&& mv cairo/ cairo2/
101118

102119
build-cairo-2-compiler: | $(cairo-repo-2-dir)
103120

104121
$(cairo-repo-2-dir):
105-
git clone --depth 1 -b v2.0.0-rc6 https://github.com/starkware-libs/cairo.git $(cairo-repo-2-dir)
106-
cd cairo2; cargo b --release --bin starknet-compile --bin starknet-sierra-compile
122+
curl -L -o cairo-2.0.0.tar https://github.com/starkware-libs/cairo/releases/download/v2.0.0-rc6/release-x86_64-unknown-linux-musl.tar.gz \
123+
&& tar -xzvf cairo-2.0.0.tar \
124+
&& mv cairo/ cairo2/
107125

108126

109127
# =================
@@ -122,6 +140,12 @@ deps: check-python-version build-cairo-2-compiler build-cairo-1-compiler
122140
python3.9 -m venv starknet-venv
123141
. starknet-venv/bin/activate && $(MAKE) deps-venv
124142

143+
deps-macos: check-python-version build-cairo-2-compiler-macos build-cairo-1-compiler-macos
144+
cargo install flamegraph --version 0.6.2
145+
cargo install cargo-llvm-cov --version 0.5.14
146+
python3.9 -m venv starknet-venv
147+
. starknet-venv/bin/activate && $(MAKE) deps-venv
148+
125149
clean:
126150
-rm -rf starknet-venv/
127151
-rm -f cairo_programs/*.json
@@ -135,6 +159,8 @@ clean:
135159
-rm -f tests/*.json
136160
-rm -rf cairo1/
137161
-rm -rf cairo2/
162+
-rm -rf cairo-2.0.0.tar
163+
-rm -rf cairo-1.1.1.tar
138164

139165
clippy: compile-cairo compile-starknet $(CAIRO_1_COMPILED_CASM_CONTRACTS) $(CAIRO_2_COMPILED_CASM_CONTRACTS)
140166
cargo clippy --all --all-targets -- -D warnings

0 commit comments

Comments
 (0)