1
# Copyright (C) 2005-2012, 2016 Canonical Ltd
1
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
39
39
check: docs check-nodocs
41
41
check-nodocs: extensions
43
# Generate a stream for PQM to watch.
44
-$(RM) -f selftest.log
45
echo `date` ": selftest starts" 1>&2
46
$(PYTHON) -Werror -Wignore::ImportWarning -O ./bzr selftest -Oselftest.timeout=120 \
47
--subunit $(tests) | tee selftest.log
48
echo `date` ": selftest ends" 1>&2
49
# An empty log file should catch errors in the $(PYTHON)
50
# command above (the '|' swallow any errors since 'make'
51
# sees the 'tee' exit code for the whole line
52
if [ ! -s selftest.log ] ; then exit 1 ; fi
53
# Check that there were no errors reported.
54
subunit-stats < selftest.log
42
$(PYTHON) -Werror -O ./bzr selftest -1v $(tests)
43
@echo "Running all tests with no locale."
44
LC_CTYPE= LANG=C LC_ALL= ./bzr selftest -1v $(tests) 2>&1 | sed -e 's/^/[ascii] /'
56
46
# Run Python style checker (apt-get install pyflakes)
69
59
$(PYTHON) setup.py clean
70
60
-find . -name "*.pyc" -o -name "*.pyo" -o -name "*.so" | xargs rm -f
73
# Remove files which are autogenerated but included by the tarball.
75
rm -f bzrlib/_simple_set_pyx.h bzrlib/_simple_set_pyx_api.h
77
62
# Build API documentation
78
63
docfiles = bzr bzrlib
81
pydoctor --make-html --docformat='restructuredtext' --html-output=api/html $(docfiles)
66
PYTHONPATH=$(PWD) $(PYTHON) tools/bzr_epydoc --html -o api/html --docformat 'restructuredtext en' $(docfiles)
68
PYTHONPATH=$(PWD) $(PYTHON) tools/bzr_epydoc --check --docformat 'restructuredtext en' $(docfiles)
83
70
# build tags for emacs and vim
138
124
doc/en/user-reference/index.txt \
139
125
doc/es/Makefile \
140
126
doc/es/make.bat \
143
127
doc/ru/Makefile \
144
128
doc/ru/make.bat \
145
129
doc/developers/Makefile \
146
130
doc/developers/make.bat
148
NEWS_FILES = $(wildcard doc/en/release-notes/bzr-*.txt)
150
132
doc/en/user-reference/index.txt: $(MAN_DEPENDENCIES)
151
LANGUAGE=C $(PYTHON) tools/generate_docs.py -o $@ rstx
133
$(PYTHON) tools/generate_docs.py -o $@ rstx
153
doc/en/release-notes/index.txt: $(NEWS_FILES) tools/generate_release_notes.py
154
$(PYTHON) tools/generate_release_notes.py $@ $(NEWS_FILES)
135
doc/en/release-notes/index.txt: NEWS tools/generate_release_notes.py
136
$(PYTHON) tools/generate_release_notes.py NEWS $@
156
138
doc/%/Makefile: doc/en/Makefile
157
139
$(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
188
168
cd doc/en && make htmlhelp
189
169
cd doc/es && make htmlhelp
190
170
cd doc/ru && make htmlhelp
191
cd doc/ja && make htmlhelp
192
171
cd doc/developers && make htmlhelp
195
# Build the texinfo files using Sphinx.
196
texinfo-sphinx: $(SPHINX_DEPENDENCIES)
197
cd doc/en && make texinfo
198
cd doc/es && make texinfo
199
cd doc/ru && make texinfo
200
cd doc/ja && make texinfo
201
cd doc/developers && make texinfo
203
174
### Documentation Website ###
205
176
# Where to build the website
206
DOC_WEBSITE_BUILD = build_doc_website
177
DOC_WEBSITE_BUILD := build_doc_website
208
179
# Build and package docs into a website, complete with downloads.
209
180
doc-website: html-sphinx pdf-sphinx
210
181
$(PYTHON) tools/package_docs.py doc/en $(DOC_WEBSITE_BUILD)
211
182
$(PYTHON) tools/package_docs.py doc/es $(DOC_WEBSITE_BUILD)
212
183
$(PYTHON) tools/package_docs.py doc/ru $(DOC_WEBSITE_BUILD)
213
$(PYTHON) tools/package_docs.py doc/ja $(DOC_WEBSITE_BUILD)
214
184
$(PYTHON) tools/package_docs.py doc/developers $(DOC_WEBSITE_BUILD)
220
190
# support our "plain" html documentation so that Sphinx is not a hard
221
191
# dependency for packagers on older platforms.
223
rst2html = $(PYTHON) tools/rst2html.py --link-stylesheet --footnote-references=superscript --halt=warning
193
rst2html := $(PYTHON) tools/rst2html.py --link-stylesheet --footnote-references=superscript --halt=warning
225
195
# translate txt docs to html
226
derived_txt_files = \
196
derived_txt_files := \
197
doc/en/user-reference/bzr_man.txt \
227
198
doc/en/release-notes/NEWS.txt
229
200
doc/en/tutorials/tutorial.txt \
230
201
doc/en/tutorials/using_bazaar_with_launchpad.txt \
231
202
doc/en/tutorials/centralized_workflow.txt \
232
203
$(wildcard doc/es/tutorials/*.txt) \
233
$(wildcard doc/ru/tutorials/*.txt) \
234
doc/ja/tutorials/tutorial.txt \
235
doc/ja/tutorials/using_bazaar_with_launchpad.txt \
236
doc/ja/tutorials/centralized_workflow.txt \
204
$(wildcard doc/ru/tutorials/*.txt) \
237
205
$(wildcard doc/*/mini-tutorial/index.txt) \
238
206
$(wildcard doc/*/user-guide/index-plain.txt) \
239
doc/en/admin-guide/index-plain.txt \
240
207
$(wildcard doc/es/guia-usario/*.txt) \
241
208
$(derived_txt_files) \
242
209
doc/en/upgrade-guide/index.txt \
244
211
$(wildcard doc/index.*.txt)
246
213
doc/en/user-guide/index.txt \
247
214
doc/es/user-guide/index.txt \
248
doc/ja/user-guide/index.txt \
249
doc/ru/user-guide/index.txt \
250
doc/en/admin-guide/index.txt
251
txt_files = $(filter-out $(txt_nohtml), $(txt_all))
252
htm_files = $(patsubst %.txt, %.html, $(txt_files))
215
doc/ru/user-guide/index.txt
216
txt_files := $(filter-out $(txt_nohtml), $(txt_all))
217
htm_files := $(patsubst %.txt, %.html, $(txt_files))
255
220
doc/default.css \
256
221
$(wildcard doc/*/bzr-en-quick-reference.svg) \
257
222
$(wildcard doc/*/bzr-en-quick-reference.png) \
292
257
doc/developers/status.txt \
293
258
doc/developers/uncommit.txt
295
dev_txt_all = $(wildcard $(addsuffix /*.txt, doc/developers))
296
dev_txt_files = $(filter-out $(dev_txt_nohtml), $(dev_txt_all))
297
dev_htm_files = $(patsubst %.txt, %.html, $(dev_txt_files))
260
dev_txt_all := $(wildcard $(addsuffix /*.txt, doc/developers))
261
dev_txt_files := $(filter-out $(dev_txt_nohtml), $(dev_txt_all))
262
dev_htm_files := $(patsubst %.txt, %.html, $(dev_txt_files))
299
264
doc/en/user-guide/index-plain.html: $(wildcard $(addsuffix /*.txt, doc/en/user-guide))
300
265
$(rst2html) --stylesheet=../../default.css $(dir $@)index-plain.txt $@
305
270
#doc/ru/user-guide/index.html: $(wildcard $(addsuffix /*.txt, doc/ru/user-guide))
306
271
# $(rst2html) --stylesheet=../../default.css $(dir $@)index.txt $@
308
doc/en/admin-guide/index-plain.html: $(wildcard $(addsuffix /*.txt, doc/en/admin-guide))
309
$(rst2html) --stylesheet=../../default.css $(dir $@)index-plain.txt $@
311
273
doc/developers/%.html: doc/developers/%.txt
312
274
$(rst2html) --stylesheet=../default.css $< $@
318
280
$(rst2html) --stylesheet=default.css $< $@
321
$(rst2html) --stylesheet=../../default.css $< "$@"
323
doc/en/release-notes/NEWS.txt: $(NEWS_FILES) tools/generate_release_notes.py
324
$(PYTHON) tools/generate_release_notes.py "$@" $(NEWS_FILES)
283
$(rst2html) --stylesheet=../../default.css $< $@
285
doc/en/user-reference/bzr_man.txt: $(MAN_DEPENDENCIES)
286
$(PYTHON) tools/generate_docs.py -o $@ rstx
288
doc/en/release-notes/NEWS.txt: NEWS
289
$(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
326
291
upgrade_guide_dependencies = $(wildcard $(addsuffix /*.txt, doc/en/upgrade-guide))
362
327
# These are files that need to be copied into the build location to boostrap
363
328
# the build process.
364
329
# Note that the path is relative to tools/win32
365
BUILDOUT_FILES = buildout.cfg \
330
BUILDOUT_FILES := buildout.cfg \
366
331
buildout-templates/bin/build-installer.bat.in \
367
332
ostools.py bootstrap.py
429
394
$(PYTHON) tools/win32/ostools.py remove dist
434
.PHONY: update-pot po/bzr.pot
435
update-pot: po/bzr.pot
437
TRANSLATABLE_PYFILES:=$(shell find bzrlib -name '*.py' \
438
| grep -v 'bzrlib/tests/' \
439
| grep -v 'bzrlib/doc' \
442
po/bzr.pot: $(PYFILES) $(DOCFILES)
443
$(PYTHON) ./bzr export-pot --include-duplicates > po/bzr.pot
444
echo $(TRANSLATABLE_PYFILES) | xargs \
445
xgettext --package-name "bzr" \
446
--msgid-bugs-address "<bazaar@canonical.com>" \
447
--copyright-holder "Canonical" \
448
--from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \
449
-d bzr -p po -o bzr.pot
452
397
### Packaging Targets ###
454
.PHONY: dist check-dist-tarball
399
.PHONY: dist dist-upload-escudero check-dist-tarball
456
# build a distribution source tarball
401
# build a distribution tarball and zip file.
458
403
# this method of copying the pyrex generated files is a bit ugly; it would be
459
404
# nicer to generate it from distutils.
463
408
expbasedir=`mktemp -t -d tmp_bzr_dist.XXXXXXXXXX` && \
464
409
expdir=$$expbasedir/bzr-$$version && \
465
410
tarball=$$PWD/../bzr-$$version.tar.gz && \
411
zipball=$$PWD/../bzr-$$version.zip && \
466
412
$(MAKE) clean && \
468
414
bzr export $$expdir && \
469
cp bzrlib/*.c bzrlib/*.h $$expdir/bzrlib/. && \
415
cp bzrlib/*.c $$expdir/bzrlib/. && \
470
416
tar cfz $$tarball -C $$expbasedir bzr-$$version && \
417
(cd $$expbasedir && zip -r $$zipball bzr-$$version) && \
471
418
gpg --detach-sign $$tarball && \
419
gpg --detach-sign $$zipball && \
472
420
rm -rf $$expbasedir
474
422
# run all tests in a previously built tarball
479
427
tar Cxz $$tmpdir -f $$tarball && \
480
428
$(MAKE) -C $$tmpdir/bzr-$$version check && \
432
# upload previously built tarball to the download directory on bazaar-vcs.org,
433
# and verify that it can be downloaded ok.
434
dist-upload-escudero:
435
version=`./bzr version --short` && \
436
tarball=../bzr-$$version.tar.gz && \
437
zipball=../bzr-$$version.zip && \
438
scp $$zipball $$zipball.sig $$tarball $$tarball.sig \
439
escudero.ubuntu.com:/srv/bazaar.canonical.com/www/releases/src \
441
echo verifying over http... && \
442
curl http://bazaar-vcs.org/releases/src/bzr-$$version.zip \
443
| diff -s - $$zipball && \
444
curl http://bazaar-vcs.org/releases/src/bzr-$$version.zip.sig \
445
| diff -s - $$zipball.sig
446
curl http://bazaar-vcs.org/releases/src/bzr-$$version.tar.gz \
447
| diff -s - $$tarball && \
448
curl http://bazaar-vcs.org/releases/src/bzr-$$version.tar.gz.sig \
449
| diff -s - $$tarball.sig