1
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
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.
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.
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
17
# A relatively simple Makefile to assist in building parts of bzr. Mostly for
18
# building documentation, etc.
20
.PHONY: all clean extensions pyflakes api-docs
25
@echo "building extension modules."
26
python setup.py build_ext -i
28
check: docs extensions
29
python -Werror ./bzr selftest -v $(tests)
30
@echo "Running all tests with no locale."
31
LC_CTYPE= LANG=C LC_ALL= ./bzr selftest -v $(tests)
32
python -O -Werror ./bzr selftest -v $(tests)
35
./bzr --no-plugins selftest -v msgeditor
37
# Run Python style checker (apt-get install pyflakes)
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'
48
-find . -name "*.pyc" -o -name "*.pyo" | xargs rm -f
54
PYTHONPATH=$(PWD) python tools/bzr_epydoc --html -o api/html --docformat 'restructuredtext en' $(docfiles)
57
PYTHONPATH=$(PWD) python tools/bzr_epydoc --check --docformat 'restructuredtext en' $(docfiles)
60
# build emacs cross-reference
61
tag_files=./bzr ./bzrlib/*py ./bzrlib/selftest/*.py
63
ctags-exuberant -e $(tag_files)
66
# Produce HTML docs to upload on Canonical server
68
PRETTYDIR := pretty_docs
71
python tools/win32/ostools.py copytodir $(htm_files) doc/default.css $(HTMLDIR)
74
# translate txt docs to html
76
txt_files := $(wildcard $(addsuffix /*.txt, $(doc_dir))) doc/bzr_man.txt
77
htm_files := $(patsubst %.txt, %.html, $(txt_files))
78
dev_txt_files := $(wildcard $(addsuffix /*.txt, doc/developers))
79
dev_htm_files := $(patsubst %.txt, %.html, $(dev_txt_files))
81
pretty-html-docs: pretty_files
84
python -c "import os; os.mkdir('$(PRETTYDIR)')"
86
pretty_files: $(patsubst doc/%.txt, $(PRETTYDIR)/%.html, $(txt_files))
88
doc/developers/%.html: doc/developers/%.txt
89
python tools/rst2html.py --link-stylesheet --stylesheet=../default.css --footnote-references=superscript $< $@
92
python tools/rst2html.py --link-stylesheet --stylesheet=default.css --footnote-references=superscript $< $@
94
$(PRETTYDIR)/%.html: pretty_docs doc/%.txt
95
python tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid doc/$*.txt \
98
MAN_DEPENDENCIES = bzrlib/builtins.py \
99
bzrlib/bundle/commands.py \
100
bzrlib/conflicts.py \
101
bzrlib/sign_my_commits.py \
103
tools/doc_generate/__init__.py \
104
tools/doc_generate/autodoc_man.py \
105
tools/doc_generate/autodoc_rstx.py
107
doc/bzr_man.txt: $(MAN_DEPENDENCIES)
108
python generate_docs.py -o $@ rstx
110
MAN_PAGES = man1/bzr.1
111
man1/bzr.1: $(MAN_DEPENDENCIES)
112
python generate_docs.py -o $@ man
114
ALL_DOCS = $(htm_files) $(MAN_PAGES) $(dev_htm_files) doc/developers/performance.png
118
python tools/win32/ostools.py copytodir $(htm_files) \
119
doc/default.css NEWS README \
121
python tools/win32/ostools.py copytodir $(dev_htm_files) \
122
win32_bzr.exe/doc/developers
124
# clean produced docs
126
python tools/win32/ostools.py remove $(ALL_DOCS) \
127
$(HTMLDIR) $(PRETTYDIR) doc/bzr_man.txt
130
# build a png of our performance task list
131
doc/developers/performance.png: doc/developers/performance.dot
133
@dot -Tpng $< -o$@ || echo "Dot not installed; skipping generation of $@"
136
# make bzr.exe for win32 with py2exe
138
@echo *** Make bzr.exe
139
python setup.py build_ext -i -f
140
python setup.py py2exe > py2exe.log
141
python tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
142
python tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_bzr.exe
144
# win32 installer for bzr.exe
145
installer: exe copy-docs
146
@echo *** Make windows installer
147
cog.py -d -o tools/win32/bzr.iss tools/win32/bzr.iss.cog
148
iscc /Q tools/win32/bzr.iss
150
# win32 python's distutils-based installer
151
# require to have python interpreter installed on win32
152
python-installer: docs
153
python24 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
154
python25 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
157
# clean on win32 all installer-related files and directories
158
clean-win32: clean-docs
159
python tools/win32/ostools.py remove build
160
python tools/win32/ostools.py remove win32_bzr.exe
161
python tools/win32/ostools.py remove py2exe.log
162
python tools/win32/ostools.py remove doc/bzr_man.txt
163
python tools/win32/ostools.py remove tools/win32/bzr.iss
164
python tools/win32/ostools.py remove bzr-setup*.exe
165
python tools/win32/ostools.py remove bzr-*win32.exe
166
python tools/win32/ostools.py remove dist