-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
67 lines (52 loc) · 1.91 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
SHELL := /bin/bash
ligo_compiler?=docker run --rm -v "$(PWD)":"$(PWD)" -w "$(PWD)" ligolang/ligo:0.57.0
# ^ Override this variable when you run make command by make <COMMAND> ligo_compiler=<LIGO_EXECUTABLE>
# ^ Otherwise use default one (you'll need docker)
PROTOCOL_OPT?=
project_root=--project-root .
# ^ required when using packages
help:
@grep -E '^[ a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
compile = $(ligo_compiler) compile contract $(project_root) ./src/$(1) -o ./compiled/$(2) $(3) $(PROTOCOL_OPT)
# ^ compile contract to michelson or micheline
test = $(ligo_compiler) run test $(project_root) ./test/$(1) $(PROTOCOL_OPT)
# ^ run given test file
compile: ## compile contracts
@if [ ! -d ./compiled ]; then mkdir ./compiled ; fi
@echo "Compiling contracts..."
@$(call compile,main.jsligo,taco_shop_token.tz)
@$(call compile,main.jsligo,taco_shop_token.json,--michelson-format json)
@echo "Compiled contracts!"
clean: ## clean up
@rm -rf compiled
deploy: deploy_deps deploy.js
deploy.js:
@if [ ! -f ./deploy/metadata.json ]; then cp deploy/metadata.json.dist deploy/metadata.json ; fi
@echo "Running deploy script\n"
@cd deploy && npm start
deploy_deps:
@echo "Installing deploy script dependencies"
@cd deploy && npm install
@echo ""
install: ## install dependencies
@$(ligo_compiler) install
.PHONY: test
test: ## run tests (SUITE=permit make test)
ifndef SUITE
@$(call test,permit.test.jsligo)
@$(call test,set_expiry.test.jsligo)
@$(call test,set_admin.test.jsligo)
@$(call test,transfer.test.jsligo)
@$(call test,create_token.test.jsligo)
@$(call test,mint_token.test.jsligo)
@$(call test,burn_token.test.jsligo)
else
@$(call test,$(SUITE).test.mligo)
endif
lint: ## lint code
@npx eslint ./scripts --ext .ts
sandbox-start: ## start sandbox
@./scripts/run-sandbox
sandbox-stop: ## stop sandbox
@docker stop sandbox