/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-07-13 14:31:55 UTC
  • mfrom: (4529.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090713143155-gtc55thzlq7n04jr
(vila) Isolate some tests from TZ

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
all: 
2
 
 
3
 
check:
4
 
        ./bzr selftest $(tests)
 
1
# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
 
2
#
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation; either version 2 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
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
 
16
 
 
17
# A relatively simple Makefile to assist in building parts of bzr. Mostly for
 
18
# building documentation, etc.
 
19
 
 
20
 
 
21
### Core Stuff ###
 
22
 
 
23
PYTHON=python
 
24
PYTHON_BUILDFLAGS=
 
25
 
 
26
.PHONY: all clean extensions pyflakes api-docs check-nodocs check
 
27
 
 
28
all: extensions
 
29
 
 
30
extensions:
 
31
        @echo "building extension modules."
 
32
        $(PYTHON) setup.py build_ext -i $(PYTHON_BUILDFLAGS)
 
33
 
 
34
check: docs check-nodocs
 
35
 
 
36
check-nodocs: extensions
 
37
        $(PYTHON) -Werror -O ./bzr selftest -1v $(tests)
5
38
        @echo "Running all tests with no locale."
6
 
        LC_CTYPE= LANG=C LC_ALL= ./bzr selftest $(tests)
7
 
 
8
 
check-msgeditor:
9
 
        ./bzr --no-plugins selftest -v msgeditor
10
 
 
11
 
clean: 
12
 
        ./setup.py clean
13
 
        -find . -name "*.pyc" -o -name "*.pyo" | xargs rm -f
14
 
        rm -rf test????.tmp
15
 
 
16
 
.PHONY: all
17
 
 
18
 
 
19
 
# build emacs cross-reference
20
 
tag_files=./bzr ./bzrlib/*py ./bzrlib/selftest/*.py
21
 
TAGS: $(tag_files)
22
 
        ctags-exuberant -e $(tag_files)
23
 
 
24
 
tutorial.html: tutorial.txt
25
 
        rest2html tutorial.txt > tutorial.html
 
39
        LC_CTYPE= LANG=C LC_ALL= ./bzr selftest -1v $(tests) 2>&1 | sed -e 's/^/[ascii] /'
 
40
 
 
41
# Run Python style checker (apt-get install pyflakes)
 
42
#
 
43
# Note that at present this gives many false warnings, because it doesn't
 
44
# know about identifiers loaded through lazy_import.
 
45
pyflakes:
 
46
        pyflakes bzrlib
 
47
 
 
48
pyflakes-nounused:
 
49
        # There are many of these warnings at the moment and they're not a
 
50
        # high priority to fix
 
51
        pyflakes bzrlib | grep -v ' imported but unused'
 
52
 
 
53
clean:
 
54
        $(PYTHON) setup.py clean
 
55
        -find . -name "*.pyc" -o -name "*.pyo" -o -name "*.so" | xargs rm -f
 
56
 
 
57
# Build API documentation
 
58
docfiles = bzr bzrlib
 
59
api-docs:
 
60
        mkdir -p api/html
 
61
        PYTHONPATH=$(PWD) $(PYTHON) tools/bzr_epydoc --html -o api/html --docformat 'restructuredtext en' $(docfiles)
 
62
check-api-docs:
 
63
        PYTHONPATH=$(PWD) $(PYTHON) tools/bzr_epydoc --check --docformat 'restructuredtext en' $(docfiles)
 
64
 
 
65
# build tags for emacs and vim
 
66
TAGS:
 
67
        ctags -R -e bzrlib
 
68
 
 
69
tags:
 
70
        ctags -R bzrlib
 
71
 
 
72
# these are treated as phony so they'll always be rebuilt - it's pretty quick
 
73
.PHONY: TAGS tags
 
74
 
 
75
### Documentation ###
 
76
 
 
77
# set PRETTY to get docs that look like the Bazaar web site
 
78
ifdef PRETTY
 
79
rst2html := $(PYTHON) tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid 
 
80
else
 
81
rst2html := $(PYTHON) tools/rst2html.py --link-stylesheet --footnote-references=superscript --halt=warning
 
82
endif
 
83
 
 
84
# translate txt docs to html
 
85
derived_txt_files := \
 
86
        doc/en/user-reference/bzr_man.txt \
 
87
        doc/en/release-notes/NEWS.txt
 
88
txt_files := $(wildcard doc/*/tutorials/*.txt) \
 
89
        $(wildcard doc/*/mini-tutorial/index.txt) \
 
