-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakefile
125 lines (87 loc) · 2.74 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
## makefile for corrfitter library
#
# Created by G. Peter Lepage (Cornell University) on 2011-09-22.
# Copyright (c) 2011-2018 G. Peter Lepage.
PYTHON = python
PIP = $(PYTHON) -m pip
VERSION = `cd ..; python -c 'import corrfitter; print (corrfitter.__version__)'`
DOCFILES := $(shell ls doc/source/*.{rst,py,png} examples/*.png)
SRCFILES := $(shell ls setup.py src/corrfitter/*.py)
install-user:
$(PIP) install . --user
# $(PYTHON) setup.py install --user --record files-corrfitter.$(PYTHON)
install install-sys:
$(PIP) install .
# $(PYTHON) setup.py install --record files-corrfitter.$(PYTHON)
uninstall:
$(PIP) uninstall corrfitter
update:
make uninstall install
# - cat files-corrfitter.$(PYTHON) | xargs rm -rf
# - cat files-dataset.$(PYTHON) | xargs rm -rf
install-dataset:
$(PIP) install dataset
# $(PYTHON) dataset-setup.py install --user --record files-dataset.$(PYTHON)
uninstall-dataset:
$(PIP) uninstall dataset
try:
$(PYTHON) setup.py install --user --record files-corrfitter
untry:
- cat files-corrfitter | xargs rm -rf
.PHONY : tests
tests test-all:
@echo 'N.B. Some tests involve random numbers and so fail occasionally'
@echo ' (less than 1 in 100 times) due to multi-sigma fluctuations.'
@echo ' Run again if any test fails.'
@echo ''
cd tests; $(PYTHON) -m unittest discover; cd ..
run run-examples:
$(MAKE) -C examples run-all
time:
$(MAKE) -C examples time
sdist: # source distribution
$(PYTHON) setup.py sdist
corrfitter.tz: # everything distribution
make clean
tar -C .. --exclude '\.svn' -z -c -v -f corrfitter.tz corrfitter
doc-html:
make doc/html/index.html
doc/html/index.html : $(DOCFILES) $(SRCFILES)
rm -rf doc/html; sphinx-build -b html doc/source doc/html
# doc-pdf:
# make doc/corrfitter.pdf
# doc/corrfitter.pdf : $(DOCFILES) $(SRCFILES)
# rm -rf doc/corrfitter.pdf
# sphinx-build -b latex doc/source doc/latex
# cd doc/latex; make corrfitter.pdf; mv corrfitter.pdf ..
doc-zip doc.zip:
cd doc/html; zip -r doc *; mv doc.zip ../..
doc-all: doc-html # doc-pdf
%.so : %.pyx
$(PYTHON) $*-setup.py build_ext --inplace
upload-pypi:
python setup.py sdist upload
upload-twine:
twine upload dist/corrfitter-$(VERSION).tar.gz
upload-git:
make doc-html # doc-pdf
git diff --exit-code
git diff --cached --exit-code
git push origin master
test-download:
-$(PIP) uninstall corrfitter
$(PIP) install corrfitter --no-cache-dir
tag-git:
echo "version $(VERSION)"
git tag -a v$(VERSION) -m "version $(VERSION)"
git push origin v$(VERSION)
test-readme:
python setup.py --long-description | rst2html.py > README.html
clean:
cd tests; make clean; cd ..
cd examples; make clean; cd ..
rm -f *.pyc *.tmp corrfitter*.tz doc.zip
rm -rf __pycache__
rm -rf dist
rm -rf build
cd doc/source; make clean