forked from jito-foundation/restaking
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
85 lines (74 loc) · 1.86 KB
/
makefile
File metadata and controls
85 lines (74 loc) · 1.86 KB
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
# Makefile for Jito Restaking Project
# Commands
CARGO := cargo
CARGO_SORT := cargo sort
CARGO_CLIPPY := cargo clippy
CARGO_FMT := cargo +nightly fmt
CARGO_SBF := cargo-build-sbf
CARGO_NEXTEST := cargo nextest
YARN := yarn
SHANK_CLI := ./target/release/jito-shank-cli
# Environment and paths
ENV_PATH := ./config/program.env
IDL_OUTPUT_PATH := ./idl
# Default target
.PHONY: all
all: build test
# Linting
.PHONY: lint
lint:
$(CARGO_SORT) --workspace --check
$(CARGO_FMT) --all --check
$(CARGO_CLIPPY) --all-features -- -D warnings -D clippy::all -D clippy::nursery -D clippy::integer_division -D clippy::arithmetic_side_effects -D clippy::style -D clippy::perf
# Code generation
.PHONY: generate-code
generate-code: build-release generate-idl
$(YARN) install
$(YARN) generate-clients
$(YARN) update-dependencies
# Generate IDL files
.PHONY: generate-idl
generate-idl:
$(SHANK_CLI) \
--program-env-path $(ENV_PATH) \
--output-idl-path $(IDL_OUTPUT_PATH) \
generate \
--program-id-key "RESTAKING_PROGRAM_ID" \
--idl-name jito_restaking \
--module-paths "restaking_sdk" \
--module-paths "restaking_core" \
--module-paths "restaking_program" \
--module-paths "bytemuck" \
--module-paths "core"
$(SHANK_CLI) \
--program-env-path $(ENV_PATH) \
--output-idl-path $(IDL_OUTPUT_PATH) \
generate \
--program-id-key "VAULT_PROGRAM_ID" \
--idl-name jito_vault \
--module-paths "vault_sdk" \
--module-paths "vault_core" \
--module-paths "vault_program" \
--module-paths "bytemuck" \
--module-paths "core"
# Build debug
.PHONY: build
build:
$(CARGO) build
# Build release
.PHONY: build-release
build-release:
$(CARGO) build --release
# Build Solana BPF/SBF programs
.PHONY: build-sbf
build-sbf:
$(CARGO_SBF)
# Run tests
.PHONY: test
test:
$(CARGO_NEXTEST) run --all-features
# Format code
.PHONY: format
format:
$(CARGO_SORT) --workspace
$(CARGO_FMT) --all