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.
23
.PHONY: all clean extensions pyflakes api-docs
28
@echo "building extension modules."
29
python setup.py build_ext -i
31
check: docs extensions
32
python -Werror -O ./bzr selftest -1v $(tests)
4
python -Werror ./bzr selftest -v $(tests)
33
5
@echo "Running all tests with no locale."
34
LC_CTYPE= LANG=C LC_ALL= ./bzr selftest -1v $(tests) 2>&1 | sed -e 's/^/[ascii] /'
6
LC_CTYPE= LANG=C LC_ALL= ./bzr selftest -v $(tests)
7
python -O -Werror ./bzr selftest -v $(tests)
37
10
./bzr --no-plugins selftest -v msgeditor
64
32
ctags-exuberant -e $(tag_files)
69
# set PRETTY to get docs that look like the Bazaar web site
71
rst2html := python tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid
73
rst2html := python tools/rst2html.py --link-stylesheet --footnote-references=superscript
35
# Produce HTML docs to upload on Canonical server
37
PRETTYDIR := pretty_docs
40
python tools/win32/ostools.py copytodir $(htm_files) doc/default.css $(HTMLDIR)
76
43
# translate txt docs to html
77
derived_txt_files := \
78
doc/en/user-reference/bzr_man.txt \
79
doc/en/developer-guide/HACKING.txt \
80
doc/en/release-notes/NEWS.txt
81
doc_dir := doc/en/user-guide
82
txt_files := $(wildcard $(addsuffix /*.txt, $(doc_dir))) $(derived_txt_files) \
83
doc/en/mini-tutorial/index.txt \
87
doc/en/quick-reference/quick-start-summary.svg
88
htm_files := $(patsubst %.txt, %.html, $(txt_files))
89
dev_txt_files := $(wildcard $(addsuffix /*.txt, doc/developers))
90
dev_htm_files := $(patsubst %.txt, %.html, $(dev_txt_files))
92
doc/developers/%.html: doc/developers/%.txt
93
$(rst2html) --stylesheet=../default.css $< $@
95
doc/index.html: doc/index.txt
96
$(rst2html) --stylesheet=default.css $< $@
99
$(rst2html) --stylesheet=../../default.css $< $@
101
MAN_DEPENDENCIES = bzrlib/builtins.py \
45
txt_files := $(wildcard $(addsuffix /*.txt, $(doc_dir))) doc/bzr_man.txt
46
htm_files := $(patsubst %.txt, %.htm, $(txt_files))
48
pretty-html-docs: pretty_files
51
python -c "import os; os.mkdir('$(PRETTYDIR)')"
53
pretty_files: $(patsubst doc/%.txt, $(PRETTYDIR)/%.htm, $(txt_files))
56
python tools/rst2html.py --link-stylesheet --stylesheet=default.css doc/$*.txt doc/$*.htm
58
$(PRETTYDIR)/%.htm: pretty_docs doc/%.txt
59
python tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid doc/$*.txt \
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
tools/doc_generate/autodoc_man.py \
108
68
tools/doc_generate/autodoc_rstx.py
110
doc/en/user-reference/bzr_man.txt: $(MAN_DEPENDENCIES)
111
python generate_docs.py -o $@ rstx
113
doc/en/developer-guide/HACKING.txt: doc/developers/HACKING.txt
114
python tools/win32/ostools.py copytodir doc/developers/HACKING.txt doc/en/developer-guide
116
doc/en/release-notes/NEWS.txt: NEWS
117
python -c "import shutil; shutil.copyfile('$<', '$@')"
119
MAN_PAGES = man1/bzr.1
120
man1/bzr.1: $(MAN_DEPENDENCIES)
121
python generate_docs.py -o $@ man
123
# build a png of our performance task list
124
doc/developers/performance.png: doc/developers/performance.dot
126
@dot -Tpng $< -o$@ || echo "Dot not installed; skipping generation of $@"
128
derived_web_docs = $(htm_files) $(dev_htm_files) doc/developers/performance.png
129
WEB_DOCS = $(derived_web_docs) $(non_txt_files)
130
ALL_DOCS = $(derived_web_docs) $(MAN_PAGES)
132
# the main target to build all the docs
135
# produce a tree containing just the final docs, ready for uploading to the web
138
python tools/win32/ostools.py copytree $(WEB_DOCS) $(HTMLDIR)
69
python generate_docs.py -o doc/bzr_man.txt rstx
74
python tools/win32/ostools.py copytodir $(htm_files) doc/default.css NEWS README win32_bzr.exe/doc
140
76
# clean produced docs
142
python tools/win32/ostools.py remove $(ALL_DOCS) \
143
$(HTMLDIR) $(derived_txt_files)
146
### Windows Support ###
78
python tools/win32/ostools.py remove doc/bzr_man.txt $(htm_files) \
79
$(HTMLDIR) $(PRETTYDIR)
148
82
# make bzr.exe for win32 with py2exe
150
84
@echo *** Make bzr.exe
151
python setup.py build_ext -i -f
152
85
python setup.py py2exe > py2exe.log
153
86
python tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
154
87
python tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_bzr.exe
162
95
# win32 python's distutils-based installer
163
96
# require to have python interpreter installed on win32
164
97
python-installer: docs
165
python24 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
166
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 .
169
python tools/win32/ostools.py copytodir README win32_bzr.exe/doc
170
python tools/win32/ostools.py copytree $(WEB_DOCS) win32_bzr.exe
172
101
# clean on win32 all installer-related files and directories
173
clean-win32: clean-docs
174
103
python tools/win32/ostools.py remove build
175
104
python tools/win32/ostools.py remove win32_bzr.exe
176
105
python tools/win32/ostools.py remove py2exe.log
106
python tools/win32/ostools.py remove doc/*.htm
107
python tools/win32/ostools.py remove doc/bzr_man.txt
177
108
python tools/win32/ostools.py remove tools/win32/bzr.iss
178
109
python tools/win32/ostools.py remove bzr-setup*.exe
179
110
python tools/win32/ostools.py remove bzr-*win32.exe