-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
79 lines (52 loc) · 1.54 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# These make targets aren't really critical, they are more of a cheatsheet to
# remind me of a few commonly-used commands.
# I run these under Ubuntu bash, or on Windows with Cygwin binaries foremost on
# the PATH
NAME := gloopy
SCRIPT := run.py
VERSION := $(shell python -c "from ${NAME} import VERSION; print(VERSION)")
help:
@echo This Makefile has no default target.
test:
python -m unittest discover gloopy
.PHONY: tests
# runsnake is a GUI profile visualiser, very useful.
# http://www.vrplumber.com/programming/runsnakerun/
profile:
python -O -m cProfile -o profile.out ${SCRIPT}
runsnake profile.out
.PHONY: profile
clean:
rm -rf build dist *.egg-info tags pip-log.txt
-find . \( -name "*.py[oc]" -o -name "*.orig" -o -name "*.rej" \) -exec rm {} \;
$(MAKE) -C docs clean
.PHONY: clean
tags:
ctags -R ${NAME}
.PHONY: tags
docs:
@$(MAKE) -C docs
.PHONY: docs
sdist: docs
rm -rf dist/${NAME}-${VERSION}.* build
python setup.py sdist
.PHONY: sdist
register: docs
rm -rf dist/${NAME}-${VERSION}.* build
python setup.py --quiet sdist register
.PHONY: register
upload: docs
rm -rf dist/${NAME}-${VERSION}.* build
python setup.py --quiet sdist register upload
.PHONY: upload
py2exe:
rm -rf dist/${NAME}-${VERSION}-windows build
python setup.py --quiet py2exe
.PHONY: py2exe
stats:
@echo "non-blank lines of code:"
@echo -n 'product: '
@find ${NAME} -name '*.py' | grep -v "/tests/" | xargs cat | grep -cve "^\W*$$"
@echo -n 'tests: '
@find ${NAME} -name '*.py' | grep "/tests/" | xargs cat | grep -cve "^\W*$$"
.PHONY: stats