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

Added a usage target to makefile #1069

Merged
merged 3 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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))
Expand All @@ -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 coverage 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.
#
Expand Down Expand Up @@ -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.2.0

cairo-repo-2-dir = cairo2
Expand All @@ -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.
# =================
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down