13
13
# You should have received a copy of the GNU General Public License
14
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
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
# A relatively simple Makefile to assist in building parts of bzr. Mostly for
18
18
# building documentation, etc.
84
88
# translate txt docs to html
85
89
derived_txt_files := \
86
90
doc/en/user-reference/bzr_man.txt \
87
doc/en/developer-guide/HACKING.txt \
88
91
doc/en/release-notes/NEWS.txt
89
txt_files := $(wildcard doc/en/tutorials/*.txt) \
93
doc/en/tutorials/tutorial.txt \
94
doc/en/tutorials/using_bazaar_with_launchpad.txt \
95
doc/en/tutorials/centralized_workflow.txt \
96
$(wildcard doc/ru/tutorials/*.txt) \
97
$(wildcard doc/*/mini-tutorial/index.txt) \
98
$(wildcard doc/*/user-guide/index.txt) \
90
99
$(derived_txt_files) \
91
doc/en/user-guide/index.txt \
92
doc/en/mini-tutorial/index.txt \
100
doc/en/developer-guide/HACKING.txt \
101
doc/en/upgrade-guide/index.txt \
93
102
$(wildcard doc/es/guia-usario/*.txt) \
94
103
doc/es/mini-tutorial/index.txt \
105
$(wildcard doc/index.*.txt)
97
106
non_txt_files := \
99
doc/en/quick-reference/quick-start-summary.svg \
100
doc/en/quick-reference/quick-start-summary.png \
101
doc/en/quick-reference/quick-start-summary.pdf \
102
$(wildcard doc/en/user-guide/images/*.png) \
103
doc/es/referencia-rapida/referencia-rapida.svg \
104
doc/es/referencia-rapida/referencia-rapida.png \
105
doc/es/referencia-rapida/referencia-rapida.pdf \
106
$(wildcard doc/es/guia-usuario/images/*.png)
108
$(wildcard doc/*/quick-reference/bzr-quick-reference.svg) \
109
$(wildcard doc/*/quick-reference/bzr-quick-reference.png) \
110
$(wildcard doc/*/quick-reference/bzr-quick-reference.pdf) \
111
$(wildcard doc/*/user-guide/images/*.png)
107
112
htm_files := $(patsubst %.txt, %.html, $(txt_files))
108
dev_txt_files := $(wildcard $(addsuffix /*.txt, doc/developers))
114
# doc/developers/*.txt files that should *not* be individually
117
doc/developers/add.txt \
118
doc/developers/annotate.txt \
119
doc/developers/bundle-creation.txt \
120
doc/developers/commit.txt \
121
doc/developers/diff.txt \
122
doc/developers/directory-fingerprints.txt \
123
doc/developers/gc.txt \
124
doc/developers/incremental-push-pull.txt \
125
doc/developers/initial-push-pull.txt \
126
doc/developers/merge-scaling.txt \
127
doc/developers/missing.txt \
128
doc/developers/performance-roadmap-rationale.txt \
129
doc/developers/performance-use-case-analysis.txt \
130
doc/developers/planned-change-integration.txt \
131
doc/developers/planned-performance-changes.txt \
132
doc/developers/revert.txt \
133
doc/developers/status.txt \
134
doc/developers/uncommit.txt
136
dev_txt_all := $(wildcard $(addsuffix /*.txt, doc/developers))
137
dev_txt_files := $(filter-out $(dev_txt_nohtml), $(dev_txt_all))
109
138
dev_htm_files := $(patsubst %.txt, %.html, $(dev_txt_files))
111
doc/en/user-guide/index.html: $(wildcard $(addsuffix /*.txt, doc/en/user-guide))
112
$(rst2html) --stylesheet=../../default.css doc/en/user-guide/index.txt $@
140
doc/%/user-guide/index.html: $(wildcard $(addsuffix /*.txt, doc/%/user-guide))
141
$(rst2html) --stylesheet=../../default.css $(dir $@)index.txt $@
114
143
# Set the paper size for PDF files.
115
144
# Options: 'a4' (ISO A4 size), 'letter' (US Letter size)
146
# TODO: Add generation for Russian PDF
117
147
PDF_DOCS := doc/en/user-guide/user-guide.$(PAPERSIZE).pdf
119
149
# Copy and modify the RST sources, and convert SVG images to PDF
137
167
doc/index.html: doc/index.txt
138
168
$(rst2html) --stylesheet=default.css $< $@
170
doc/index.%.html: doc/index.%.txt
171
$(rst2html) --stylesheet=default.css $< $@
141
174
$(rst2html) --stylesheet=../../default.css $< $@
143
176
MAN_DEPENDENCIES = bzrlib/builtins.py \
144
bzrlib/bundle/commands.py \
145
bzrlib/conflicts.py \
146
bzrlib/help_topics/__init__.py \
148
bzrlib/sign_my_commits.py \
149
bzrlib/bugtracker.py \
151
tools/doc_generate/__init__.py \
152
tools/doc_generate/autodoc_man.py \
153
tools/doc_generate/autodoc_rstx.py \
154
$(wildcard $(addsuffix /*.txt, bzrlib/help_topics/en))
177
$(wildcard bzrlib/*.py) \
178
$(wildcard bzrlib/*/*.py) \
179
tools/generate_docs.py \
180
$(wildcard $(addsuffix /*.txt, bzrlib/help_topics/en))
156
182
doc/en/user-reference/bzr_man.txt: $(MAN_DEPENDENCIES)
157
$(PYTHON) generate_docs.py -o $@ rstx
159
doc/en/developer-guide/HACKING.txt: doc/developers/HACKING.txt
160
$(PYTHON) tools/win32/ostools.py copytodir doc/developers/HACKING.txt doc/en/developer-guide
183
$(PYTHON) tools/generate_docs.py -o $@ rstx
162
185
doc/en/release-notes/NEWS.txt: NEWS
163
186
$(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
165
188
MAN_PAGES = man1/bzr.1
166
189
man1/bzr.1: $(MAN_DEPENDENCIES)
167
$(PYTHON) generate_docs.py -o $@ man
190
$(PYTHON) tools/generate_docs.py -o $@ man
192
upgrade_guide_dependencies = $(wildcard $(addsuffix /*.txt, doc/en/upgrade-guide))
194
doc/en/upgrade-guide/index.html: $(upgrade_guide_dependencies)
195
$(rst2html) --stylesheet=../../default.css $(dir $@)index.txt $@
169
197
# build a png of our performance task list
199
# this is no longer built by default; you can build it if you want to look at it
170
200
doc/developers/performance.png: doc/developers/performance.dot
171
201
@echo Generating $@
172
202
@dot -Tpng $< -o$@ || echo "Dot not installed; skipping generation of $@"
174
derived_web_docs = $(htm_files) $(dev_htm_files) doc/developers/performance.png
204
derived_web_docs = $(htm_files) $(dev_htm_files)
175
205
WEB_DOCS = $(derived_web_docs) $(non_txt_files)
176
206
ALL_DOCS = $(derived_web_docs) $(MAN_PAGES)
191
221
$(PYTHON) tools/win32/ostools.py remove $(ALL_DOCS) \
192
222
$(HTMLDIR) $(derived_txt_files)
193
rm -f doc/en/user-guide/*.pdf
194
rm -rf doc/en/user-guide/latex_prepared
223
rm -f doc/*/user-guide/*.pdf
224
rm -rf doc/*/user-guide/latex_prepared
197
227
### Windows Support ###
229
# make all the installers completely from scratch, using zc.buildout
230
# to fetch the dependencies
232
@echo *** Make all the installers from scratch
233
cd tools/win32 && $(PYTHON) bootstrap.py
234
cd tools/win32 && bin/buildout
235
cd tools/win32 && bin/build-installer.bat $(BZR_TARGET) $(PLUGIN_TARGET)
239
$(PYTHON) tools/win32/ostools.py remove tools/win32/.installed.cfg
240
$(PYTHON) tools/win32/ostools.py remove tools/win32/bin/
241
$(PYTHON) tools/win32/ostools.py remove tools/win32/bzr/
242
$(PYTHON) tools/win32/ostools.py remove tools/win32/bzr-rebase/
243
$(PYTHON) tools/win32/ostools.py remove tools/win32/bzr-svn/
244
$(PYTHON) tools/win32/ostools.py remove tools/win32/bzrtools/
245
$(PYTHON) tools/win32/ostools.py remove tools/win32/db4/
246
$(PYTHON) tools/win32/ostools.py remove tools/win32/develop-eggs/
247
$(PYTHON) tools/win32/ostools.py remove tools/win32/libintl/
248
$(PYTHON) tools/win32/ostools.py remove tools/win32/parts/
249
$(PYTHON) tools/win32/ostools.py remove tools/win32/qbzr/
250
$(PYTHON) tools/win32/ostools.py remove tools/win32/subvertpy/
251
$(PYTHON) tools/win32/ostools.py remove tools/win32/svn/
252
$(PYTHON) tools/win32/ostools.py remove tools/win32/tbzr/
253
$(PYTHON) tools/win32/ostools.py remove tools/win32/tortoise-overlays/
254
$(PYTHON) tools/win32/ostools.py remove tools/win32/zlib/
199
256
# make bzr.exe for win32 with py2exe
201
258
@echo *** Make bzr.exe
259
$(PYTHON) tools/win32/ostools.py remove bzrlib/*.pyd
202
260
$(PYTHON) setup.py build_ext -i -f $(PYTHON_BUILDFLAGS)
203
261
$(PYTHON) setup.py py2exe > py2exe.log
204
262
$(PYTHON) tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
207
265
# win32 installer for bzr.exe
208
266
installer: exe copy-docs
209
@echo *** Make windows installer
267
@echo *** Make Windows installer
210
268
$(PYTHON) tools/win32/run_script.py cog.py -d -o tools/win32/bzr.iss tools/win32/bzr.iss.cog
211
269
iscc /Q tools/win32/bzr.iss
213
271
# win32 Python's distutils-based installer
214
272
# require to have Python interpreter installed on win32
216
python24 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
274
$(PYTHON24) setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
219
python25 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
221
python-installer: py-inst-24 py-inst-25
277
$(PYTHON25) setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
280
python26 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
282
python-installer: py-inst-24 py-inst-25 py-inst-26