-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
139 lines (109 loc) · 3.39 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# Automating common tasks for NIPY development
PYTHON ?= python
HTML_DIR = doc/build/html
LATEX_DIR = doc/build/latex
WWW_DIR = doc/dist
DOCSRC_DIR = doc
PROJECT = nipy
clean-pyc:
find . -regex ".*\.pyc" -exec rm -rf "{}" \;
clean: clean-pyc
find . -regex ".*\.so" -exec rm -rf "{}" \;
find . -regex ".*\.pyd" -exec rm -rf "{}" \;
find . -regex ".*~" -exec rm -rf "{}" \;
find . -regex ".*#" -exec rm -rf "{}" \;
rm -rf build
$(MAKE) -C doc clean
clean-dev: clean dev
distclean: clean
-rm MANIFEST
-rm $(COVERAGE_REPORT)
@find . -name '*.py[co]' \
-o -name '*.a' \
-o -name '*,cover' \
-o -name '.coverage' \
-o -iname '*~' \
-o -iname '*.kcache' \
-o -iname '*.pstats' \
-o -iname '*.prof' \
-o -iname '#*#' | xargs -L10 rm -f
-rm -r dist
-rm build-stamp
-rm -r .tox
-git clean -fxd
dev: cythonize
$(PYTHON) setup.py build_ext --inplace
test:
cd .. && $(PYTHON) -c 'import nipy; nipy.test()'
install:
$(PYTHON) setup.py install
cythonize:
$(PYTHON) tools/nicythize
bdist_rpm:
$(PYTHON) setup.py bdist_rpm \
--doc-files "doc" \
--packager "nipy authors <https://mail.python.org/mailman/listinfo/neuroimaging>"
--vendor "nipy authors <https://mail.python.org/mailman/listinfo/neuroimaging>"
# build MacOS installer -- depends on patched bdist_mpkg for Leopard
bdist_mpkg:
$(PYTHON) tools/mpkg_wrapper.py setup.py install
# Check for files not installed
check-files:
$(PYTHON) -c 'from nisext.testers import check_files; check_files("nipy")'
# Print out info for possible install methods
check-version-info:
$(PYTHON) -c 'from nisext.testers import info_from_here; info_from_here("nipy")'
# Run tests from installed code
installed-tests:
$(PYTHON) -c 'from nisext.testers import tests_installed; tests_installed("nipy")'
# Run tests from sdist archive of code
sdist-tests:
$(PYTHON) -c 'from nisext.testers import sdist_tests; sdist_tests("nipy")'
# Run tests from bdist egg of code
bdist-egg-tests:
$(PYTHON) -c 'from nisext.testers import bdist_egg_tests; bdist_egg_tests("nipy")'
source-release: distclean
$(PYTHON) setup.py sdist
venv-tests:
# I use this for python2.5 because the sdist-tests target doesn't work
# (the tester routine uses a 2.6 feature)
make distclean
- rm -rf $(VIRTUAL_ENV)/lib/python$(PYVER)/site-packages/nipy
$(PYTHON) setup.py install
cd .. && nosetests $(VIRTUAL_ENV)/lib/python$(PYVER)/site-packages/nipy
tox-fresh:
# tox tests with fresh-installed virtualenvs. Needs network. And
# pytox, obviously.
tox -c tox.ini
tox-stale:
# tox tests with MB's already-installed virtualenvs (numpy and nose
# installed)
tox -e python25,python26,python27,python32,np-1.2.1
recythonize:
# Recythonize all pyx files
find . -name "*.pyx" -exec cython -I libcstat/wrapper -I lib/fff_python_wrapper {} \;
# Website stuff
$(WWW_DIR):
if [ ! -d $(WWW_DIR) ]; then mkdir -p $(WWW_DIR); fi
htmldoc:
cd $(DOCSRC_DIR) && $(MAKE) html
pdfdoc:
cd $(DOCSRC_DIR) && $(MAKE) latex
cd $(LATEX_DIR) && $(MAKE) all-pdf
html: html-stamp
html-stamp: $(WWW_DIR) htmldoc
cp -r $(HTML_DIR)/* $(WWW_DIR)
touch $@
pdf: pdf-stamp
pdf-stamp: $(WWW_DIR) pdfdoc
cp $(LATEX_DIR)/*.pdf $(WWW_DIR)
touch $@
website: website-stamp
website-stamp: $(WWW_DIR) html-stamp pdf-stamp
cp -r $(HTML_DIR)/* $(WWW_DIR)
touch $@
upload-html: html-stamp
./tools/upload-gh-pages.sh $(WWW_DIR) $(PROJECT)
refresh-readme:
$(PYTHON) tools/refresh_readme.py nipy
.PHONY: orig-src pylint