-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (26 loc) · 958 Bytes
/
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
build_folder := _build
touch_done=@mkdir -p $(@D) && touch $@;
TESTS := $(filter-out %/__init__.py, $(wildcard smartpy/tests/*.py))
all:
@$(MAKE) -s install-smartpy
@$(MAKE) -s install-smartpy-utils
# <SmartPY>
smartpy/tests/%: smartpy/tests/%.py
@$(build_folder)/smartpy-cli/SmartPy.sh test $< smartpy/tests/baselines/$*
clean_tests:
@rm -rf smartpy/tests/baselines
test: install-smartpy-utils clean_tests $(TESTS:%.py=%)
@$(MAKE) -s test-smartpy
install-smartpy: $(build_folder)/install-smartpy
$(build_folder)/install-smartpy:
@rm -rf $(build_folder)/smartpy-cli
@bash -c "bash <(curl -s https://smartpy.io/cli/install.sh) --prefix $(build_folder)/smartpy-cli --yes"
$(touch_done)
install-smartpy-utils:
@cp smartpy/utils.py $(build_folder)/smartpy-cli/smartpy_utils.py
test-smartpy:
$(build_folder)/smartpy-cli/SmartPy.sh test smartpy/tests/utils.py smartpy/tests/baselines
# </SmartPY>
.PHONY: clean
clean:
@rm -rf $(build_folder)