1
# makefile for lite2do, a lightweight text-based todo manager
2
# Copyright (C) 2008, 2009 Jaromir Hradilek
3
4
# This program is  free software:  you can redistribute it and/or modify it
5
# under  the terms  of the  GNU General Public License  as published by the
6
# Free Software Foundation, version 3 of the License.
7
# 
8
# This program  is  distributed  in the hope  that it will  be useful,  but
9
# WITHOUT  ANY WARRANTY;  without  even the implied  warranty of MERCHANTA-
10
# BILITY  or  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
11
# License for more details.
12
# 
13
# You should have received a copy of the  GNU General Public License  along
14
# with this program. If not, see <http://www.gnu.org/licenses/>.
15
16
# General settings; feel free to modify according to your situation:
17
SHELL   = /bin/sh
18
INSTALL = /usr/bin/install -c
19
POD2MAN = /usr/bin/pod2man
20
SRCS   := $(wildcard *.pl)
21
MAN1   := $(patsubst %.pl, %.1, $(SRCS))
22
23
# Installation directories; feel free to modify according to your taste and
24
# current situation:
25
prefix  = /usr/local
26
bindir	= $(prefix)/bin
27
mandir  = $(prefix)/share/man
28
man1dir = $(mandir)/man1
29
30
# Make rules;  please do not edit these unless you really know what you are
31
# doing:
32
.PHONY: all clean install uninstall
33
34
all: $(MAN1)
35
36
clean:
37
	-rm -f $(MAN1)
38
39
install: $(MAN1)
40
	@echo "Copying scripts..."
41
	$(INSTALL) -d $(bindir)
42
	$(INSTALL) -m 755 lite2do.pl $(bindir)/lite2do
43
	@echo "Copying manual pages..."
44
	$(INSTALL) -d $(man1dir)
45
	$(INSTALL) -m 644 lite2do.1 $(man1dir)
46
47
uninstall:
48
	@echo "Removing scripts..."
49
	rm -f $(bindir)/lite2do
50
	@echo "Removing manual pages..."
51
	rm -f $(man1dir)/lite2do.1
52
	@echo "Removing empty directories..."
53
	-rmdir $(bindir) $(man1dir) $(mandir)
54
55
%.1: %.pl
56
	$(POD2MAN) --section=1 $^ $@