-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
75 lines (56 loc) · 1.82 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
include PackageInfo.cfg
include Makefile.inc
RELEASE = $(MAJOR).$(MINOR).$(MICRO)$(TAG)
BUNDLE = $(PACKAGE)-$(RELEASE)
DOCZIP = $(BUNDLE)-docs.zip
DOCPDF = $(PACKAGE).pdf
VERMODULE = $(PACKAGE)/_version.py
DOCS = LICENSE.txt html
PRODUCTS = $(VERMODULE) $(DOCS)
all : sdist
LICENSE.txt :
$(PYTHON) -c 'exec("import configobj; \
p = configobj.ConfigObj(\"PackageInfo.cfg\", \
list_values=False); \
t = open(\"$(LICENSE_TEMPLATE)\").read(); \
s = t % p; \
open(\"LICENSE.txt\", \"w\").write(s)")'
$(VERMODULE) : scrub
$(ECHO) '__version__ = "$(RELEASE)"' > $(VERMODULE)
html : $(VERMODULE)
cd $(DOCDIR) ; rm -rf _build/html ; make html
mv $(DOCDIR)/_build/html $(HTMLDIR)
$(DOCZIP) : html
-rm -f $(DOCZIP)
cd $(HTMLDIR) ; zip -ry $(CURDIR)/$(DOCZIP) *
mv $(DOCZIP) $(DOCDEST)
pdf : $(VERMODULE)
cd $(DOCDIR) ; rm -rf _build/latex ; make latexpdf
mv $(DOCDIR)/_build/latex/$(PACKAGE).pdf $(DOCDEST)/$(DOCPDF)
sdist : $(PRODUCTS)
-rm dist/$(BUNDLE).tar.gz
$(PYTHON) setup.py sdist
install : all
$(PYTHON) setup.py install
build : all
$(PYTHON) setup.py build
pypi-build-docs : $(DOCZIP)
pypi-upload-docs : html
python setup.py upload_docs
pypi-upload : all pypi-upload-docs
$(PYTHON) setup.py sdist upload
test : clean $(VERMODULE)
$(PYTHON) setup.py test
clean :
$(ECHO) Cleaning up in `pwd`.
-rm -rf $(DOCS)
-rm -rf $(DOCPDF)
cd $(DOCDIR) ; make clean
prune :
$(PYTHON) -c 'exec("import phyles; \
import logging; \
logging.basicConfig(level=logging.INFO); \
phyles.prune([\"*~\", \"*.pyc\", \".*~\"], \
doit=True)")'
scrub : clean prune
-rm -rf dist/ build/ $(PACKAGE).egg-info/