~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: John Arbash Meinel
  • Date: 2007-05-09 15:12:24 UTC
  • mto: This revision was merged to the branch mainline in revision 2614.
  • Revision ID: john@arbash-meinel.com-20070509151224-20uys53nsfunfv5k
Add benchmarks for loading a knit index with a lot of records.
Because of (deterministic) variations, the benchmarks are run 2 times.
For some reason, the second run of a benchmark is approx 40ms faster,
and the 3rd run is slow again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2005, 2006, 2007 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
 
 
17
# A relatively simple Makefile to assist in building parts of bzr. Mostly for
 
18
# building documentation, etc.
 
19
 
 
20
.PHONY: all clean extensions pyflakes api-docs
 
21
 
 
22
all: extensions
 
23
 
 
24
extensions:
 
25
        @echo "building extension modules."
 
26
        python setup.py build_ext -i
 
27
 
 
28
check: extensions
 
29
        python -Werror ./bzr selftest -v $(tests)
 
30
        @echo "Running all tests with no locale."
 
31
        LC_CTYPE= LANG=C LC_ALL= ./bzr selftest -v $(tests)
 
32
        python -O -Werror ./bzr selftest -v $(tests)
 
33
 
 
34
check-msgeditor:
 
35
        ./bzr --no-plugins selftest -v msgeditor
 
36
 
 
37
# Run Python style checker (apt-get install pyflakes)
 
38
pyflakes:
 
39
        pyflakes bzrlib
 
40
 
 
41
pyflakes-nounused:
 
42
        # There are many of these warnings at the moment and they're not a
 
43
        # high priority to fix
 
44
        pyflakes bzrlib | grep -v ' imported but unused'
 
45
 
 
46
clean:
 
47
        python setup.py clean
 
48
        -find . -name "*.pyc" -o -name "*.pyo" | xargs rm -f
 
49
        rm -rf test????.tmp
 
50
 
 
51
docfiles = bzr bzrlib
 
52
api-docs:
 
53
        mkdir -p api/html
 
54
        PYTHONPATH=$(PWD) python tools/bzr_epydoc --html -o api/html --docformat 'restructuredtext en' $(docfiles)
 
55
 
 
56
check-api-docs:
 
57
        PYTHONPATH=$(PWD) python tools/bzr_epydoc --check --docformat 'restructuredtext en' $(docfiles)
 
58
 
 
59
 
 
60
# build emacs cross-reference
 
61
tag_files=./bzr ./bzrlib/*py ./bzrlib/selftest/*.py
 
62
TAGS: $(tag_files)
 
63
        ctags-exuberant -e $(tag_files)
 
64
 
 
65
 
 
66
# Produce HTML docs to upload on Canonical server
 
67
HTMLDIR := html_docs
 
68
PRETTYDIR := pretty_docs
 
69
 
 
70
html-docs: docs
 
71
        python tools/win32/ostools.py copytodir $(htm_files) doc/default.css $(HTMLDIR)
 
72
 
 
73
 
 
74
# translate txt docs to html
 
75
doc_dir := doc 
 
76
txt_files := $(wildcard $(addsuffix /*.txt, $(doc_dir))) doc/bzr_man.txt
 
77
htm_files := $(patsubst %.txt, %.htm, $(txt_files)) 
 
78
 
 
79
pretty-html-docs: pretty_files
 
80
 
 
81
pretty_docs:
 
82
        python -c "import os; os.mkdir('$(PRETTYDIR)')"
 
83
 
 
84
pretty_files: $(patsubst doc/%.txt, $(PRETTYDIR)/%.htm, $(txt_files))
 
85
 
 
86
doc/HACKING.htm: HACKING
 
87
        python tools/rst2html.py --link-stylesheet --stylesheet=default.css HACKING doc/HACKING.htm
 
88
 
 
89
doc/%.htm: doc/%.txt 
 
90
        python tools/rst2html.py --link-stylesheet --stylesheet=default.css doc/$*.txt doc/$*.htm
 
91
 
 
92
$(PRETTYDIR)/%.htm: pretty_docs doc/%.txt
 
93
        python tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid doc/$*.txt \
 
94
        $(PRETTYDIR)/$*.htm
 
95
 
 
96
MAN_DEPENDENCIES = bzrlib/builtins.py \
 
97
                 bzrlib/bundle/commands.py \
 
98
                 bzrlib/conflicts.py \
 
99
                 bzrlib/sign_my_commits.py \
 
100
                 generate_docs.py \
 
101
                 tools/doc_generate/__init__.py \
 
102
                 tools/doc_generate/autodoc_rstx.py
 
103
 
 
104
doc/bzr_man.txt: $(MAN_DEPENDENCIES)
 
105
        python generate_docs.py -o $@ rstx
 
106
 
 
107
MAN_PAGES = man1/bzr.1
 
108
man1/bzr.1: $(MAN_DEPENDENCIES)
 
109
        python generate_docs.py -o $@ man
 
110
 
 
111
docs: $(htm_files) $(MAN_PAGES) doc/HACKING.htm
 
112
 
 
113
copy-docs: docs
 
114
        python tools/win32/ostools.py copytodir $(htm_files) \
 
115
                doc/default.css doc/HACKING.htm NEWS README \
 
116
                win32_bzr.exe/doc
 
117
 
 
118
# clean produced docs
 
119
clean-docs:
 
120
        python tools/win32/ostools.py remove $(htm_files) \
 
121
        $(HTMLDIR) $(PRETTYDIR) doc/bzr_man.txt $(MAN_PAGES)
 
122
 
 
123
 
 
124
# make bzr.exe for win32 with py2exe
 
125
exe:
 
126
        @echo *** Make bzr.exe
 
127
        python setup.py py2exe > py2exe.log
 
128
        python tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
 
129
        python tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_bzr.exe
 
130
 
 
131
# win32 installer for bzr.exe
 
132
installer: exe copy-docs
 
133
        @echo *** Make windows installer
 
134
        cog.py -d -o tools/win32/bzr.iss tools/win32/bzr.iss.cog
 
135
        iscc /Q tools/win32/bzr.iss
 
136
 
 
137
# win32 python's distutils-based installer
 
138
# require to have python interpreter installed on win32
 
139
python-installer: docs
 
140
        python setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
 
141
 
 
142
 
 
143
# clean on win32 all installer-related files and directories
 
144
clean-win32:
 
145
        python tools/win32/ostools.py remove build
 
146
        python tools/win32/ostools.py remove win32_bzr.exe
 
147
        python tools/win32/ostools.py remove py2exe.log
 
148
        python tools/win32/ostools.py remove doc/*.htm
 
149
        python tools/win32/ostools.py remove doc/bzr_man.txt
 
150
        python tools/win32/ostools.py remove tools/win32/bzr.iss
 
151
        python tools/win32/ostools.py remove bzr-setup*.exe
 
152
        python tools/win32/ostools.py remove bzr-*win32.exe
 
153
        python tools/win32/ostools.py remove dist