90
        $(wildcard doc/*/user-guide/index.txt) \
 
91
        $(derived_txt_files) \
 
92
        doc/en/developer-guide/HACKING.txt \
 
93
        doc/en/upgrade-guide/index.txt \
 
94
        $(wildcard doc/es/guia-usario/*.txt) \
 
95
        doc/es/mini-tutorial/index.txt \
 
96
        doc/index.txt \
 
97
        $(wildcard doc/index.*.txt)
 
98
non_txt_files := \
 
99
       doc/default.css \
 
100
       $(wildcard doc/*/quick-reference/quick-start-summary.svg) \
 
101
       $(wildcard doc/*/quick-reference/quick-start-summary.png) \
 
102
       $(wildcard doc/*/quick-reference/quick-start-summary.pdf) \
 
103
       $(wildcard doc/*/user-guide/images/*.png)
 
104
htm_files := $(patsubst %.txt, %.html, $(txt_files)) 
 
105
 
 
106
# doc/developers/*.txt files that should *not* be individually
 
107
# converted to HTML
 
108
dev_txt_nohtml := \
 
109
        doc/developers/add.txt \
 
110
        doc/developers/annotate.txt \
 
111
        doc/developers/bundle-creation.txt \
 
112
        doc/developers/commit.txt \
 
113
        doc/developers/diff.txt \
 
114
        doc/developers/directory-fingerprints.txt \
 
115
        doc/developers/gc.txt \
 
116
        doc/developers/incremental-push-pull.txt \
 
117
        doc/developers/initial-push-pull.txt \
 
118
        doc/developers/merge-scaling.txt \
 
119
        doc/developers/missing.txt \
 
120
        doc/developers/performance-roadmap-rationale.txt \
 
121
        doc/developers/performance-use-case-analysis.txt \
 
122
        doc/developers/planned-change-integration.txt \
 
123
        doc/developers/planned-performance-changes.txt \
 
124
        doc/developers/revert.txt \
 
125
        doc/developers/status.txt \
 
126
        doc/developers/uncommit.txt
 
127
 
 
128
dev_txt_all := $(wildcard $(addsuffix /*.txt, doc/developers))
 
129
dev_txt_files := $(filter-out $(dev_txt_nohtml), $(dev_txt_all))
 
130
dev_htm_files := $(patsubst %.txt, %.html, $(dev_txt_files)) 
 
131
 
 
132
doc/%/user-guide/index.html: $(wildcard $(addsuffix /*.txt, doc/%/user-guide)) 
 
133
        $(rst2html) --stylesheet=../../default.css $(dir $@)index.txt $@
 
134
 
 
135
# Set the paper size for PDF files.
 
136
# Options:  'a4' (ISO A4 size), 'letter' (US Letter size)
 
137
PAPERSIZE = a4
 
138
# TODO: Add generation for Russian PDF
 
139
PDF_DOCS := doc/en/user-guide/user-guide.$(PAPERSIZE).pdf
 
140
 
 
141
# Copy and modify the RST sources, and convert SVG images to PDF
 
142
# files for use a images in the LaTeX-generated PDF.
 
143
# Then generate the PDF output from the modified RST sources.
 
144
doc/en/user-guide/user-guide.$(PAPERSIZE).pdf: $(wildcard $(addsuffix /*.txt, doc/en/user-guide))
 
145
        mkdir -p doc/en/user-guide/latex_prepared
 
146
        $(PYTHON) tools/prepare_for_latex.py \
 
147
            --out-dir=doc/en/user-guide/latex_prepared \
 
148
            --in-dir=doc/en/user-guide
 
149
        cd doc/en/user-guide/latex_prepared && \
 
150
            $(PYTHON) ../../../../tools/rst2pdf.py \
 
151
                --documentoptions=10pt,$(PAPERSIZE)paper \
 
152
                --input-encoding=UTF-8:strict --output-encoding=UTF-8:strict \
 
153
                --strict --title="Bazaar User Guide" \
 
154
                index.txt ../user-guide.$(PAPERSIZE).pdf
 
155
 
 
156
doc/developers/%.html: doc/developers/%.txt
 
157
        $(rst2html) --stylesheet=../default.css $< $@
 
158
 
 
159
doc/index.html: doc/index.txt
 
160
        $(rst2html) --stylesheet=default.css $< $@
 
161
 
 
162
doc/index.%.html: doc/index.%.txt
 
163
        $(rst2html) --stylesheet=default.css $< $@
 
164
 
 
165
%.html: %.txt
 
166
        $(rst2html) --stylesheet=../../default.css $< $@
 
167
 
 
168
MAN_DEPENDENCIES = bzrlib/builtins.py \
 
169
        $(wildcard bzrlib/*.py) \
 
170
        $(wildcard bzrlib/*/*.py) \
 
