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 pyflakes api-docs
26
python -Werror ./bzr selftest -v $(tests)
27
@echo "Running all tests with no locale."
28
LC_CTYPE= LANG=C LC_ALL= ./bzr selftest -v $(tests)
29
python -O -Werror ./bzr selftest -v $(tests)
32
./bzr --no-plugins selftest -v msgeditor
34
# Run Python style checker (apt-get install pyflakes)
39
# There are many of these warnings at the moment and they're not a
40
# high priority to fix
41
pyflakes bzrlib | grep -v ' imported but unused'
45
-find . -name "*.pyc" -o -name "*.pyo" | xargs rm -f
51
PYTHONPATH=$(PWD) python tools/bzr_epydoc --html -o api/html --docformat 'restructuredtext en' $(docfiles)
54
PYTHONPATH=$(PWD) python tools/bzr_epydoc --check --docformat 'restructuredtext en' $(docfiles)
57
# build emacs cross-reference
58
tag_files=./bzr ./bzrlib/*py ./bzrlib/selftest/*.py
60
ctags-exuberant -e $(tag_files)
63
# Produce HTML docs to upload on Canonical server
65
PRETTYDIR := pretty_docs
68
python tools/win32/ostools.py copytodir $(htm_files) doc/default.css $(HTMLDIR)
71
# translate txt docs to html
73
txt_files := $(wildcard $(addsuffix /*.txt, $(doc_dir))) doc/bzr_man.txt
74
htm_files := $(patsubst %.txt, %.htm, $(txt_files))
76
pretty-html-docs: pretty_files
79
python -c "import os; os.mkdir('$(PRETTYDIR)')"
81
pretty_files: $(patsubst doc/%.txt, $(PRETTYDIR)/%.htm, $(txt_files))
83
doc/HACKING.htm: HACKING
84
python tools/rst2html.py --link-stylesheet --stylesheet=default.css HACKING doc/HACKING.htm
87
python tools/rst2html.py --link-stylesheet --stylesheet=default.css doc/$*.txt doc/$*.htm
89
$(PRETTYDIR)/%.htm: pretty_docs doc/%.txt
90
python tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid doc/$*.txt \
93
MAN_DEPENDENCIES = bzrlib/builtins.py \
94
bzrlib/bundle/commands.py \
96
bzrlib/sign_my_commits.py \
98
tools/doc_generate/__init__.py \
99
tools/doc_generate/autodoc_rstx.py
101
doc/bzr_man.txt: $(MAN_DEPENDENCIES)
102
python generate_docs.py -o $@ rstx
104
MAN_PAGES = man1/bzr.1
105
man1/bzr.1: $(MAN_DEPENDENCIES)
106
python generate_docs.py -o $@ man
108
docs: $(htm_files) $(MAN_PAGES) doc/HACKING.htm
111
python tools/win32/ostools.py copytodir $(htm_files) doc/default.css NEWS README win32_bzr.exe/doc
113
# clean produced docs
115
python tools/win32/ostools.py remove $(htm_files) \
116
$(HTMLDIR) $(PRETTYDIR) doc/bzr_man.txt $(MAN_PAGES)
119
# make bzr.exe for win32 with py2exe
121
@echo *** Make bzr.exe
122
python setup.py py2exe > py2exe.log
123
python tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
124
python tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_bzr.exe
126
# win32 installer for bzr.exe
127
installer: exe copy-docs
128
@echo *** Make windows installer
129
cog.py -d -o tools/win32/bzr.iss tools/win32/bzr.iss.cog
130
iscc /Q tools/win32/bzr.iss
132
# win32 python's distutils-based installer
133
# require to have python interpreter installed on win32
134
python-installer: docs
135
python setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
138
# clean on win32 all installer-related files and directories
140
python tools/win32/ostools.py remove build
141
python tools/win32/ostools.py remove win32_bzr.exe
142
python tools/win32/ostools.py remove py2exe.log
143
python tools/win32/ostools.py remove doc/*.htm
144
python tools/win32/ostools.py remove doc/bzr_man.txt
145
python tools/win32/ostools.py remove tools/win32/bzr.iss
146
python tools/win32/ostools.py remove bzr-setup*.exe
147
python tools/win32/ostools.py remove bzr-*win32.exe
148
python tools/win32/ostools.py remove dist