-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (28 loc) · 1.07 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
#!/usr/bin/make
cwd = $(shell pwd)
cluster = devnet
program = smart_converter
program_id = $(shell sed -n 's/^ *${program}.*=.*"\([^"]*\)".*/\1/p' Anchor.toml | head -1)
.DEFAULT_GOAL: help
help: ## Show this help
@printf "\033[33m%s:\033[0m\n" 'Available commands'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[32m%-18s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
# ----------------------------------------------------------------------------------------------------------------------
.PHONY: sdk
sdk: build ## Generate sdk
pnpm -F sdk generate
.PHONY: build
build: ## Build program
anchor build -p $(program) -t $(cwd)/packages/sdk/src/idl
.PHONY: deploy
deploy: build ## Deploy program
anchor deploy -p $(program) --provider.cluster $(cluster)
.PHONY:verify
verify:
anchor verify $(program_id) --provider.cluster $(cluster)
.PHONY: test
test: ## Test program
anchor test --skip-lint --provider.cluster localnet
.PHONY: upgrade
upgrade: build ## Upgrade program
anchor upgrade -p $(program_id) --provider.cluster $(cluster) ./target/deploy/$(program).so