-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
99 lines (82 loc) · 2.83 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
.PHONY: build setup run-profile run test run-hdp format-cairo run-pie get-program-hash clean ci-local test-full fuzz-tx fuzz-header
# Variables
VENV_PATH ?= venv
BUILD_DIR := build/compiled_cairo_files
CAIRO_FILES := $(shell find ./tests/cairo_programs -name "*.cairo")
# Build Targets
build: clean
@echo "Building project..."
./tools/make/build.sh
@echo "Build complete."
# Setup environment
setup:
@echo "Setting up the environment..."
./tools/make/setup.sh $(VENV_PATH)
@echo "Setup complete."
# Run and Test Targets
run-profile:
@echo "Selecting, compiling, running, and profiling a Cairo file..."
./tools/make/launch_cairo_files.py -profile
@echo "Profile run complete."
run:
@echo "Selecting, compiling, and running a Cairo file..."
@echo "Total number of steps will be shown at the end of the run."
./tools/make/launch_cairo_files.py
@echo "Run complete."
test:
@echo "Running all tests in tests/cairo_programs..."
./tools/make/launch_cairo_files.py -test
@echo "All tests completed."
run-hdp:
@echo "Compiling and running HDP..."
@echo "Total number of steps will be shown at the end of the run."
./tools/make/launch_cairo_files.py -run_hdp
@echo "HDP run complete."
contract-dry-run:
@echo "Compiling and running HDP..."
@echo "Total number of steps will be shown at the end of the run."
./tools/make/launch_cairo_files.py -contract_dry_run
@echo "HDP run complete."
format-cairo:
@echo "Formatting all .cairo files..."
./tools/make/format_cairo_files.sh
@echo "Formatting complete."
run-pie:
@echo "Selecting, compiling, and running a Cairo file..."
@echo "Outputting a Cairo PIE object."
@echo "Total number of steps will be shown at the end of the run."
./tools/make/launch_cairo_files.py -pie
@echo "Run PIE complete."
get-program-hash:
@echo "Getting hdp.cairo program's hash..."
cairo-compile --cairo_path="packages/eth_essentials" "src/hdp.cairo" --output $(BUILD_DIR)/hdp.json
cairo-hash-program --program $(BUILD_DIR)/hdp.json
@echo "Program hash retrieved."
# Cleanup Target
clean:
@echo "Cleaning up build artifacts..."
rm -rf $(BUILD_DIR)
mkdir -p $(BUILD_DIR)
@echo "Cleanup complete."
# CI and Testing Targets
ci-local:
@echo "Running CI locally..."
./tools/make/ci_local.sh
@echo "CI local run complete."
test-full:
@echo "Running full tests..."
./tools/make/cairo_tests.sh
@echo "Full tests complete."
# Fuzzing Targets
fuzz-tx:
@echo "Fuzz testing tx_decode.cairo..."
./tools/make/fuzzer.sh tests/fuzzing/tx_decode.cairo
@echo "Fuzz testing tx_decode.cairo complete."
fuzz-header:
@echo "Fuzz testing header_decode.cairo..."
./tools/make/fuzzer.sh tests/fuzzing/header_decode.cairo
@echo "Fuzz testing header_decode.cairo complete."
fuzz-receipt:
@echo "Fuzz testing receipt_decode.cairo..."
./tools/make/fuzzer.sh tests/fuzzing/receipt_decode.cairo
@echo "Fuzz testing receipt_decode.cairo complete."