-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
109 lines (94 loc) · 2.94 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
# Makefile for Teia Smart Contracts
#
# Usage example:
#
# TARGET=daoToken make compile test
#
# Location of SmartPy CLI
ifeq ($(SMARTPY_DIR),)
SMARTPY_DIR:=~/smartpy-cli
endif
SMARTPY:=${SMARTPY_DIR}/SmartPy.sh
SHELL:=bash
DEFAULT_TARGET:=multisigWallet_v1
# TARGET, if none is given in the environment
ifeq ($(TARGET),)
TARGET:=${DEFAULT_TARGET}
endif
# The environment variable TEIA_SC_PARAMS holds flags separated by ':' which
# can be used to control metadata and test features. Leaving this blank should
# cause contracts to run without the teia_sc package. This should not affect
# the smart contract Michelson code output. It may however affect metadata.
# Typical use:
# 'tzip16_error_inline' - turns on in-contract error script
# 'tzip16_error_lint' - turns on additional tests and lint report for tzip16 errors
ifeq ($(TEIA_SC_PARAMS),)
export TEIA_SC_PARAMS:=tzip16_error_inline:tzip16_error_lint
endif
export PYTHONPATH:=.:$(PYTHONPATH)
# Contracts source
SC_SRC_DIR:=$(realpath ./python/contracts)
# Contracts test source
SC_TEST_DIR:=$(realpath ./python/tests)
# Output directory, absolute path
SC_OUT_DIR:=$(realpath ./output)
# Compile and test working directory
COMPILE_DIR:=$(realpath ./python)
define COMPILE
cd ${COMPILE_DIR}; ${SMARTPY} compile ${SC_SRC_DIR}/$(strip $1).py ${SC_OUT_DIR}/contracts/$(strip $1) --purge --html
endef
define TEST
cd ${COMPILE_DIR}; ${SMARTPY} test ${SC_TEST_DIR}/$(strip $1)_test.py ${SC_OUT_DIR}/tests/$(strip $1) --purge --html
endef
## Compile the TARGET contract
# Usage example (bash): "TARGET=xyzContract make compile;"
compile:
$(call COMPILE, ${TARGET})
## Execute tests on TARGET contract
test:
$(call TEST, ${TARGET})
compile_all:
$(call COMPILE, teiaMarketplace_v1)
$(call COMPILE, multisigWallet_v1)
$(call COMPILE, fa12)
$(call COMPILE, fa2)
$(call COMPILE, minter)
$(call COMPILE, marketplace)
$(call COMPILE, artistsCollaboration)
$(call COMPILE, daoToken)
$(call COMPILE, daoTokenDrop)
$(call COMPILE, daoTreasury)
$(call COMPILE, daoGovernance)
$(call COMPILE, representatives)
$(call COMPILE, daoMultisig)
$(call COMPILE, coreTeamVote)
$(call COMPILE, teiaPolls)
$(call COMPILE, harbergerToken)
$(call COMPILE, harbergerFee)
$(call COMPILE, harbergerMinter)
$(call COMPILE, subscriptionToken)
$(call COMPILE, subscriptionFee)
$(call COMPILE, subscriptionsMarketplace)
$(call COMPILE, donations)
$(call COMPILE, openLetter)
$(call COMPILE, tezosPolls)
$(call COMPILE, deadMansSwitch)
$(call COMPILE, si_fa2)
$(call COMPILE, si_list)
test_all:
$(call TEST, teiaMarketplace_v1)
$(call TEST, multisigWallet_v1)
$(call TEST, fa2)
$(call TEST, minter)
$(call TEST, marketplace)
$(call TEST, artistsCollaboration)
$(call TEST, daoToken)
$(call TEST, daoTokenDrop)
$(call TEST, daoTreasury)
$(call TEST, daoGovernance)
$(call TEST, representatives)
$(call TEST, daoMultisig)
$(call TEST, teiaPolls)
$(call TEST, deadMansSwitch)
$(call TEST, si_fa2)
$(call TEST, si_list)