~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Robert Collins
  • Date: 2007-07-04 08:08:13 UTC
  • mfrom: (2572 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2587.
  • Revision ID: robertc@robertcollins.net-20070704080813-wzebx0r88fvwj5rq
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
all:
2
 
 
3
 
check:
4
 
        ./bzr selftest -v $(tests)
 
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: docs extensions
 
29
        python -Werror ./bzr selftest -v $(tests)
5
30
        @echo "Running all tests with no locale."
6
31
        LC_CTYPE= LANG=C LC_ALL= ./bzr selftest -v $(tests)
 
32
        python -O -Werror ./bzr selftest -v $(tests)
7
33
 
8
34
check-msgeditor:
9
35
        ./bzr --no-plugins selftest -v msgeditor
18
44
        pyflakes bzrlib | grep -v ' imported but unused'
19
45
 
20
46
clean:
21
 
        ./setup.py clean
 
47
        python setup.py clean
22
48
        -find . -name "*.pyc" -o -name "*.pyo" | xargs rm -f
23
49
        rm -rf test????.tmp
24
50
 
25
 
.PHONY: all
 
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)
26
58
 
27
59
 
28
60
# build emacs cross-reference
33
65
 
34
66
# Produce HTML docs to upload on Canonical server
35
67
HTMLDIR := html_docs
 
68
PRETTYDIR := pretty_docs
36
69
 
37
70
html-docs: docs
38
71
        python tools/win32/ostools.py copytodir $(htm_files) doc/default.css $(HTMLDIR)
40
73
 
41
74
# translate txt docs to html
42
75
doc_dir := doc 
43
 
txt_files := $(wildcard $(addsuffix /*.txt, $(doc_dir)))
44
 
htm_files := $(patsubst %.txt, %.htm, $(txt_files)) doc/bzr_man.htm
 
76
txt_files := $(wildcard $(addsuffix /*.txt, $(doc_dir))) doc/bzr_man.txt
 
77
htm_files := $(patsubst %.txt, %.htm, $(txt_files)) 
 
78
dev_txt_files := $(wildcard $(addsuffix /*.txt, doc/developers))
 
79
dev_htm_files := $(patsubst %.txt, %.htm, $(dev_txt_files)) 
 
80
 
 
81
pretty-html-docs: pretty_files
 
82
 
 
83
pretty_docs:
 
84
        python -c "import os; os.mkdir('$(PRETTYDIR)')"
 
85
 
 
86
pretty_files: $(patsubst doc/%.txt, $(PRETTYDIR)/%.htm, $(txt_files))
 
87
 
 
88
doc/developers/%.htm: doc/developers/%.txt
 
89
        python tools/rst2html.py --link-stylesheet --stylesheet=../default.css --footnote-references=superscript $< $@
 
90
 
 
91
doc/developers/HACKING.htm: doc/developers/HACKING
 
92
        python tools/rst2html.py --link-stylesheet --stylesheet=../default.css --footnote-references=superscript $< $@
45
93
 
46
94
%.htm: %.txt
47
 
        python tools/rst2html.py --link-stylesheet --stylesheet=default.css $*.txt $*.htm
48
 
 
49
 
doc/bzr_man.txt: bzrlib/builtins.py \
 
95
        python tools/rst2html.py --link-stylesheet --stylesheet=default.css --footnote-references=superscript $< $@
 
96
 
 
97
$(PRETTYDIR)/%.htm: pretty_docs doc/%.txt
 
98
        python tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid doc/$*.txt \
 
99
        $(PRETTYDIR)/$*.htm
 
100
 
 
101
MAN_DEPENDENCIES = bzrlib/builtins.py \
50
102
                 bzrlib/bundle/commands.py \
51
103
                 bzrlib/conflicts.py \
52
104
                 bzrlib/sign_my_commits.py \
53
105
                 generate_docs.py \
54
106
                 tools/doc_generate/__init__.py \
55
107
                 tools/doc_generate/autodoc_rstx.py
56
 
        python generate_docs.py -o doc/bzr_man.txt rstx
57
 
 
58
 
docs: $(htm_files)
 
108
 
 
109
doc/bzr_man.txt: $(MAN_DEPENDENCIES)
 
110
        python generate_docs.py -o $@ rstx
 
111
 
 
112
MAN_PAGES = man1/bzr.1
 
113
man1/bzr.1: $(MAN_DEPENDENCIES)
 
114
        python generate_docs.py -o $@ man
 
115
 
 
116
ALL_DOCS = $(htm_files) $(MAN_PAGES) doc/developers/HACKING.htm $(dev_htm_files) doc/developers/performance.png
 
117
docs: $(ALL_DOCS)
59
118
 
60
119
copy-docs: docs
61
 
        python tools/win32/ostools.py copytodir $(htm_files) doc/default.css NEWS README  win32_bzr.exe/doc
 
120
        python tools/win32/ostools.py copytodir $(htm_files) \
 
121
                doc/default.css NEWS README \
 
122
                win32_bzr.exe/doc
 
123
        python tools/win32/ostools.py copytodir doc/developers/HACKING.htm \
 
124
                $(dev_htm_files) \
 
125
                win32_bzr.exe/doc/developers
62
126
 
63
127
# clean produced docs
64
128
clean-docs:
65
 
        python tools/win32/ostools.py remove doc/bzr_man.txt $(htm_files) $(HTMLDIR)
 
129
        python tools/win32/ostools.py remove $(ALL_DOCS) \
 
130
        $(HTMLDIR) $(PRETTYDIR) doc/bzr_man.txt doc/developers/performance.png
 
131
 
 
132
 
 
133
# build a png of our performance task list
 
134
doc/developers/performance.png: doc/developers/performance.dot
 
135
        @echo Generating $@
 
136
        @dot -Tpng $< -o$@ || echo "Dot not installed; skipping generation of $@"
66
137
 
67
138
 
68
139
# make bzr.exe for win32 with py2exe
81
152
# win32 python's distutils-based installer
82
153
# require to have python interpreter installed on win32
83
154
python-installer: docs
84
 
        python setup.py bdist_wininst --title="Bazaar" --install-script="bzr-win32-bdist-postinstall.py"
 
155
        python setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
85
156
 
86
157
 
87
158
# clean on win32 all installer-related files and directories
90
161
        python tools/win32/ostools.py remove win32_bzr.exe
91
162
        python tools/win32/ostools.py remove py2exe.log
92
163
        python tools/win32/ostools.py remove doc/*.htm
 
164
        python tools/win32/ostools.py remove doc/developers/*.htm
93
165
        python tools/win32/ostools.py remove doc/bzr_man.txt
94
166
        python tools/win32/ostools.py remove tools/win32/bzr.iss
95
167
        python tools/win32/ostools.py remove bzr-setup*.exe
 
168
        python tools/win32/ostools.py remove bzr-*win32.exe
96
169
        python tools/win32/ostools.py remove dist