Incorrect accquiring bugdir command line argument
[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-2012 Anton Batenev <abbat@abbat>
8 #                         Ben Finney <benf@cybersource.com.au>
9 #                         Chris Ball <cjb@laptop.org>
10 #                         Eric Kow <eric.kow@gmail.com>
11 #                         Gianluca Montecchi <gian@grys.it>
12 #                         MatÄ›j Cepl <mcepl@redhat.com>
13 #                         W. Trevor King <wking@tremily.us>
14 #
15 # This file is part of Bugs Everywhere.
16 #
17 # Bugs Everywhere is free software: you can redistribute it and/or modify it
18 # under the terms of the GNU General Public License as published by the Free
19 # Software Foundation, either version 2 of the License, or (at your option) any
20 # later version.
21 #
22 # Bugs Everywhere is distributed in the hope that it will be useful, but
23 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
24 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
25 # more details.
26 #
27 # You should have received a copy of the GNU General Public License along with
28 # Bugs Everywhere.  If not, see <http://www.gnu.org/licenses/>.
29
30 SHELL = /bin/bash
31 RM = /bin/rm
32 RST2MAN = /usr/bin/rst2man
33 RST2HTML = /usr/bin/rst2html
34
35 #PATH = /usr/bin:/bin  # must include sphinx-build for 'sphinx' target.
36
37 #INSTALL_OPTIONS = "--prefix=/usr/local"
38 INSTALL_OPTIONS = "--user"
39
40 # Select the documentation you wish to build
41 DOC = sphinx man
42
43 # Directories with semantic meaning
44 DOC_DIR := doc
45 MAN_DIR := ${DOC_DIR}/man
46
47 MANPAGES = be.1
48 LIBBE_VERSION := libbe/_version.py
49 GENERATED_FILES := build $(LIBBE_VERSION)
50
51 MANPAGE_FILES = $(patsubst %,${MAN_DIR}/%,${MANPAGES})
52 MANPAGE_HTML =  $(patsubst %,${MAN_DIR}/%.html,${MANPAGES})
53 GENERATED_FILES += ${MANPAGE_FILES} ${MANPAGE_HTML}
54
55
56 .PHONY: all
57 all: build
58
59
60 .PHONY: build
61 build: $(LIBBE_VERSION)
62         python setup.py build
63
64 .PHONY: doc
65 doc: $(DOC)
66
67 .PHONY: install
68 install: build doc
69         python setup.py install ${INSTALL_OPTIONS}
70
71 test: build
72         python test.py
73
74 .PHONY: clean
75 clean:
76         $(RM) -rf ${GENERATED_FILES}
77         $(MAKE) -C ${DOC_DIR} clean
78
79
80 .PHONY: libbe/_version.py
81 libbe/_version.py:
82         echo "# -*- coding: utf-8 -*-" > $@
83         git log -1 --encoding=UTF-8 --date=short --pretty='format:"Autogenerated by make libbe/_version.py"%nversion_info = {%n    "date":"%cd",%n    "revision":"%H",%n    "committer":"%cn"}%n' >> $@
84
85 .PHONY: man
86 man: ${MANPAGE_FILES}
87
88 %.1: %.1.txt
89         $(RST2MAN) $< > $@
90 %.1.html: %.1.txt
91         $(RST2HTML) $< > $@
92
93 .PHONY: sphinx
94 sphinx:
95         $(MAKE) -C ${DOC_DIR} html