171
        tools/generate_docs.py \
 
172
        $(wildcard $(addsuffix /*.txt, bzrlib/help_topics/en)) 
 
173
 
 
174
doc/en/user-reference/bzr_man.txt: $(MAN_DEPENDENCIES)
 
175
        PYTHONPATH=.:$$PYTHONPATH $(PYTHON) tools/generate_docs.py -o $@ rstx
 
176
 
 
177
doc/en/release-notes/NEWS.txt: NEWS
 
178
        $(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
 
179
 
 
180
MAN_PAGES = man1/bzr.1
 
181
man1/bzr.1: $(MAN_DEPENDENCIES)
 
182
        PYTHONPATH=.:$$PYTHONPATH $(PYTHON) tools/generate_docs.py -o $@ man
 
183
 
 
184
upgrade_guide_dependencies =  $(wildcard $(addsuffix /*.txt, doc/en/upgrade-guide)) 
 
185
 
 
186
doc/en/upgrade-guide/index.html: $(upgrade_guide_dependencies)
 
187
        $(rst2html) --stylesheet=../../default.css $(dir $@)index.txt $@
 
188
 
 
189
# build a png of our performance task list
 
190
 
191
# this is no longer built by default; you can build it if you want to look at it
 
192
doc/developers/performance.png: doc/developers/performance.dot
 
193
        @echo Generating $@
 
194
        @dot -Tpng $< -o$@ || echo "Dot not installed; skipping generation of $@"
 
195
 
 
196
derived_web_docs = $(htm_files) $(dev_htm_files) 
 
197
WEB_DOCS = $(derived_web_docs) $(non_txt_files)
 
198
ALL_DOCS = $(derived_web_docs) $(MAN_PAGES)
 
199
 
 
200
# the main target to build all the docs
 
201
docs: $(ALL_DOCS)
 
202
 
 
203
# produce a tree containing just the final docs, ready for uploading to the web
 
204
HTMLDIR := html_docs
 
205
html-docs: docs
 
206
        $(PYTHON) tools/win32/ostools.py copytree $(WEB_DOCS) $(HTMLDIR)
 
207
 
 
208
# Produce PDF documents.  Requires pdfLaTeX, rubber, and Inkscape.
 
209
pdf-docs: $(PDF_DOCS)
 
210
 
 
211
# clean produced docs
 
212
clean-docs:
 
213
        $(PYTHON) tools/win32/ostools.py remove $(ALL_DOCS) \
 
214
            $(HTMLDIR) $(derived_txt_files)
 
215
        rm -f doc/*/user-guide/*.pdf
 
216
        rm -rf doc/*/user-guide/latex_prepared
 
217
 
 
218
 
 
219
### Windows Support ###
 
220
 
 
221
# make bzr.exe for win32 with py2exe
 
222
exe:
 
223
        @echo *** Make bzr.exe
 
224
        $(PYTHON) tools/win32/ostools.py remove bzrlib/*.pyd
 
225
        $(PYTHON) setup.py build_ext -i -f $(PYTHON_BUILDFLAGS)
 
226
        $(PYTHON) setup.py py2exe > py2exe.log
 
227
        $(PYTHON) tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
 
228
        $(PYTHON) tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_bzr.exe
 
229
 
 
230
# win32 installer for bzr.exe
 
231
installer: exe copy-docs
 
232
        @echo *** Make windows installer
 
233
        $(PYTHON) tools/win32/run_script.py cog.py -d -o tools/win32/bzr.iss tools/win32/bzr.iss.cog
 
234
        iscc /Q tools/win32/bzr.iss
 
235
 
 
236
# win32 Python's distutils-based installer
 
237
# require to have Python interpreter installed on win32
 
238
py-inst-24: docs
 
239
        python24 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
 
240
 
 
241
py-inst-25: docs
 
242
        python25 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
 
243
 
 
244
py-inst-26: docs
 
245
        python26 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
 
246
 
 
247
python-installer: py-inst-24 py-inst-25 py-inst-26
 
248
 
 
249
 
 
250
copy-docs: docs
 
251
        $(PYTHON) tools/win32/ostools.py copytodir README win32_bzr.exe/doc
 
252
        $(PYTHON) tools/win32/ostools.py copytree $(WEB_DOCS) win32_bzr.exe
 
253
 
 
254
# clean on win32 all installer-related files and directories
 
255
clean-win32: clean-docs
 
256
        $(PYTHON) tools/win32/ostools.py remove build
 
257
        $(PYTHON) tools/win32/ostools.py remove win32_bzr.exe
 
258
        $(PYTHON) tools/win32/ostools.py remove py2exe.log
 
259
        $(PYTHON) tools/win32/ostools.py remove tools/win32/bzr.iss
 
260
        $(PYTHON) tools/win32/ostools.py remove bzr-setup*.exe
 
261
        $(PYTHON) tools/win32/ostools.py remove bzr-*win32.exe
 
262
        $(PYTHON) tools/win32/ostools.py remove dist
 
263
 
 
264
.PHONY: dist dist-upload-escudero check-dist-tarball
 
265
 
 
266
# build a distribution tarball and zip file.
 
267
#
 
268
# this method of copying the pyrex generated files is a bit ugly; it would be
 
269
# nicer to generate it from distutils.
 
270
dist: 
 
271
        version=`./bzr version --short` && \
 
272
        echo Building distribution of bzr $$version && \
 
273
        expbasedir=`mktemp -t -d tmp_bzr_dist.XXXXXXXXXX` && \
 
274
        expdir=$$expbasedir/bzr-$$version && \
 
275
        tarball=$$PWD/../bzr-$$version.tar.gz && \
 
276
        zipball=$$PWD/../bzr-$$version.zip && \
 
277
        $(MAKE) clean && \
 
278
        $(MAKE) && \
 
279
        bzr export $$expdir && \
 
280
        cp bzrlib/*.c $$expdir/bzrlib/. && \
 
281
        tar cfz $$tarball -C $$expbasedir bzr-$$version && \
 
282
        (cd $$expbasedir && zip -r $$zipball bzr-$$version) && \
 
283
        gpg --detach-sign $$tarball && \
 
284
        gpg --detach-sign $$zipball && \
 
285
        rm -rf $$expbasedir
 
286
 
 
287
# run all tests in a previously built tarball
 
288
check-dist-tarball:
 
289
        tmpdir=`mktemp -t -d tmp_bzr_check_dist.XXXXXXXXXX` && \
 
290
        version=`./bzr version --short` && \
 
291
        tarball=$$PWD/../bzr-$$version.tar.gz && \
 
292
        tar Cxz $$tmpdir -f $$tarball && \
 
293
        $(MAKE) -C $$tmpdir/bzr-$$version check && \
 
294
        rm -rf $$tmpdir
 
295
 
 
296
 
 
297
# upload previously built tarball to the download directory on bazaar-vcs.org,
 
298
# and verify that it can be downloaded ok.
 
299
dist-upload-escudero:
 
300
        version=`./bzr version --short` && \
 
301
        tarball=../bzr-$$version.tar.gz && \
 
302
        zipball=../bzr-$$version.zip && \
 
303
        scp $$zipball $$zipball.sig $$tarball $$tarball.sig \
 
304
            escudero.ubuntu.com:/srv/bazaar.canonical.com/www/releases/src \
 
305
                && \
 
306
        echo verifying over http... && \
 
307
        curl http://bazaar-vcs.org/releases/src/bzr-$$version.zip \
 
308
                | diff -s - $$zipball && \
 
309
        curl http://bazaar-vcs.org/releases/src/bzr-$$version.zip.sig \
 
310
                | diff -s - $$zipball.sig 
 
311
        curl http://bazaar-vcs.org/releases/src/bzr-$$version.tar.gz \
 
312
                | diff -s - $$tarball && \
 
313
        curl http://bazaar-vcs.org/releases/src/bzr-$$version.tar.gz.sig \
 
314
                | diff -s - $$tarball.sig