1 # Simple Makefile for Bazaar plugin
2 # Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org>
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 BZR ?= $(shell which bzr)
21 PYTHON ?= $(shell which python)
22 SETUP ?= $(PYTHON) ./setup.py
26 RST2HTML ?= $(if $(shell which rst2html.py 2>/dev/null), rst2html.py, rst2html)
30 REST_DOCS = README FAQ AUTHORS
32 all:: build build-inplace $(patsubst %,%.html,$(REST_DOCS))
38 $(SETUP) build_ext --inplace
41 $(SETUP) build_ext --inplace --debug
45 $(SETUP) install --root "$(DESTDIR)"
55 TMP_PLUGINS_DIR = $(shell pwd)/.plugins
60 $(TMP_PLUGINS_DIR)/svn: $(TMP_PLUGINS_DIR)
63 check:: build-inplace $(TMP_PLUGINS_DIR)/svn
64 BZR_PLUGIN_PATH=$(TMP_PLUGINS_DIR) $(DEBUGGER) $(PYTHON) $(PYTHON_OPTIONS) $(BZR) $(BZR_OPTIONS) selftest $(TEST_OPTIONS) --starting-with=bzrlib.plugins.svn $(TESTS)
67 $(MAKE) check TEST_OPTIONS=-v
70 $(MAKE) check TEST_OPTIONS=--one
73 $(MAKE) check TEST_OPTIONS="--random=now --verbose --one"
75 valgrind-check:: build-inplace-debug
76 $(MAKE) check DEBUGGER="valgrind --suppressions=/usr/lib/valgrind/python.supp $(VALGRIND_OPTIONS)"
79 $(MAKE) valgrind-check VALGRIND_OPTIONS="--leak-check=full --show-reachable=yes --num-callers=200 --leak-resolution=med --log-file=leaks.log"
81 gdb-check:: build-inplace-debug
82 $(MAKE) check DEBUGGER="gdb --args $(GDB_OPTIONS)"
85 $(MAKE) check DEBUGGER="strace $(STRACE_OPTIONS)"
88 BZR_PLUGIN_PATH=$(TMP_PLUGINS_DIR) $(BZR) plugins
91 $(PYLINT) -f parseable *.py */*.py
94 $(PYDOCTOR) --make-html -c bzr-svn.cfg
96 FAQ.html README.html AUTHORS.html: %.html: %
104 homepage.html: wiki.py README INSTALL
105 python wiki.py | tail -n +2 | rst2html > $@