-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (46 loc) · 1.2 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
SHELL = bash
.SHELLFLAGS := -eu -o pipefail -c
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
# -----------------------------------------------------------------------------
# Section: Python
VENV = source venv/bin/activate &&
PY = ${VENV} python3
venv: pyproject.toml ## establish a virtual environment for python
python3 -m venv venv && \
${PY} -m pip install --upgrade pip
${PY} -m pip install pytest
touch venv pyproject.toml
.PHONY: install
install: .installed
.installed: venv pyproject.toml
${PY} -m pip install -e .
touch .installed
run: install
${VENV} auxml \
--macros ./examples/macro-definitions/example1.xml \
--infile ./examples/auxml-src/example1.xml \
--build-dir /tmp/testout
webpage: install
${VENV} auxml \
--macros ./examples/macro-definitions/webpage-macros.xml \
--infile ./examples/auxml-src/webpage.xml \
--build-dir /tmp/webpage
.PHONY: reinstall
reinstall:
${PY} -m pip install -e .
.PHONY: test
test: venv install
${PY} -m pytest -s
.PHONY: watch
watch: venv install
${VENV} ptw .
.PHONY: clean-python
clean-python:
py3clean .
.PHONY: clean-venv
clean-venv:
rm -rf venv
.PHONY: clean-all
clean-all: clean-python clean-venv
rm .installed