/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
2399.1.1 by John Arbash Meinel
Update Makefile to add 'make api-docs' using pydoctor
1
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
2
#
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
17
# A relatively simple Makefile to assist in building parts of bzr. Mostly for
18
# building documentation, etc.
19
1739.1.6 by Robert Collins
Resolve conflicts with bzr.dev.
20
.PHONY: all clean extensions pyflakes api-docs
21
1739.1.5 by Robert Collins
Review feedback.
22
all: extensions
23
24
extensions:
1739.1.3 by Robert Collins
Merge bzr.dev.
25
	@echo "building extension modules."
2449.1.1 by Alexander Belchenko
fix RSTX wrong formatting in HACKING
26
	python setup.py build_ext -i
1102 by Martin Pool
- merge test refactoring from robertc
27
2495.5.1 by John Arbash Meinel
(Andrew Bennetts) 'make check' builds docs as well
28
check: docs extensions
2080.2.2 by John Arbash Meinel
Teach the pqm to treat warnings as errors
29
	python -Werror ./bzr selftest -v $(tests)
1526.1.1 by Robert Collins
Run the test suite with no locale as well as the default locale. Also add a test for build_tree_shape to selftest.
30
	@echo "Running all tests with no locale."
1704.1.1 by Robert Collins
'bzr selftest' now shows a progress bar with the number of tests, and
31
	LC_CTYPE= LANG=C LC_ALL= ./bzr selftest -v $(tests)
2090.2.4 by Martin Pool
Make check should run under python -O too
32
	python -O -Werror ./bzr selftest -v $(tests)
1102 by Martin Pool
- merge test refactoring from robertc
33
1185.33.72 by Martin Pool
Fix commit message template for non-ascii files, and add test for handling of
34
check-msgeditor:
35
	./bzr --no-plugins selftest -v msgeditor
36
1773.4.1 by Martin Pool
Add pyflakes makefile target; fix many warnings
37
# Run Python style checker (apt-get install pyflakes)
38
pyflakes:
39
	pyflakes bzrlib
40
41
pyflakes-nounused:
42
	# There are many of these warnings at the moment and they're not a
43
	# high priority to fix
44
	pyflakes bzrlib | grep -v ' imported but unused'
45
46
clean:
2366.2.1 by Matthew Fuller
(trivial) Use 'python setup.py' instead of './setup.py'.
47
	python setup.py clean
1185.62.18 by John Arbash Meinel
From Jari Alto: Makefile fixes (clean target error suppression)
48
	-find . -name "*.pyc" -o -name "*.pyo" | xargs rm -f
1427 by Robert Collins
clean up test dirs on make clean
49
	rm -rf test????.tmp
1185.1.21 by Robert Collins
add a clean target
50
2399.1.9 by John Arbash Meinel
Since I have epydoc working with lazy imports, make it the default api doc generator.
51
docfiles = bzr bzrlib
2399.1.1 by John Arbash Meinel
Update Makefile to add 'make api-docs' using pydoctor
52
api-docs:
2413.4.1 by John Arbash Meinel
Cherrypick just the epydoc builder changes.
53
	mkdir -p api/html
54
	PYTHONPATH=$(PWD) python tools/bzr_epydoc --html -o api/html --docformat 'restructuredtext en' $(docfiles)
2399.1.8 by John Arbash Meinel
Change lazy_import to allow proxying when necessary.
55
2399.1.12 by John Arbash Meinel
Add make check-api-docs, which runs epydoc --check, rather than generating output
56
check-api-docs:
57
	PYTHONPATH=$(PWD) python tools/bzr_epydoc --check --docformat 'restructuredtext en' $(docfiles)
