forked from bfontaine/term2048
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (43 loc) · 1.11 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
# term2048's Makefile
#
SRC=term2048
VENV=venv
BINUTILS=$(VENV)/bin
PIP=$(BINUTILS)/pip
COVERFILE:=.coverage
COVERAGE_REPORT:=report -m
PY_VERSION:=$(subst ., ,$(shell python --version 2>&1 | cut -d' ' -f2))
PY_VERSION_MAJOR:=$(word 1,$(PY_VERSION))
PY_VERSION_MINOR:=$(word 2,$(PY_VERSION))
PY_VERSION_SHORT:=$(PY_VERSION_MAJOR).$(PY_VERSION_MINOR)
ifdef TRAVIS_PYTHON_VERSION
PY_VERSION_SHORT:=$(TRAVIS_PYTHON_VERSION)
endif
.DEFAULT: check-versions
.PHONY: check check-versions stylecheck covercheck
deps: $(VENV)
$(PIP) install -qr requirements.txt
ifeq ($(PY_VERSION_SHORT),2.6)
$(PIP) install -qr py26-requirements.txt
endif
ifneq ($(PY_VERSION_SHORT),3.3)
ifneq ($(PY_VERSION_SHORT),3.4)
$(PIP) install -q wsgiref==0.1.2
endif
endif
$(VENV):
virtualenv $@
check: deps
$(BINUTILS)/python tests/test.py
check-versions: deps
$(BINUTILS)/tox
stylecheck: deps
$(BINUTILS)/pep8 $(SRC)
covercheck: deps
$(BINUTILS)/coverage run --source=term2048 tests/test.py
$(BINUTILS)/coverage $(COVERAGE_REPORT)
clean:
rm -f *~ */*~
rm -f $(COVERFILE)
publish: deps check-versions
$(BINUTILS)/python setup.py sdist upload