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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
17
# A relatively simple Makefile to assist in building parts of bzr. Mostly for
18
18
# building documentation, etc.
26
.PHONY: all clean extensions pyflakes api-docs check-nodocs check
25
.PHONY: all clean extensions pyflakes api-docs
31
30
@echo "building extension modules."
32
$(PYTHON) setup.py build_ext -i $(PYTHON_BUILDFLAGS)
34
check: docs check-nodocs
36
check-nodocs: extensions
31
$(PYTHON) setup.py build_ext -i
33
check: docs extensions
37
34
$(PYTHON) -Werror -O ./bzr selftest -1v $(tests)
38
35
@echo "Running all tests with no locale."
39
36
LC_CTYPE= LANG=C LC_ALL= ./bzr selftest -1v $(tests) 2>&1 | sed -e 's/^/[ascii] /'
111
108
doc/en/user-guide/index.html: $(wildcard $(addsuffix /*.txt, doc/en/user-guide))
112
109
$(rst2html) --stylesheet=../../default.css doc/en/user-guide/index.txt $@
114
# Set the paper size for PDF files.
115
# Options: 'a4' (ISO A4 size), 'letter' (US Letter size)
117
PDF_DOCS := doc/en/user-guide/user-guide.$(PAPERSIZE).pdf
119
# Copy and modify the RST sources, and convert SVG images to PDF
120
# files for use a images in the LaTeX-generated PDF.
121
# Then generate the PDF output from the modified RST sources.
122
doc/en/user-guide/user-guide.$(PAPERSIZE).pdf: $(wildcard $(addsuffix /*.txt, doc/en/user-guide))
123
mkdir -p doc/en/user-guide/latex_prepared
124
$(PYTHON) tools/prepare_for_latex.py \
125
--out-dir=doc/en/user-guide/latex_prepared \
126
--in-dir=doc/en/user-guide
127
cd doc/en/user-guide/latex_prepared && \
128
$(PYTHON) ../../../../tools/rst2pdf.py \
129
--documentoptions=10pt,$(PAPERSIZE)paper \
130
--input-encoding=UTF-8:strict --output-encoding=UTF-8:strict \
131
--strict --title="Bazaar User Guide" \
132
index.txt ../user-guide.$(PAPERSIZE).pdf
134
111
doc/developers/%.html: doc/developers/%.txt
135
112
$(rst2html) --stylesheet=../default.css $< $@
184
160
$(PYTHON) tools/win32/ostools.py copytree $(WEB_DOCS) $(HTMLDIR)
186
# Produce PDF documents. Requires pdfLaTeX, rubber, and Inkscape.
187
pdf-docs: $(PDF_DOCS)
189
162
# clean produced docs
191
164
$(PYTHON) tools/win32/ostools.py remove $(ALL_DOCS) \
192
$(HTMLDIR) $(derived_txt_files)
193
rm -f doc/en/user-guide/*.pdf
194
rm -rf doc/en/user-guide/latex_prepared
165
$(HTMLDIR) $(derived_txt_files)
197
168
### Windows Support ###
199
170
# make bzr.exe for win32 with py2exe
201
172
@echo *** Make bzr.exe
202
$(PYTHON) setup.py build_ext -i -f $(PYTHON_BUILDFLAGS)
173
$(PYTHON) setup.py build_ext -i -f
203
174
$(PYTHON) setup.py py2exe > py2exe.log
204
175
$(PYTHON) tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
205
176
$(PYTHON) tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_bzr.exe
207
178
# win32 installer for bzr.exe
208
179
installer: exe copy-docs
209
180
@echo *** Make windows installer
210
$(PYTHON) tools/win32/run_script.py cog.py -d -o tools/win32/bzr.iss tools/win32/bzr.iss.cog
181
cog.py -d -o tools/win32/bzr.iss tools/win32/bzr.iss.cog
211
182
iscc /Q tools/win32/bzr.iss
213
184
# win32 Python's distutils-based installer
238
209
.PHONY: dist dist-upload-escudero check-dist-tarball
240
# build a distribution tarball and zip file.
211
# build a distribution tarball.
242
213
# this method of copying the pyrex generated files is a bit ugly; it would be
243
214
# nicer to generate it from distutils.
216
# these are a bit ubuntu-specific.
245
218
version=`./bzr version --short` && \
246
219
echo Building distribution of bzr $$version && \
247
220
expbasedir=`mktemp -t -d tmp_bzr_dist.XXXXXXXXXX` && \
248
221
expdir=$$expbasedir/bzr-$$version && \
249
222
tarball=$$PWD/../bzr-$$version.tar.gz && \
250
zipball=$$PWD/../bzr-$$version.zip && \
251
223
$(MAKE) clean && \
253
225
bzr export $$expdir && \
254
226
cp bzrlib/*.c $$expdir/bzrlib/. && \
255
227
tar cfz $$tarball -C $$expbasedir bzr-$$version && \
256
(cd $$expbasedir && zip -r $$zipball bzr-$$version) && \
257
228
gpg --detach-sign $$tarball && \
258
gpg --detach-sign $$zipball && \
229
echo $$tarball done. && \
259
230
rm -rf $$expbasedir
261
232
# run all tests in a previously built tarball
273
244
dist-upload-escudero:
274
245
version=`./bzr version --short` && \
275
246
tarball=../bzr-$$version.tar.gz && \
276
zipball=../bzr-$$version.zip && \
277
scp $$zipball $$zipball.sig $$tarball $$tarball.sig \
247
scp $$tarball $$tarball.sig \
278
248
escudero.ubuntu.com:/srv/bazaar.canonical.com/www/releases/src \
280
250
echo verifying over http... && \
281
curl http://bazaar-vcs.org/releases/src/bzr-$$version.zip \
282
| diff -s - $$zipball && \
283
curl http://bazaar-vcs.org/releases/src/bzr-$$version.zip.sig \
284
| diff -s - $$zipball.sig
285
251
curl http://bazaar-vcs.org/releases/src/bzr-$$version.tar.gz \
286
252
| diff -s - $$tarball && \
287
253
curl http://bazaar-vcs.org/releases/src/bzr-$$version.tar.gz.sig \