e9e1748d76531ac029849fece555d75bed3c5fef
[be.git] / Makefile
1 #! /usr/bin/make -f
2 # :vim: filetype=make : -*- makefile; coding: utf-8; -*-
3
4 # Makefile
5 # Part of Bugs Everywhere, a distributed bug tracking system.
6 #
7 # Copyright (C) 2008-2010 Ben Finney <benf@cybersource.com.au>
8 #                         Chris Ball <cjb@laptop.org>
9 #                         Gianluca Montecchi <gian@grys.it>
10 #                         W. Trevor King <wking@drexel.edu>
11 #
12 # This program is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License along
23 # with this program; if not, write to the Free Software Foundation, Inc.,
24 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25
26 SHELL = /bin/bash
27 RM = rm
28 #PATH = /usr/bin:/bin  # must include sphinx-build for 'sphinx' target.
29
30 #PREFIX = /usr/local
31 PREFIX = ${HOME}
32 INSTALL_OPTIONS = "--prefix=${PREFIX}"
33
34 # Directories with semantic meaning
35 DOC_DIR := doc
36 MAN_DIR := ${DOC_DIR}/man
37
38 MANPAGES = be.1
39 GENERATED_FILES := build libbe/_version.py
40
41 MANPAGE_FILES = $(patsubst %,${MAN_DIR}/%,${MANPAGES})
42 GENERATED_FILES += ${MANPAGE_FILES}
43
44 \f
45 .PHONY: all
46 all: build
47
48 \f
49 .PHONY: build
50 build: libbe/_version.py
51         python setup.py build
52
53 .PHONY: doc
54 doc: sphinx man
55
56 .PHONY: install
57 install: build doc
58         python setup.py install ${INSTALL_OPTIONS}
59
60 test: build
61         python test.py
62
63 .PHONY: clean
64 clean:
65         $(RM) -rf ${GENERATED_FILES}
66         $(MAKE) -C ${DOC_DIR} clean
67
68 \f
69 .PHONY: libbe/_version.py
70 libbe/_version.py:
71         bzr version-info --format python > $@
72
73 .PHONY: man
74 man: ${MANPAGE_FILES}
75
76 %.1: %.1.sgml
77         docbook-to-man $< > $@
78
79 .PHONY: sphinx
80 sphinx:
81         $(MAKE) -C ${DOC_DIR} html