-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (20 loc) · 719 Bytes
/
Copy pathMakefile
File metadata and controls
28 lines (20 loc) · 719 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
PYTHON ?= python3
PYTHON_FLAGS += -OO
ASSIGNMENT = 05
GROUP = gr1
PACKFILE = uebung$(ASSIGNMENT)-$(GROUP).tar.xz
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
MODULES = $(call rwildcard, src, *.py)
.PHONY: optimized unittests clean pack
optimized: $(MODULES)
$(PYTHON) $(PYTHON_FLAGS) -m compileall $^
unittests:
export PYTHONPATH=src; \
find tests -name test\*.py | while read -r test; do \
$(PYTHON) "$$test" || exit $$?; \
done
clean:
rm -rf $(addsuffix c, $(MODULES)) $(addsuffix o, $(MODULES)) $(call rwildcard, tests, *.pyc *.pyo)
$(PACKFILE): $(MODULES) $(call rwildcard, tests, test*.py) Makefile README | tests
tar -caf $@ -- $^
pack: $(PACKFILE)