/
Makefile
91 lines (67 loc) · 1.71 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
79
80
81
82
83
84
85
86
87
88
89
90
91
# -*- Makefile -*-
PATH := $(shell pwd)/python/bin:$(PATH)
default: help
# Build python virtual environment
#
# Rules to build a python virtual environment that contains the modules
# needed to build the documentation and run the examples.
download:
mkdir download
python/bin/python: download
virtualenv python
mv distribute-*.tar.gz download
packages:
pip install --requirement=requirements.txt --download-cache=download
python: python/bin/python packages
.PHONY: python
#
# Run pylint on the module;
#
pylint:
(cd servermgr && pylint --disable=I0011,C0301 --include-ids=y *.py 2>&1) | tee pylint.log
#
# Build the documentation
#
docs:
cd docs/src && make html
.PHONY: docs
#
# Build the distribution;
#
dist: docs
rm -f MANIFEST && echo "Rebuilding MANIFEST file..."
python setup.py sdist
cd docs/_build/html && zip -r $(shell pwd)/dist/docs.zip .
#
# Install the module;
#
install:
python setup.py install sdist
#
# All targets
#
all: python docs install dist
help:
@echo
@echo "Type 'make python' to build a local virtualenv python."
@echo "Type 'make pylint' to run pylint on the module."
@echo "Type 'make docs' to build the documentation."
@echo "Type 'make install' to install the servermgr module."
@echo "Type 'make check' to run some pre-distribution checks."
@echo "Type 'make dist' to build the distribution."
@echo
clean:
cd docs/src && make clean
find . -name \*~ -print|xargs rm -f
find . -name \*.pyc -print|xargs rm -f
find . -name \#*\# -print|xargs rm -f
rm -rf build
rm -f pip-log.txt
rm -f pylint.log
rm -f MANIFEST
check:
-grep -n pdb servermgr/*.py
-find docs/src examples servermgr tests -type f -print |xargs grep -n XXX
distclean: clean
rm -rf python
rm -rf dist