-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
78 lines (60 loc) · 2.66 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
ligo_compiler?=docker run --rm -v "$(PWD)":"$(PWD)" -w "$(PWD)" ligolang/ligo:stable
# ^ Override this variable when you run make command by make <COMMAND> ligo_compiler=<LIGO_EXECUTABLE>
# ^ Otherwise use default one (you'll need docker)
PROJECTROOT_OPT=--project-root .
protocol_opt?=
JSON_OPT?=--michelson-format json
tsc=npx tsc
help:
@echo 'Usage:'
@echo ' all - Remove generated Michelson files, recompile smart contracts and lauch all tests'
@echo ' clean - Remove generated Michelson files'
@echo ' compile - Compiles smart contract Factory'
@echo ' test - Run integration tests (written in Ligo)'
@echo ' deploy - Deploy smart contracts advisor & indice (typescript using Taquito)'
@echo ''
all: clean compile test
compile: fa2_nft.tz factory marketplace_nft.tz
factory: factory.tz factory.json
factory.tz: src/main.jsligo
@echo "Compiling smart contract to Michelson"
@mkdir -p compiled
@$(ligo_compiler) compile contract $^ $(protocol_opt) $(PROJECTROOT_OPT) > compiled/$@
factory.json: src/main.jsligo
@echo "Compiling smart contract to Michelson in JSON format"
@mkdir -p compiled
@$(ligo_compiler) compile contract $^ $(JSON_OPT) $(protocol_opt) $(PROJECTROOT_OPT) > compiled/$@
fa2_nft.tz: src/generic_fa2/core/instance/NFT.mligo
@echo "Compiling smart contract FA2 to Michelson"
@mkdir -p src/generic_fa2/compiled
@$(ligo_compiler) compile contract $^ $(protocol_opt) $(PROJECTROOT_OPT) > src/generic_fa2/compiled/$@
marketplace_nft.tz: src/marketplace/main.jsligo
@echo "Compiling smart contract Marketplace to Michelson"
@mkdir -p src/marketplace/compiled
@$(ligo_compiler) compile contract $^ $(protocol_opt) $(PROJECTROOT_OPT) > src/marketplace/compiled/$@
clean: clean_contracts clean_fa2 clean_marketplace
clean_contracts:
@echo "Removing Michelson files"
@rm -f compiled/*.tz compiled/*.json
clean_fa2:
@echo "Removing FA2 Michelson file"
@rm -f src/generic_fa2/compiled/*.tz
clean_marketplace:
@echo "Removing Marketplace Michelson file"
@rm -f src/marketplace/compiled/*.tz
test: test_ligo test_marketplace
test_ligo: test/test.jsligo
@echo "Running integration tests"
@$(ligo_compiler) run test $^ $(protocol_opt) $(PROJECTROOT_OPT)
test_marketplace: test/test_marketplace.jsligo
@echo "Running integration tests (marketplace)"
@$(ligo_compiler) run test $^ $(protocol_opt) $(PROJECTROOT_OPT)
deploy: node_modules 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
node_modules:
@echo "Installing deploy script dependencies"
@cd deploy && npm install
@echo ""