-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
86 lines (67 loc) · 2.43 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
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 os; \
from ConfigParser import ConfigParser; \
from StringIO import StringIO; \
config_IO = StringIO(); \
config_IO.write(\"[main]\\n\"); \
config_IO.write(open(\"PackageInfo.cfg\").read()); \
config_IO.seek(0, os.SEEK_SET); \
print config_IO.read(); \
config_IO.seek(0, os.SEEK_SET); \
config = ConfigParser(); \
config.optionxform = str; \
config.readfp(config_IO); \
p = dict(config.items(\"main\")); \
print p; \
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/