47
50
-find . -name "*.pyc" -o -name "*.pyo" | xargs rm -f
48
51
rm -rf test????.tmp
53
# Build API documentation
50
54
docfiles = bzr bzrlib
53
57
PYTHONPATH=$(PWD) python tools/bzr_epydoc --html -o api/html --docformat 'restructuredtext en' $(docfiles)
56
59
PYTHONPATH=$(PWD) python tools/bzr_epydoc --check --docformat 'restructuredtext en' $(docfiles)
59
61
# build emacs cross-reference
60
62
tag_files=./bzr ./bzrlib/*py ./bzrlib/selftest/*.py
62
64
ctags-exuberant -e $(tag_files)
65
# Produce HTML docs to upload on Canonical server
67
PRETTYDIR := pretty_docs
70
python tools/win32/ostools.py copytodir $(htm_files) doc/default.css $(HTMLDIR)
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
73
76
# translate txt docs to html
75
txt_files := $(wildcard $(addsuffix /*.txt, $(doc_dir))) doc/bzr_man.txt
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
76
88
htm_files := $(patsubst %.txt, %.html, $(txt_files))
77
89
dev_txt_files := $(wildcard $(addsuffix /*.txt, doc/developers))
78
90
dev_htm_files := $(patsubst %.txt, %.html, $(dev_txt_files))
80
pretty-html-docs: pretty_files
83
python -c "import os; os.mkdir('$(PRETTYDIR)')"
85
pretty_files: $(patsubst doc/%.txt, $(PRETTYDIR)/%.html, $(txt_files))
87
92
doc/developers/%.html: doc/developers/%.txt
88
python tools/rst2html.py --link-stylesheet --stylesheet=../default.css --footnote-references=superscript $< $@
93
$(rst2html) --stylesheet=../default.css $< $@
95
doc/index.html: doc/index.txt
96
$(rst2html) --stylesheet=default.css $< $@
91
python tools/rst2html.py --link-stylesheet --stylesheet=default.css --footnote-references=superscript $< $@
93
$(PRETTYDIR)/%.html: pretty_docs doc/%.txt
94
python tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid doc/$*.txt \
99
$(rst2html) --stylesheet=../../default.css $< $@
97
101
MAN_DEPENDENCIES = bzrlib/builtins.py \
98
102
bzrlib/bundle/commands.py \
103
107
tools/doc_generate/autodoc_man.py \
104
108
tools/doc_generate/autodoc_rstx.py
106
doc/bzr_man.txt: $(MAN_DEPENDENCIES)
110
doc/en/user-reference/bzr_man.txt: $(MAN_DEPENDENCIES)
107
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('$<', '$@')"
109
119
MAN_PAGES = man1/bzr.1
110
120
man1/bzr.1: $(MAN_DEPENDENCIES)
111
121
python generate_docs.py -o $@ man
113
ALL_DOCS = $(htm_files) $(MAN_PAGES) $(dev_htm_files) doc/developers/performance.png
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
114
133
docs: $(ALL_DOCS)
117
python tools/win32/ostools.py copytodir $(htm_files) \
118
doc/default.css NEWS README \
120
python tools/win32/ostools.py copytodir $(dev_htm_files) \
121
win32_bzr.exe/doc/developers
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)
123
140
# clean produced docs
125
142
python tools/win32/ostools.py remove $(ALL_DOCS) \
126
$(HTMLDIR) $(PRETTYDIR) doc/bzr_man.txt
129
# build a png of our performance task list
130
doc/developers/performance.png: doc/developers/performance.dot
132
@dot -Tpng $< -o$@ || echo "Dot not installed; skipping generation of $@"
143
$(HTMLDIR) $(derived_txt_files)
146
### Windows Support ###
135
148
# make bzr.exe for win32 with py2exe
152
165
python24 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
153
166
python25 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
156
172
# clean on win32 all installer-related files and directories
157
173
clean-win32: clean-docs
158
174
python tools/win32/ostools.py remove build
159
175
python tools/win32/ostools.py remove win32_bzr.exe
160
176
python tools/win32/ostools.py remove py2exe.log
161
python tools/win32/ostools.py remove doc/bzr_man.txt
162
177
python tools/win32/ostools.py remove tools/win32/bzr.iss
163
178
python tools/win32/ostools.py remove bzr-setup*.exe
164
179
python tools/win32/ostools.py remove bzr-*win32.exe