From 07b0d596c16bd1bee81987922f663c2fa86b1758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Garay?= Date: Mon, 9 Oct 2023 16:58:42 -0300 Subject: [PATCH 1/2] Added a usage target to makefile --- Makefile | 23 +++++++++++++++++++---- README.md | 2 ++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 2d90d94cf..beca6849a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: build check clean clippy compile-cairo compile-starknet compile-cairo-1-casm compile-cairo-1-sierra \ +.PHONY: usage build check clean clippy compile-cairo compile-starknet compile-cairo-1-casm compile-cairo-1-sierra \ compile-cairo-2-casm compile-cairo-2-sierra coverage deps test heaptrack check-python-version export PATH:=$(shell pyenv root)/shims:$(PATH) @@ -10,7 +10,6 @@ ifeq ($(OS), Darwin) export LDFLAGS += -L/opt/homebrew/opt/gmp/lib endif - CAIRO_SOURCES=$(wildcard cairo_programs/*.cairo) CAIRO_TARGETS=$(patsubst %.cairo,%.json,$(CAIRO_SOURCES)) CAIRO_ABI_TARGETS=$(patsubst %.cairo,%_abi.json,$(CAIRO_SOURCES)) @@ -28,6 +27,24 @@ STARKNET_SIERRA_COMPILE_CAIRO_1:=cairo1/bin/starknet-sierra-compile STARKNET_COMPILE_CAIRO_2:=cairo2/bin/starknet-compile STARKNET_SIERRA_COMPILE_CAIRO_2:=cairo2/bin/starknet-sierra-compile +usage: + @echo 'Usage:' + @echo ' build: Builds the Rust code' + @echo ' check: Runs cargo check' + @echo ' deps: Installs dependencies' + @echo ' deps-macos: Installs depedencies for MacOS' + @echo ' clean: Cleans all build artifacts' + @echo ' clippy: Runs clippy' + @echo ' test: Runs all tests' + @echo ' test-cairo-1: Runs the Cairo 1 tests' + @echo ' test-cairo-2: Runs the Cairo 2 tests' + @echo ' test-doctests: Runs the doctests' + @echo ' coverage: Runs everything necessary to generate the coverate report' + @echo ' coverage-report: Just generates the coverage report' + @echo ' heaptrack: Runs the heaptrack script' + @echo ' flamegraph: Runs cargo flamegraph' + @echo ' benchmark: Runs the benchmarks scripts' + # # VENV rules. # @@ -106,7 +123,6 @@ $(CAIRO_2_CONTRACTS_TEST_DIR)/%.casm: $(CAIRO_2_CONTRACTS_TEST_DIR)/%.sierra compile-cairo-2-sierra: $(CAIRO_2_COMPILED_SIERRA_CONTRACTS) compile-cairo-2-casm: $(CAIRO_2_COMPILED_CASM_CONTRACTS) - CAIRO_2_VERSION=2.0.1 cairo-repo-2-dir = cairo2 @@ -133,7 +149,6 @@ cairo-%-macos.tar: cairo-%.tar: curl -L -o "$@" "https://github.com/starkware-libs/cairo/releases/download/v$*/release-x86_64-unknown-linux-musl.tar.gz" - # ================= # Normal rules. # ================= diff --git a/README.md b/README.md index 18929226d..a4a7149cb 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ It makes use of [cairo-vm](https://github.com/lambdaclass/cairo-vm), the Rust im ### Installation +If you run `make` on it's own it will print out the main targets and their description. + Run the following make targets to have a working environment (if in Mac or if you encounter an error, see the subsection below): #### Linux (x86-64) From 04601a8b74c6bfc1d314ed26d80a3246800e16e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Garay?= Date: Tue, 17 Oct 2023 11:49:52 -0300 Subject: [PATCH 2/2] Fixed typo --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index beca6849a..a6b0515b2 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ usage: @echo ' test-cairo-1: Runs the Cairo 1 tests' @echo ' test-cairo-2: Runs the Cairo 2 tests' @echo ' test-doctests: Runs the doctests' - @echo ' coverage: Runs everything necessary to generate the coverate report' + @echo ' coverage: Runs everything necessary to generate the coverage report' @echo ' coverage-report: Just generates the coverage report' @echo ' heaptrack: Runs the heaptrack script' @echo ' flamegraph: Runs cargo flamegraph'