58
1158 by Martin Pool
- make target to build emacs TAGS file
59
60
# build emacs cross-reference
61
tag_files=./bzr ./bzrlib/*py ./bzrlib/selftest/*.py
62
TAGS: $(tag_files)
63
	ctags-exuberant -e $(tag_files)
1536.1.1 by Martin Pool
Move in tutorial text from wiki.
64
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
65
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
66
# Produce HTML docs to upload on Canonical server
67
HTMLDIR := html_docs
2054.2.14 by Aaron Bentley
Add 'pretty-docs' target to makefile
68
PRETTYDIR := pretty_docs
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
69
1711.2.129 by John Arbash Meinel
change htmldocs => html-docs, to be consistent with other -docs functions
70
html-docs: docs
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
71
	python tools/win32/ostools.py copytodir $(htm_files) doc/default.css $(HTMLDIR)
72
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
73
74
# translate txt docs to html
2691.1.4 by Ian Clatworthy
teach Makefile and .bzrignore re new doc structure
75
derived_txt_files := \
76
	doc/en/user-reference/bzr_man.txt \
77
	doc/en/developer-guide/HACKING.txt \
78
	doc/en/release-notes/NEWS.txt
79
doc_dir := doc/en/user-guide
80
txt_files := $(wildcard $(addsuffix /*.txt, $(doc_dir))) $(derived_txt_files) doc/en/index.txt
2666.2.1 by Alexander Belchenko
change generated documentation extension from htm to html
81
htm_files := $(patsubst %.txt, %.html, $(txt_files)) 
2481.1.3 by Robert Collins
Add the performance roadmap rationale.
82
dev_txt_files := $(wildcard $(addsuffix /*.txt, doc/developers))
2666.2.1 by Alexander Belchenko
change generated documentation extension from htm to html
83
dev_htm_files := $(patsubst %.txt, %.html, $(dev_txt_files)) 
2054.2.14 by Aaron Bentley
Add 'pretty-docs' target to makefile
84
2054.2.16 by Aaron Bentley
More updates from review comments
85
pretty-html-docs: pretty_files
2054.2.14 by Aaron Bentley
Add 'pretty-docs' target to makefile
86
87
pretty_docs:
88
	python -c "import os; os.mkdir('$(PRETTYDIR)')"
89
2666.2.1 by Alexander Belchenko
change generated documentation extension from htm to html
90
pretty_files: $(patsubst doc/%.txt, $(PRETTYDIR)/%.html, $(txt_files))
91
92
doc/developers/%.html: doc/developers/%.txt
93
	python tools/rst2html.py --link-stylesheet --stylesheet=../default.css --footnote-references=superscript $< $@
94
2691.1.4 by Ian Clatworthy
teach Makefile and .bzrignore re new doc structure
95
doc/en/index.html: doc/en/index.txt
96
	python tools/rst2html.py --link-stylesheet --stylesheet=../default.css --footnote-references=superscript $< $@
97
2666.2.1 by Alexander Belchenko
change generated documentation extension from htm to html
98
%.html: %.txt
2691.1.4 by Ian Clatworthy
teach Makefile and .bzrignore re new doc structure
99
	python tools/rst2html.py --link-stylesheet --stylesheet=../../default.css --footnote-references=superscript $< $@
2054.2.14 by Aaron Bentley
Add 'pretty-docs' target to makefile
100
2666.2.1 by Alexander Belchenko
change generated documentation extension from htm to html
101
$(PRETTYDIR)/%.html: pretty_docs doc/%.txt
2054.2.14 by Aaron Bentley
Add 'pretty-docs' target to makefile
102
	python tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid doc/$*.txt \
2666.2.1 by Alexander Belchenko
change generated documentation extension from htm to html
103
	$(PRETTYDIR)/$*.html
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
104
2425.1.1 by Robert Collins
``make docs`` now creates a man page at ``man1/bzr.1`` fixing bug 107388.
105
MAN_DEPENDENCIES = bzrlib/builtins.py \
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
106
		 bzrlib/bundle/commands.py \
107
		 bzrlib/conflicts.py \
108
		 bzrlib/sign_my_commits.py \
109
		 generate_docs.py \
110
		 tools/doc_generate/__init__.py \
2677.1.1 by Alexander Belchenko
rst2html: workaround for IE bug with id="tags"
111
		 tools/doc_generate/autodoc_man.py \
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
112
		 tools/doc_generate/autodoc_rstx.py
2425.1.1 by Robert Collins
``make docs`` now creates a man page at ``man1/bzr.1`` fixing bug 107388.
113
2691.1.4 by Ian Clatworthy
teach Makefile and .bzrignore re new doc structure
114
doc/en/user-reference/bzr_man.txt: $(MAN_DEPENDENCIES)
2425.1.1 by Robert Collins
``make docs`` now creates a man page at ``man1/bzr.1`` fixing bug 107388.
115
	python generate_docs.py -o $@ rstx
116
2691.1.4 by Ian Clatworthy
teach Makefile and .bzrignore re new doc structure
117
doc/en/developer-guide/HACKING.txt: doc/developers/HACKING.txt
118
	python tools/win32/ostools.py copytodir doc/developers/HACKING.txt doc/en/developer-guide
119
120
doc/en/release-notes/NEWS.txt: NEWS
121
	python -c "import shutil; shutil.copyfile('$<', '$@')"
122
2425.1.1 by Robert Collins
``make docs`` now creates a man page at ``man1/bzr.1`` fixing bug 107388.
123
MAN_PAGES = man1/bzr.1
124
man1/bzr.1: $(MAN_DEPENDENCIES)
125
	python generate_docs.py -o $@ man
126
2666.2.1 by Alexander Belchenko
change generated documentation extension from htm to html
127
ALL_DOCS = $(htm_files) $(MAN_PAGES) $(dev_htm_files) doc/developers/performance.png
2481.1.1 by Robert Collins
Move HACKING to docs/developers/HACKING and adjust Makefile to accomodate this.
128
docs: $(ALL_DOCS)
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
129
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
130
copy-docs: docs
2456.3.1 by Alexander Belchenko
`make copy-docs` should also copy doc/HACKING.htm (for win32 standalone installer)
131
	python tools/win32/ostools.py copytodir $(htm_files) \
2481.1.4 by Robert Collins
Fix the developer documentation to use the right style sheet and give it its own index. (Robert Collins, Alexander Belchenko)
132
		doc/default.css NEWS README \
2456.3.2 by Alexander Belchenko
indenting
133
		win32_bzr.exe/doc
2666.2.1 by Alexander Belchenko
change generated documentation extension from htm to html
134
	python tools/win32/ostools.py copytodir $(dev_htm_files) \
2481.1.4 by Robert Collins
Fix the developer documentation to use the right style sheet and give it its own index. (Robert Collins, Alexander Belchenko)
135
		win32_bzr.exe/doc/developers
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
136
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
137
# clean produced docs
138
clean-docs:
2481.1.1 by Robert Collins
Move HACKING to docs/developers/HACKING and adjust Makefile to accomodate this.
139
	python tools/win32/ostools.py remove $(ALL_DOCS) \
2691.1.4 by Ian Clatworthy
teach Makefile and .bzrignore re new doc structure
140
	$(HTMLDIR) $(PRETTYDIR) $(derived_txt_files)
2522.3.1 by Robert Collins
Draft proposed integration order for performance changes.
141
142
143
# build a png of our performance task list
144
doc/developers/performance.png: doc/developers/performance.dot
2556.1.1 by Vincent Ladeuil
Minor cleanup.
145
	@echo Generating $@
2522.3.3 by Robert Collins
Handle dot not being installed
146
	@dot -Tpng $< -o$@ || echo "Dot not installed; skipping generation of $@"
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
147
148
149
# make bzr.exe for win32 with py2exe
150
exe:
151
	@echo *** Make bzr.exe
2571.3.2 by Alexander Belchenko
Build pyrex/C extensions for bzr.exe
152
	python setup.py build_ext -i -f
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
153
	python setup.py py2exe > py2exe.log
154
	python tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
155
	python tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_bzr.exe
156
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
157
# win32 installer for bzr.exe
1982.2.1 by Alexander Belchenko
small but important fix for 'make installer' dependencies
158
installer: exe copy-docs
1861.2.18 by Alexander Belchenko
Makefile: cross-platform actions for building installer
159
	@echo *** Make windows installer
160
	cog.py -d -o tools/win32/bzr.iss tools/win32/bzr.iss.cog
161
	iscc /Q tools/win32/bzr.iss
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
162
1821.1.2 by Alexander Belchenko
resurrected python's distutils based installer for win32
163
# win32 python's distutils-based installer
164
# require to have python interpreter installed on win32
1860.1.3 by Alexander Belchenko
python-installer:
165
python-installer: docs
2571.3.1 by Alexander Belchenko
Building Python-based installer for bot Python 2.4 and 2.5
166
	python24 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
167
	python25 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
1821.1.2 by Alexander Belchenko
resurrected python's distutils based installer for win32
168
169
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
170
# clean on win32 all installer-related files and directories
2666.2.1 by Alexander Belchenko
change generated documentation extension from htm to html
171
clean-win32: clean-docs
1861.2.18 by Alexander Belchenko
Makefile: cross-platform actions for building installer
172
	python tools/win32/ostools.py remove build
173
	python tools/win32/ostools.py remove win32_bzr.exe
174
	python tools/win32/ostools.py remove py2exe.log
175
	python tools/win32/ostools.py remove tools/win32/bzr.iss
176
	python tools/win32/ostools.py remove bzr-setup*.exe
2245.4.5 by Alexander Belchenko
bzr-win32-bdist-postinstall.py: good win98 support
177
	python tools/win32/ostools.py remove bzr-*win32.exe
1861.2.18 by Alexander Belchenko
Makefile: cross-platform actions for building installer
178
	python tools/win32/ostools.py remove dist