-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
54 lines (43 loc) · 1.17 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
PYTHON := python3
PY_APP := pycg/app.py
PY_SRC := pycg
PY_SOURCES := $(wildcard $(PY_SRC)/*.py)
# Requires PySide2's Qt UI Compiler
QT_COMPILER := pyside2-uic
QT_SRC := data
QT_OBJ := pycg/ui
QT_SOURCES := $(wildcard $(QT_SRC)/*.ui)
QT_OBJECTS := $(patsubst $(QT_SRC)/%.ui, $(QT_OBJ)/%.py, $(QT_SOURCES))
.PHONY: run test clean mostlyclean release
# default
run: $(QT_OBJECTS)
$(PYTHON) $(PY_APP) objs/world.obj
test:
$(PYTHON) -m pytest -vv -s
# does not clean the compiled PySide UI, since that is needed for releases
mostlyclean:
- rm -r $(PY_SRC)/__pycache__
- rm -r $(QT_OBJ)/__pycache__
- rm -r $(PY_SRC)/tests/__pycache__
- rm -r ./.pytest_cache
clean:
@ make mostlyclean
- rm -r $(QT_OBJECTS)
- rm submission.zip
release: submission.zip
$(QT_OBJ)/%.py: $(QT_SRC)/%.ui
$(QT_COMPILER) $< -o $@
submission.zip: $(PY_SOURCES) $(QT_OBJECTS) Makefile README.md requirements.txt objs/world.obj objs/palette.mtl
@ make test
@ make mostlyclean
mkdir PyCG
cp -r $(PY_SRC) PyCG
cp -r $(QT_SRC) PyCG
cp Makefile PyCG
cp README.md PyCG
cp requirements.txt PyCG
mkdir PyCG/objs
cp objs/world.obj PyCG/objs
cp objs/palette.mtl PyCG/objs
zip -r submission.zip PyCG
rm -r PyCG