| 1 |
# makefile for w2do, a simple text-based todo manager |
| 2 |
# Copyright (C) 2008, 2009, 2010 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 src/*.pl) |
| 21 |
MAN1 := $(patsubst %.pl, %.1, $(SRCS)) |
| 22 |
|
| 23 |
# Installation directories; feel free to modify according to your taste and |
| 24 |
# situation: |
| 25 |
prefix = /usr/local |
| 26 |
bindir = $(prefix)/bin |
| 27 |
mandir = $(prefix)/share/man |
| 28 |
man1dir = $(mandir)/man1 |
| 29 |
|
| 30 |
# Additional information: |
| 31 |
VERSION = 2.3.1 |
| 32 |
|
| 33 |
# Make rules; please do not edit these unless you really know what you are |
| 34 |
# doing: |
| 35 |
.PHONY: all clean install uninstall |
| 36 |
|
| 37 |
all: $(MAN1) |
| 38 |
|
| 39 |
clean: |
| 40 |
-rm -f $(MAN1) |
| 41 |
|
| 42 |
install: $(MAN1) |
| 43 |
@echo "Copying scripts..." |
| 44 |
$(INSTALL) -d $(bindir) |
| 45 |
$(INSTALL) -m 755 src/w2do.pl $(bindir)/w2do |
| 46 |
$(INSTALL) -m 755 src/w2html.pl $(bindir)/w2html |
| 47 |
$(INSTALL) -m 755 src/w2text.pl $(bindir)/w2text |
| 48 |
@echo "Copying man pages..." |
| 49 |
$(INSTALL) -d $(man1dir) |
| 50 |
$(INSTALL) -m 644 src/w2do.1 $(man1dir) |
| 51 |
$(INSTALL) -m 644 src/w2html.1 $(man1dir) |
| 52 |
$(INSTALL) -m 644 src/w2text.1 $(man1dir) |
| 53 |
|
| 54 |
uninstall: |
| 55 |
@echo "Removing scripts..." |
| 56 |
rm -f $(bindir)/w2do |
| 57 |
rm -f $(bindir)/w2html |
| 58 |
rm -f $(bindir)/w2text |
| 59 |
@echo "Removing man pages..." |
| 60 |
rm -f $(man1dir)/w2do.1 |
| 61 |
rm -f $(man1dir)/w2html.1 |
| 62 |
rm -f $(man1dir)/w2text.1 |
| 63 |
@echo "Removing empty directories..." |
| 64 |
-rmdir $(bindir) $(man1dir) $(mandir) |
| 65 |
|
| 66 |
%.1: %.pl |
| 67 |
$(POD2MAN) --section=1 --release="Version $(VERSION)" $^ $@ |