23
25
.PHONY: all clean extensions pyflakes api-docs
28
30
@echo "building extension modules."
29
python setup.py build_ext -i
31
$(PYTHON) setup.py build_ext -i
31
33
check: docs extensions
32
python -Werror -O ./bzr selftest -1v $(tests)
34
$(PYTHON) -Werror -O ./bzr selftest -1v $(tests)
33
35
@echo "Running all tests with no locale."
34
36
LC_CTYPE= LANG=C LC_ALL= ./bzr selftest -1v $(tests) 2>&1 | sed -e 's/^/[ascii] /'
46
48
pyflakes bzrlib | grep -v ' imported but unused'
50
-find . -name "*.pyc" -o -name "*.pyo" | xargs rm -f
51
$(PYTHON) setup.py clean
52
-find . -name "*.pyc" -o -name "*.pyo" -o -name "*.so" | xargs rm -f
53
54
# Build API documentation
54
55
docfiles = bzr bzrlib
57
PYTHONPATH=$(PWD) python tools/bzr_epydoc --html -o api/html --docformat 'restructuredtext en' $(docfiles)
58
PYTHONPATH=$(PWD) $(PYTHON) tools/bzr_epydoc --html -o api/html --docformat 'restructuredtext en' $(docfiles)
59
PYTHONPATH=$(PWD) python tools/bzr_epydoc --check --docformat 'restructuredtext en' $(docfiles)
60
PYTHONPATH=$(PWD) $(PYTHON) tools/bzr_epydoc --check --docformat 'restructuredtext en' $(docfiles)
61
62
# build tags for emacs and vim
73
74
# set PRETTY to get docs that look like the Bazaar web site
75
rst2html := python tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid
76
rst2html := $(PYTHON) tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid
77
rst2html := python tools/rst2html.py --link-stylesheet --footnote-references=superscript
78
rst2html := $(PYTHON) tools/rst2html.py --link-stylesheet --footnote-references=superscript
80
81
# translate txt docs to html
85
86
doc_dir := doc/en/user-guide
86
87
txt_files := $(wildcard $(addsuffix /*.txt, $(doc_dir))) $(derived_txt_files) \
87
88
doc/en/mini-tutorial/index.txt \
89
doc/en/user-reference/hooks.txt \
112
114
tools/doc_generate/autodoc_rstx.py
114
116
doc/en/user-reference/bzr_man.txt: $(MAN_DEPENDENCIES)
115
python generate_docs.py -o $@ rstx
117
$(PYTHON) generate_docs.py -o $@ rstx
117
119
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
120
$(PYTHON) tools/win32/ostools.py copytodir doc/developers/HACKING.txt doc/en/developer-guide
120
122
doc/en/release-notes/NEWS.txt: NEWS
121
python -c "import shutil; shutil.copyfile('$<', '$@')"
123
$(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
123
125
MAN_PAGES = man1/bzr.1
124
126
man1/bzr.1: $(MAN_DEPENDENCIES)
125
python generate_docs.py -o $@ man
127
$(PYTHON) generate_docs.py -o $@ man
127
129
# build a png of our performance task list
128
130
doc/developers/performance.png: doc/developers/performance.dot
139
141
# produce a tree containing just the final docs, ready for uploading to the web
140
142
HTMLDIR := html_docs
142
python tools/win32/ostools.py copytree $(WEB_DOCS) $(HTMLDIR)
144
$(PYTHON) tools/win32/ostools.py copytree $(WEB_DOCS) $(HTMLDIR)
144
146
# clean produced docs
146
python tools/win32/ostools.py remove $(ALL_DOCS) \
148
$(PYTHON) tools/win32/ostools.py remove $(ALL_DOCS) \
147
149
$(HTMLDIR) $(derived_txt_files)
152
154
# make bzr.exe for win32 with py2exe
154
156
@echo *** Make bzr.exe
155
python setup.py build_ext -i -f
156
python setup.py py2exe > py2exe.log
157
python tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
158
python tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_bzr.exe
157
$(PYTHON) setup.py build_ext -i -f
158
$(PYTHON) setup.py py2exe > py2exe.log
159
$(PYTHON) tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
160
$(PYTHON) tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_bzr.exe
160
162
# win32 installer for bzr.exe
161
163
installer: exe copy-docs
163
165
cog.py -d -o tools/win32/bzr.iss tools/win32/bzr.iss.cog
164
166
iscc /Q tools/win32/bzr.iss
166
# win32 python's distutils-based installer
167
# require to have python interpreter installed on win32
168
python-installer: docs
168
# win32 Python's distutils-based installer
169
# require to have Python interpreter installed on win32
169
171
python24 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
170
174
python25 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
176
python-installer: py-inst-24 py-inst-25
173
python tools/win32/ostools.py copytodir README win32_bzr.exe/doc
174
python tools/win32/ostools.py copytree $(WEB_DOCS) win32_bzr.exe
180
$(PYTHON) tools/win32/ostools.py copytodir README win32_bzr.exe/doc
181
$(PYTHON) tools/win32/ostools.py copytree $(WEB_DOCS) win32_bzr.exe
176
183
# clean on win32 all installer-related files and directories
177
184
clean-win32: clean-docs
178
python tools/win32/ostools.py remove build
179
python tools/win32/ostools.py remove win32_bzr.exe
180
python tools/win32/ostools.py remove py2exe.log
181
python tools/win32/ostools.py remove tools/win32/bzr.iss
182
python tools/win32/ostools.py remove bzr-setup*.exe
183
python tools/win32/ostools.py remove bzr-*win32.exe
184
python tools/win32/ostools.py remove dist
185
$(PYTHON) tools/win32/ostools.py remove build
186
$(PYTHON) tools/win32/ostools.py remove win32_bzr.exe
187
$(PYTHON) tools/win32/ostools.py remove py2exe.log
188
$(PYTHON) tools/win32/ostools.py remove tools/win32/bzr.iss
189
$(PYTHON) tools/win32/ostools.py remove bzr-setup*.exe
190
$(PYTHON) tools/win32/ostools.py remove bzr-*win32.exe
191
$(PYTHON) tools/win32/ostools.py remove dist