/
Makefile
110 lines (74 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
# Documentation builder stuff
HTML =
PRE =
CSS =
IMAGES =
WEBSITE = $(CSS) $(HTML) $(PRE) $(IMAGES)
# Distribution stuff
TAR = tar
TAROPTS = --exclude=.svn --exclude='*.pyc' --exclude='*~'
COMPRESS = bzip2 -f
PACKAGE := peppy
VERSION := $(shell grep Released ChangeLog|head -n1|cut -d '-' -f 2)
EPYDOC = epydoc -v -v -v --no-sourcecode
srcdir = .
top_srcdir = .
top_builddir = .
distdir := $(PACKAGE)-$(VERSION)
top_distdir := $(distdir)
APPMAIN = peppy.py
WINBATCH = peppy.bat
SCRIPTMAIN = scripts/peppy
DISTMAIN = peppy/__init__.py
SVN_LIST = $(shell python svn-ls.py)
SVN_FILTER_OUT := %.in Makefile Makedoc.py peppy.bat setup.py trac/% %/
SVN_FILTERED := $(filter-out $(SVN_FILTER_OUT),$(SVN_LIST))
DISTSRC := $(filter %.py,$(SVN_FILTERED))
DISTFILES := README INSTALL setup.py $(SVN_FILTERED)
APIFILES := $(filter-out $(APPMAIN) $(DISTMAIN) tests/% demo/%,$(DISTSRC))
.SUFFIXES: .html.in .pre.in .html
.html.in.html: template.html.in mainmenu.html.in
./Makedoc.py -m peppy -o $*.html -n mainMenu mainmenu.html.in -n htmlBody $*.html.in -t template.html.in
.pre.in.html: template.html.in mainmenu.html.in
./Makedoc.py -m peppy -o $*.html -n mainMenu mainmenu.html.in -n preBody $*.pre.in -t template.html.in
all: doc
README: README.pre.in ChangeLog
./Makedoc.py -m peppy -o README README.pre.in
INSTALL: INSTALL.pre.in ChangeLog
./Makedoc.py -m peppy -o INSTALL INSTALL.pre.in
doc: README INSTALL
html: $(HTML) $(PRE)
publish_html: html
rsync -avuz $(WEBSITE) robm@peppy.sourceforge.net:/home/groups/p/py/peppy/htdocs
publish_api: api
rsync -avuz api robm351@www.flipturn.org:flipturn.org/peppy/
release: dist
-mkdir -p archive
mv $(distdir).tar.bz2 archive
publish: api release
rsync -avuz api archive robm351@www.flipturn.org:flipturn.org/peppy/
dist: distdir
-chmod -R a+r $(distdir)
$(TAR) cvf $(distdir).tar $(TAROPTS) $(distdir)
$(COMPRESS) $(distdir).tar
-rm -rf $(distdir)
distdir:
-rm -rf $(distdir)
mkdir $(distdir)
-chmod 777 $(distdir)
tar cf - $(DISTFILES) | (cd $(distdir); tar xf -)
chmod 644 $(distdir)/tests/*.py
./Makedoc.py -m peppy -o $(distdir)/setup.py setup.py.in
rm $(distdir)/$(DISTMAIN)
./Makedoc.py -m peppy -d -o $(distdir)/$(DISTMAIN).tmp $(DISTMAIN)
sed -e "s/svn-devel/$(VERSION)/" $(distdir)/$(DISTMAIN).tmp > $(distdir)/$(DISTMAIN)
rm $(distdir)/$(DISTMAIN).tmp
mkdir $(distdir)/scripts
cp $(distdir)/$(APPMAIN) $(distdir)/$(SCRIPTMAIN)
cp $(WINBATCH) $(distdir)/scripts
api: distdir
(cd $(distdir); $(EPYDOC) -o docs/api --no-private --url 'http://www.flipturn.org/peppy/' $(DISTMAIN) $(APIFILES)) | tee epydoc.out
clean:
rm -rf *~ *.o *.exe build api README $(HTML) $(PRE) $(distdir)
.PHONY: print-% clean html publish_html api publish_api publish release dist distdir
print-%: ; @ echo $* = $($*)