-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (27 loc) · 781 Bytes
/
Copy pathMakefile
File metadata and controls
37 lines (27 loc) · 781 Bytes
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
PI := python
PI_MIN_VERSION := 3.10
PI_VERSION_OK=$(shell $(PI) -c 'import sys;print(int(float("%d.%d"% sys.version_info[0:2]) >= $(PI_MIN_VERSION)))')
ifeq ($(PI_VERSION_OK),0)
$(error "Need python $(PYTHON_VERSION) >= $(PI_MIN_VERSION)")
endif
VENV_PATH := venv
$(VENV_PATH):
python -m venv $@
install: requirements.txt $(VENV_PATH)
@export PI=$(word 2,$^)/bin/python
$(PI) -m pip install -r $<
run: install
@export PI=$(VENV_PATH)/bin/python
@if [ -z "$(FILE)" ]; then \
echo "Usage: make run FILE=path/to/your/file.ame"; \
else \
$(PI) amec.py $(FILE); \
fi
test1: install
$(PI) amec.py 'src/test/merge.ame'
test2: install
$(PI) amec.py 'src/test/primo.ame'
test3: install
$(PI) amec.py 'src/test/adivinha.ame'
tests: test1 test2 test3
all: install