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
4
python -Werror ./bzr selftest -v $(tests)
30
5
@echo "Running all tests with no locale."
31
6
LC_CTYPE= LANG=C LC_ALL= ./bzr selftest -v $(tests)
44
19
pyflakes bzrlib | grep -v ' imported but unused'
48
23
-find . -name "*.pyc" -o -name "*.pyo" | xargs rm -f
49
24
rm -rf test????.tmp
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
29
# build emacs cross-reference
76
45
txt_files := $(wildcard $(addsuffix /*.txt, $(doc_dir))) doc/bzr_man.txt
77
46
htm_files := $(patsubst %.txt, %.htm, $(txt_files))
78
dev_txt_files := $(wildcard $(addsuffix /*.txt, doc/developers))
79
dev_htm_files := $(patsubst %.txt, %.htm, $(dev_txt_files))
81
48
pretty-html-docs: pretty_files
86
53
pretty_files: $(patsubst doc/%.txt, $(PRETTYDIR)/%.htm, $(txt_files))
88
doc/developers/%.htm: doc/developers/%.txt
89
python tools/rst2html.py --link-stylesheet --stylesheet=../default.css --footnote-references=superscript $< $@
91
doc/developers/HACKING.htm: doc/developers/HACKING
92
python tools/rst2html.py --link-stylesheet --stylesheet=../default.css --footnote-references=superscript $< $@
95
python tools/rst2html.py --link-stylesheet --stylesheet=default.css --footnote-references=superscript $< $@
56
python tools/rst2html.py --link-stylesheet --stylesheet=default.css doc/$*.txt doc/$*.htm
97
58
$(PRETTYDIR)/%.htm: pretty_docs doc/%.txt
98
59
python tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid doc/$*.txt \
99
60
$(PRETTYDIR)/$*.htm
101
MAN_DEPENDENCIES = bzrlib/builtins.py \
62
doc/bzr_man.txt: bzrlib/builtins.py \
102
63
bzrlib/bundle/commands.py \
103
64
bzrlib/conflicts.py \
104
65
bzrlib/sign_my_commits.py \
105
66
generate_docs.py \
106
67
tools/doc_generate/__init__.py \
107
68
tools/doc_generate/autodoc_rstx.py
109
doc/bzr_man.txt: $(MAN_DEPENDENCIES)
110
python generate_docs.py -o $@ rstx
112
MAN_PAGES = man1/bzr.1
113
man1/bzr.1: $(MAN_DEPENDENCIES)
114
python generate_docs.py -o $@ man
116
ALL_DOCS = $(htm_files) $(MAN_PAGES) doc/developers/HACKING.htm $(dev_htm_files) doc/developers/performance.png
69
python generate_docs.py -o doc/bzr_man.txt rstx
120
python tools/win32/ostools.py copytodir $(htm_files) \
121
doc/default.css NEWS README \
123
python tools/win32/ostools.py copytodir doc/developers/HACKING.htm \
125
win32_bzr.exe/doc/developers
74
python tools/win32/ostools.py copytodir $(htm_files) doc/default.css NEWS README win32_bzr.exe/doc
127
76
# clean produced docs
129
python tools/win32/ostools.py remove $(ALL_DOCS) \
130
$(HTMLDIR) $(PRETTYDIR) doc/bzr_man.txt doc/developers/performance.png
133
# build a png of our performance task list
134
doc/developers/performance.png: doc/developers/performance.dot
136
@dot -Tpng $< -o$@ || echo "Dot not installed; skipping generation of $@"
78
python tools/win32/ostools.py remove doc/bzr_man.txt $(htm_files) \
79
$(HTMLDIR) $(PRETTYDIR)
139
82
# make bzr.exe for win32 with py2exe
141
84
@echo *** Make bzr.exe
142
python setup.py build_ext -i -f
143
85
python setup.py py2exe > py2exe.log
144
86
python tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
145
87
python tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_bzr.exe
153
95
# win32 python's distutils-based installer
154
96
# require to have python interpreter installed on win32
155
97
python-installer: docs
156
python24 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
157
python25 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
98
python setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
160
101
# clean on win32 all installer-related files and directories
163
104
python tools/win32/ostools.py remove win32_bzr.exe
164
105
python tools/win32/ostools.py remove py2exe.log
165
106
python tools/win32/ostools.py remove doc/*.htm
166
python tools/win32/ostools.py remove doc/developers/*.htm
167
107
python tools/win32/ostools.py remove doc/bzr_man.txt
168
108
python tools/win32/ostools.py remove tools/win32/bzr.iss
169
109
python tools/win32/ostools.py remove bzr-setup*.exe