forked from pmatiello/python-graph
-
Notifications
You must be signed in to change notification settings - Fork 38
/
Makefile
105 lines (70 loc) · 2.28 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# python-graph
# Makefile
# Module directories -------------------------------------------------
CORE_DIR="core/"
DOT_DIR="dot/"
TESTS_DIR="tests/"
DOCS_DIR="docs/"
TEMP="temp/"
PYTHONPATH="`pwd`/core:`pwd`/dot"
PYTHON="python"
PYTHON3="python3"
# General ------------------------------------------------------------
nothing:
sdist: clean sdist-core sdist-dot
rm -rf dist
mkdir dist
cp */dist/* dist
# Core ---------------------------------------------------------------
install-core:
cd ${CORE_DIR} && ./setup.py install
sdist-core: clean
cd ${CORE_DIR} && ./setup.py sdist
# Dot ----------------------------------------------------------------
install-dot:
cd ${DOT_DIR} && ./setup.py install
sdist-dot: clean
cd ${DOT_DIR} && ./setup.py sdist
# Docs ---------------------------------------------------------------
docs: cleanpyc
rm -rf ${DOCS_DIR} ${TEMP}
mkdir -p ${TEMP}
cp -R ${CORE_DIR}/pygraph ${TEMP}
cp -Rn ${DOT_DIR}/pygraph ${TEMP}/pygraph/
epydoc -v --no-frames --no-sourcecode --name="python-graph" \
--url="https://github.com/Shoobx/python-graph" \
--inheritance listed --no-private --html \
--graph classtree \
--css misc/epydoc.css -o docs ${TEMP}/pygraph/*.py \
${TEMP}/pygraph/algorithms/*py \
${TEMP}/pygraph/algorithms/heuristics/*.py \
${TEMP}/pygraph/algorithms/filters/* \
${TEMP}/pygraph/readwrite/* \
${TEMP}/pygraph/classes/*.py \
${TEMP}/pygraph/mixins/*.py
rm -rf ${TEMP}
# Tests --------------------------------------------------------------
test-pre:
reset
test: test-pre
PYTHONPATH=${PYTHONPATH} ${PYTHON} tests/testrunner.py
test3: test-pre
PYTHONPATH=${PYTHONPATH} ${PYTHON3} tests/testrunner.py
tests: test
# Tests --------------------------------------------------------------
console:
export PYTHONPATH=${PYTHONPATH} && cd ${TESTS_DIR} && ${PYTHON}
console3:
export PYTHONPATH=${PYTHONPATH} && cd ${TESTS_DIR} && ${PYTHON3}
# Cleaning -----------------------------------------------------------
cleanpyc:
find tests dot core -name *.pyc -exec rm {} \;
find tests dot core -name __pycache__ -exec rm -rf {} \; -prune
clean: cleanpyc
rm -rf ${DOCS_DIR}
rm -rf */dist
rm -rf */build
rm -rf */*.egg-info
rm -rf dist
# Phony rules --------------------------------------------------------
.PHONY: clean cleanpyc docs-core