Merge be --version code from W. Trevor King.
[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 © 2008 Ben Finney <ben+python@benfinney.id.au>
8 # This is free software; you may copy, modify and/or distribute this work
9 # under the terms of the GNU General Public License, version 2 or later.
10 # No warranty expressed or implied. See the file COPYING for details.
11
12 # Makefile for Bugs Everywhere project
13
14 SHELL = /bin/bash
15 PATH = /usr/bin:/bin
16
17 # Directories with semantic meaning
18 DOC_DIR := doc
19
20 # Variables that will be extended by module include files
21 GENERATED_FILES := libbe/_version.py build
22 CODE_MODULES :=
23 CODE_PROGRAMS :=
24
25 # List of modules (directories) that comprise our 'make' project
26 MODULES += ${DOC_DIR}
27
28 RM = rm
29
30 PREFIX = ${HOME}
31 INSTALL_OPTIONS = "--prefix=${PREFIX}"
32
33 \f
34 .PHONY: all
35 all: build
36
37 # Include the make data for each module
38 include $(patsubst %,%/module.mk,${MODULES})
39
40 \f
41 .PHONY: build
42 build: libbe/_version.py
43         python setup.py build
44
45 .PHONY: install
46 install: doc build
47         python setup.py install ${INSTALL_OPTIONS}
48         cp -v xml/* ${PREFIX}/bin
49
50 \f
51 .PHONY: clean
52 clean:
53         $(RM) -rf ${GENERATED_FILES}
54
55 libbe/_version.py:
56         bzr version-info --format python > $@