44
48
pyflakes bzrlib | grep -v ' imported but unused'
48
-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
54
# Build API documentation
51
55
docfiles = bzr bzrlib
54
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)
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)
60
PYTHONPATH=$(PWD) $(PYTHON) tools/bzr_epydoc --check --docformat 'restructuredtext en' $(docfiles)
62
# build tags for emacs and vim
69
# these are treated as phony so they'll always be rebuilt - it's pretty quick
74
# set PRETTY to get docs that look like the Bazaar web site
76
rst2html := $(PYTHON) tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid
78
rst2html := $(PYTHON) tools/rst2html.py --link-stylesheet --footnote-references=superscript --halt=warning
74
81
# translate txt docs to html
76
txt_files := $(wildcard $(addsuffix /*.txt, $(doc_dir))) doc/bzr_man.txt
77
htm_files := $(patsubst %.txt, %.htm, $(txt_files))
82
derived_txt_files := \
83
doc/en/user-reference/bzr_man.txt \
84
doc/en/developer-guide/HACKING.txt \
85
doc/en/release-notes/NEWS.txt
86
doc_dir := doc/en/tutorials
87
txt_files := $(wildcard $(addsuffix /*.txt, $(doc_dir))) $(derived_txt_files) \
88
doc/en/user-guide/index.txt \
89
doc/en/mini-tutorial/index.txt \
93
doc/en/quick-reference/quick-start-summary.svg \
94
doc/en/quick-reference/quick-start-summary.png \
95
doc/en/quick-reference/quick-start-summary.pdf \
96
$(wildcard doc/en/user-guide/images/*.png)
97
htm_files := $(patsubst %.txt, %.html, $(txt_files))
78
98
dev_txt_files := $(wildcard $(addsuffix /*.txt, doc/developers))
79
dev_htm_files := $(patsubst %.txt, %.htm, $(dev_txt_files))
81
pretty-html-docs: pretty_files
84
python -c "import os; os.mkdir('$(PRETTYDIR)')"
86
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 $< $@
97
$(PRETTYDIR)/%.htm: pretty_docs doc/%.txt
98
python tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid doc/$*.txt \
99
dev_htm_files := $(patsubst %.txt, %.html, $(dev_txt_files))
101
doc/en/user-guide/index.html: $(wildcard $(addsuffix /*.txt, doc/en/user-guide))
102
$(rst2html) --stylesheet=../../default.css doc/en/user-guide/index.txt $@
104
doc/developers/%.html: doc/developers/%.txt
105
$(rst2html) --stylesheet=../default.css $< $@
107
doc/index.html: doc/index.txt
108
$(rst2html) --stylesheet=default.css $< $@
111
$(rst2html) --stylesheet=../../default.css $< $@
101
113
MAN_DEPENDENCIES = bzrlib/builtins.py \
102
114
bzrlib/bundle/commands.py \
103
115
bzrlib/conflicts.py \
116
bzrlib/help_topics/__init__.py \
104
117
bzrlib/sign_my_commits.py \
118
bzrlib/bugtracker.py \
105
119
generate_docs.py \
106
120
tools/doc_generate/__init__.py \
107
tools/doc_generate/autodoc_rstx.py
109
doc/bzr_man.txt: $(MAN_DEPENDENCIES)
110
python generate_docs.py -o $@ rstx
121
tools/doc_generate/autodoc_man.py \
122
tools/doc_generate/autodoc_rstx.py \
123
$(wildcard $(addsuffix /*.txt, bzrlib/help_topics/en))
125
doc/en/user-reference/bzr_man.txt: $(MAN_DEPENDENCIES)
126
$(PYTHON) generate_docs.py -o $@ rstx
128
doc/en/developer-guide/HACKING.txt: doc/developers/HACKING.txt
129
$(PYTHON) tools/win32/ostools.py copytodir doc/developers/HACKING.txt doc/en/developer-guide
131
doc/en/release-notes/NEWS.txt: NEWS
132
$(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
112
134
MAN_PAGES = man1/bzr.1
113
135
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)
136
$(PYTHON) generate_docs.py -o $@ man
138
# build a png of our performance task list
139
doc/developers/performance.png: doc/developers/performance.dot
141
@dot -Tpng $< -o$@ || echo "Dot not installed; skipping generation of $@"
143
derived_web_docs = $(htm_files) $(dev_htm_files) doc/developers/performance.png
144
WEB_DOCS = $(derived_web_docs) $(non_txt_files)
145
ALL_DOCS = $(derived_web_docs) $(MAN_PAGES)
147
# the main target to build all the docs
117
148
docs: $(ALL_DOCS)
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
150
# produce a tree containing just the final docs, ready for uploading to the web
153
$(PYTHON) tools/win32/ostools.py copytree $(WEB_DOCS) $(HTMLDIR)
127
155
# clean produced docs
129
python tools/win32/ostools.py remove $(ALL_DOCS) \
130
$(HTMLDIR) $(PRETTYDIR) doc/bzr_man.txt
157
$(PYTHON) tools/win32/ostools.py remove $(ALL_DOCS) \
158
$(HTMLDIR) $(derived_txt_files)
161
### Windows Support ###
133
163
# make bzr.exe for win32 with py2exe
135
165
@echo *** Make bzr.exe
136
python setup.py py2exe > py2exe.log
137
python tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
138
python tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_bzr.exe
166
$(PYTHON) setup.py build_ext -i -f
167
$(PYTHON) setup.py py2exe > py2exe.log
168
$(PYTHON) tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
169
$(PYTHON) tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_bzr.exe
140
171
# win32 installer for bzr.exe
141
172
installer: exe copy-docs
143
174
cog.py -d -o tools/win32/bzr.iss tools/win32/bzr.iss.cog
144
175
iscc /Q tools/win32/bzr.iss
146
# win32 python's distutils-based installer
147
# require to have python interpreter installed on win32
148
python-installer: docs
149
python setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
177
# win32 Python's distutils-based installer
178
# require to have Python interpreter installed on win32
180
python24 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
183
python25 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
185
python-installer: py-inst-24 py-inst-25
189
$(PYTHON) tools/win32/ostools.py copytodir README win32_bzr.exe/doc
190
$(PYTHON) tools/win32/ostools.py copytree $(WEB_DOCS) win32_bzr.exe
152
192
# clean on win32 all installer-related files and directories
154
python tools/win32/ostools.py remove build
155
python tools/win32/ostools.py remove win32_bzr.exe
156
python tools/win32/ostools.py remove py2exe.log
157
python tools/win32/ostools.py remove doc/*.htm
158
python tools/win32/ostools.py remove doc/developers/*.htm
159
python tools/win32/ostools.py remove doc/bzr_man.txt
160
python tools/win32/ostools.py remove tools/win32/bzr.iss
161
python tools/win32/ostools.py remove bzr-setup*.exe
162
python tools/win32/ostools.py remove bzr-*win32.exe
163
python tools/win32/ostools.py remove dist
193
clean-win32: clean-docs
194
$(PYTHON) tools/win32/ostools.py remove build
195
$(PYTHON) tools/win32/ostools.py remove win32_bzr.exe
196
$(PYTHON) tools/win32/ostools.py remove py2exe.log
197
$(PYTHON) tools/win32/ostools.py remove tools/win32/bzr.iss
198
$(PYTHON) tools/win32/ostools.py remove bzr-setup*.exe
199
$(PYTHON) tools/win32/ostools.py remove bzr-*win32.exe
200
$(PYTHON) tools/win32/ostools.py remove dist