~bzr-pqm/bzr/bzr.dev

2399.1.1 by John Arbash Meinel
Update Makefile to add 'make api-docs' using pydoctor
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 pyflakes api-docs
21
22
1773.4.1 by Martin Pool
Add pyflakes makefile target; fix many warnings
23
all:
1102 by Martin Pool
- merge test refactoring from robertc
24
25
check:
2080.2.2 by John Arbash Meinel
Teach the pqm to treat warnings as errors
26
	python -Werror ./bzr selftest -v $(tests)
1526.1.1 by Robert Collins
Run the test suite with no locale as well as the default locale. Also add a test for build_tree_shape to selftest.
27
	@echo "Running all tests with no locale."
1704.1.1 by Robert Collins
'bzr selftest' now shows a progress bar with the number of tests, and
28
	LC_CTYPE= LANG=C LC_ALL= ./bzr selftest -v $(tests)
2090.2.4 by Martin Pool
Make check should run under python -O too
29
	python -O -Werror ./bzr selftest -v $(tests)
1102 by Martin Pool
- merge test refactoring from robertc
30
1185.33.72 by Martin Pool
Fix commit message template for non-ascii files, and add test for handling of
31
check-msgeditor:
32
	./bzr --no-plugins selftest -v msgeditor
33
1773.4.1 by Martin Pool
Add pyflakes makefile target; fix many warnings
34
# Run Python style checker (apt-get install pyflakes)
35
pyflakes:
36
	pyflakes bzrlib
37
38
pyflakes-nounused:
39
	# There are many of these warnings at the moment and they're not a
40
	# high priority to fix
41
	pyflakes bzrlib | grep -v ' imported but unused'
42
43
clean:
1185.1.21 by Robert Collins
add a clean target
44
	./setup.py clean
1185.62.18 by John Arbash Meinel
From Jari Alto: Makefile fixes (clean target error suppression)
45
	-find . -name "*.pyc" -o -name "*.pyo" | xargs rm -f
1427 by Robert Collins
clean up test dirs on make clean
46
	rm -rf test????.tmp
1185.1.21 by Robert Collins
add a clean target
47
2399.1.1 by John Arbash Meinel
Update Makefile to add 'make api-docs' using pydoctor
48
api-docs:
49
	mkdir -p api
50
	pydoctor -c pydoctor_bzrlib.cfg --make-html
1158 by Martin Pool
- make target to build emacs TAGS file
51
52
53
# build emacs cross-reference
54
tag_files=./bzr ./bzrlib/*py ./bzrlib/selftest/*.py
55
TAGS: $(tag_files)
56
	ctags-exuberant -e $(tag_files)
1536.1.1 by Martin Pool
Move in tutorial text from wiki.
57
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
58
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
59
# Produce HTML docs to upload on Canonical server
60
HTMLDIR := html_docs
2054.2.14 by Aaron Bentley
Add 'pretty-docs' target to makefile
61
PRETTYDIR := pretty_docs
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
62
1711.2.129 by John Arbash Meinel
change htmldocs => html-docs, to be consistent with other -docs functions
63
html-docs: docs
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
64
	python tools/win32/ostools.py copytodir $(htm_files) doc/default.css $(HTMLDIR)
65
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
66
67
# translate txt docs to html
68
doc_dir := doc 
2054.2.14 by Aaron Bentley
Add 'pretty-docs' target to makefile
69
txt_files := $(wildcard $(addsuffix /*.txt, $(doc_dir))) doc/bzr_man.txt
70
htm_files := $(patsubst %.txt, %.htm, $(txt_files)) 
71
2054.2.16 by Aaron Bentley
More updates from review comments
72
pretty-html-docs: pretty_files
2054.2.14 by Aaron Bentley
Add 'pretty-docs' target to makefile
73
74
pretty_docs:
75
	python -c "import os; os.mkdir('$(PRETTYDIR)')"
76
77
pretty_files: $(patsubst doc/%.txt, $(PRETTYDIR)/%.htm, $(txt_files))
78
79
doc/%.htm: doc/%.txt
80
	python tools/rst2html.py --link-stylesheet --stylesheet=default.css doc/$*.txt doc/$*.htm
81
82
$(PRETTYDIR)/%.htm: pretty_docs doc/%.txt
83
	python tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid doc/$*.txt \
84
	$(PRETTYDIR)/$*.htm
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
85
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
86
doc/bzr_man.txt: bzrlib/builtins.py \
87
		 bzrlib/bundle/commands.py \
88
		 bzrlib/conflicts.py \
89
		 bzrlib/sign_my_commits.py \
90
		 generate_docs.py \
91
		 tools/doc_generate/__init__.py \
92
		 tools/doc_generate/autodoc_rstx.py
1912.4.1 by Alexander Belchenko
generate_docs.py should be invoked with python interpreter for cross-platform compatibility
93
	python generate_docs.py -o doc/bzr_man.txt rstx
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
94
95
docs: $(htm_files)
96
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
97
copy-docs: docs
1861.2.18 by Alexander Belchenko
Makefile: cross-platform actions for building installer
98
	python tools/win32/ostools.py copytodir $(htm_files) doc/default.css NEWS README  win32_bzr.exe/doc
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
99
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
100
# clean produced docs
101
clean-docs:
2054.2.14 by Aaron Bentley
Add 'pretty-docs' target to makefile
102
	python tools/win32/ostools.py remove doc/bzr_man.txt $(htm_files) \
103
	$(HTMLDIR) $(PRETTYDIR)
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
104
105
106
# make bzr.exe for win32 with py2exe
107
exe:
108
	@echo *** Make bzr.exe
109
	python setup.py py2exe > py2exe.log
110
	python tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
111
	python tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_bzr.exe
112
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
113
# win32 installer for bzr.exe
1982.2.1 by Alexander Belchenko
small but important fix for 'make installer' dependencies
114
installer: exe copy-docs
1861.2.18 by Alexander Belchenko
Makefile: cross-platform actions for building installer
115
	@echo *** Make windows installer
116
	cog.py -d -o tools/win32/bzr.iss tools/win32/bzr.iss.cog
117
	iscc /Q tools/win32/bzr.iss
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
118
1821.1.2 by Alexander Belchenko
resurrected python's distutils based installer for win32
119
# win32 python's distutils-based installer
120
# require to have python interpreter installed on win32
1860.1.3 by Alexander Belchenko
python-installer:
121
python-installer: docs
2245.4.5 by Alexander Belchenko
bzr-win32-bdist-postinstall.py: good win98 support
122
	python setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
1821.1.2 by Alexander Belchenko
resurrected python's distutils based installer for win32
123
124
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
125
# clean on win32 all installer-related files and directories
1928.2.1 by Alexander Belchenko
New target to produce html docs to upload on server
126
clean-win32:
1861.2.18 by Alexander Belchenko
Makefile: cross-platform actions for building installer
127
	python tools/win32/ostools.py remove build
128
	python tools/win32/ostools.py remove win32_bzr.exe
129
	python tools/win32/ostools.py remove py2exe.log
130
	python tools/win32/ostools.py remove doc/*.htm
131
	python tools/win32/ostools.py remove doc/bzr_man.txt
132
	python tools/win32/ostools.py remove tools/win32/bzr.iss
133
	python tools/win32/ostools.py remove bzr-setup*.exe
2245.4.5 by Alexander Belchenko
bzr-win32-bdist-postinstall.py: good win98 support
134
	python tools/win32/ostools.py remove bzr-*win32.exe
1861.2.18 by Alexander Belchenko
Makefile: cross-platform actions for building installer
135
	python tools/win32/ostools.py remove dist