-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
111 lines (90 loc) · 4.34 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
100
101
102
103
104
105
106
107
108
109
110
111
SHELL := /bin/bash
help:
@grep -E '^[ a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
ifndef LIGO
LIGO=docker run --platform linux/amd64 -u $(id -u):$(id -g) --rm -v "$(PWD)":"$(PWD)" -w "$(PWD)" ligolang/ligo:0.68.0
endif
# ^ use LIGO en var bin if configured, otherwise use docker
compile = $(LIGO) compile contract --project-root ./lib ./lib/$(1) -o ./compiled/$(2) $(3)
# ^ Compile contracts to Michelson or Micheline
test = @$(LIGO) run test $(project_root) ./test/$(1)
# ^ run given test file
.PHONY: test compile
install:
@$(LIGO) install
compile: ## compile contracts to Michelson
@mkdir -p compiled
@$(call compile,../test/dex/main_fa2_fa12.mligo,main_fa2_fa12.tz,)
@$(call compile,../test/dex/main_fa2_fa12.mligo,main_fa2_fa12.json,--michelson-format json)
@$(call compile,../test/dex/main_fa2_fa2.mligo,main_fa2_fa2.tz,)
@$(call compile,../test/dex/main_fa2_fa2.mligo,main_fa2_fa2.json,--michelson-format json)
@$(call compile,../test/dex/main_fa2_ctez.mligo,main_fa2_ctez.tz,)
@$(call compile,../test/dex/main_fa2_ctez.mligo,main_fa2_ctez.json,--michelson-format json)
@$(call compile,../test/dex/main_fa12_fa12.mligo,main_fa12_fa12.tz,)
@$(call compile,../test/dex/main_fa12_fa12.mligo,main_fa12_fa12.json,--michelson-format json)
@$(call compile,../test/dex/main_fa12_fa2.mligo,main_fa12_fa2.tz,)
@$(call compile,../test/dex/main_fa12_fa2.mligo,main_fa12_fa2.json,--michelson-format json)
@$(call compile,../test/dex/main_fa12_ctez.mligo,main_fa12_ctez.tz,)
@$(call compile,../test/dex/main_fa12_ctez.mligo,main_fa12_ctez.json,--michelson-format json)
test: test-ligo-cfmm ## run CFMM LIGO tests
##@Contracts - Run CFMM LIGO tests
## For example :
## make test-ligo FILE=set_position_fa12_fa12
## make test-ligo CONFIG=fa12_fa12
test-ligo-cfmm:
ifdef FILE
@$(call test,cfmm/$(FILE).test.mligo)
else ifdef CONFIG
@$(call test,cfmm/set_position_$(CONFIG).test.mligo)
@$(call test,cfmm/update_position_$(CONFIG).test.mligo)
@$(call test,cfmm/x_to_y_$(CONFIG).test.mligo)
@$(call test,cfmm/y_to_x_$(CONFIG).test.mligo)
@$(call test,cfmm/complex_position_$(CONFIG).test.mligo)
else
@$(call test,cfmm/twap_fa2_fa2.test.mligo)
@$(call test,cfmm/set_position_fa2_fa2.test.mligo)
@$(call test,cfmm/update_position_fa2_fa2.test.mligo)
@$(call test,cfmm/x_to_y_fa2_fa2.test.mligo)
@$(call test,cfmm/y_to_x_fa2_fa2.test.mligo)
@$(call test,cfmm/complex_position_fa2_fa2.test.mligo)
@$(call test,cfmm/set_position_fa12_fa12.test.mligo)
@$(call test,cfmm/update_position_fa12_fa12.test.mligo)
@$(call test,cfmm/x_to_y_fa12_fa12.test.mligo)
@$(call test,cfmm/y_to_x_fa12_fa12.test.mligo)
@$(call test,cfmm/complex_position_fa12_fa12.test.mligo)
@$(call test,cfmm/set_position_fa2_fa12.test.mligo)
@$(call test,cfmm/update_position_fa2_fa12.test.mligo)
@$(call test,cfmm/x_to_y_fa2_fa12.test.mligo)
@$(call test,cfmm/y_to_x_fa2_fa12.test.mligo)
@$(call test,cfmm/complex_position_fa2_fa12.test.mligo)
@$(call test,cfmm/set_position_fa12_fa2.test.mligo)
@$(call test,cfmm/update_position_fa12_fa2.test.mligo)
@$(call test,cfmm/x_to_y_fa12_fa2.test.mligo)
@$(call test,cfmm/y_to_x_fa12_fa2.test.mligo)
@$(call test,cfmm/complex_position_fa12_fa2.test.mligo)
@$(call test,cfmm/set_position_fa2_ctez.test.mligo)
@$(call test,cfmm/update_position_fa2_ctez.test.mligo)
@$(call test,cfmm/x_to_y_fa2_ctez.test.mligo)
@$(call test,cfmm/y_to_x_fa2_ctez.test.mligo)
@$(call test,cfmm/complex_position_fa2_ctez.test.mligo)
@$(call test,cfmm/set_position_fa12_ctez.test.mligo)
@$(call test,cfmm/update_position_fa12_ctez.test.mligo)
@$(call test,cfmm/x_to_y_fa12_ctez.test.mligo)
@$(call test,cfmm/y_to_x_fa12_ctez.test.mligo)
@$(call test,cfmm/complex_position_fa12_ctez.test.mligo)
@$(call test,cfmm/set_position_sft_fa2.test.mligo)
@$(call test,cfmm/update_position_sft_fa2.test.mligo)
@$(call test,cfmm/x_to_y_sft_fa2.test.mligo)
@$(call test,cfmm/y_to_x_sft_fa2.test.mligo)
@$(call test,cfmm/complex_position_sft_fa2.test.mligo)
@$(call test,cfmm/set_position_sft_fa12.test.mligo)
@$(call test,cfmm/update_position_sft_fa12.test.mligo)
@$(call test,cfmm/x_to_y_sft_fa12.test.mligo)
@$(call test,cfmm/y_to_x_sft_fa12.test.mligo)
@$(call test,cfmm/complex_position_sft_fa12.test.mligo)
endif
login:
@$(LIGO) login
publish: ## publish package on packages.ligolang.org
@$(LIGO) publish