forked from doublezerofoundation/doublezero-solana
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (51 loc) · 1.71 KB
/
Makefile
File metadata and controls
64 lines (51 loc) · 1.71 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
PASSPORT_PATH = programs/passport/Cargo.toml
REVENUE_DISTRIBUTION_PATH = programs/revenue-distribution/Cargo.toml
NETWORK ?= mainnet-beta
# Validate NETWORK parameter
ifneq ($(NETWORK),mainnet-beta)
ifneq ($(NETWORK),development)
$(error NETWORK must be either "mainnet-beta" or "development". Got "$(NETWORK)")
endif
endif
ifeq ($(NETWORK),mainnet-beta)
CARGO_FEATURES = entrypoint
else
CARGO_FEATURES = development,entrypoint
endif
.PHONY: clean
clean:
rm -rf artifacts-* test-ledger
cargo clean
.PHONY: build-sbf
build-sbf:
cargo build-sbf --features $(CARGO_FEATURES) --manifest-path $(PASSPORT_PATH)
cargo build-sbf --features $(CARGO_FEATURES) --manifest-path $(REVENUE_DISTRIBUTION_PATH)
artifacts-$(NETWORK):
DOCKER_BUILDKIT=1 docker build \
--build-arg NETWORK=${NETWORK} \
--platform linux/amd64 \
--output type=local,dest=./artifacts-${NETWORK} \
.
.PHONY: build-artifacts
build-artifacts: artifacts-$(NETWORK)
.PHONY: build-sbf-mock
build-sbf-mock:
cargo build-sbf --features $(CARGO_FEATURES) --manifest-path mock/swap-sol-2z/Cargo.toml
.PHONY: test-sbf
test-sbf: build-sbf-mock
cargo test-sbf --features $(CARGO_FEATURES) --manifest-path $(PASSPORT_PATH)
cargo test-sbf --features $(CARGO_FEATURES) --manifest-path $(REVENUE_DISTRIBUTION_PATH)
.PHONY: test-lib
test-lib:
cargo test --lib --features development,offchain
.PHONY: lint
lint:
cargo fmt --check
cargo clippy --all-features --all-targets -- -Dwarnings
.PHONY: doc
doc:
cargo doc --all-features --no-deps --document-private-items
.PHONY: write-checksums
write-checksums:
shasum -a 256 artifacts-mainnet-beta/*.so > programs/sha256sums_mainnet_beta.txt
shasum -a 256 artifacts-development/*.so > programs/sha256sums_development.txt