84674f9914c449ad13f2d7f71da1611eeef89fde
[clawsker.git] / Makefile
1 #
2 # Clawsker makefile
3 # $Id$
4 #
5
6 NAME = clawsker
7 VERSION = $(shell cat VERSION)
8 PREFIX ?= /usr/local
9 BINDIR = ${PREFIX}/bin
10 DATADIR = ${PREFIX}/share
11 LIBDIR = ${PREFIX}/lib/${NAME}
12 MANDIR = ${DATADIR}/man
13 MAN1DIR = ${MANDIR}/man1
14
15 all: build
16
17 build:
18         mkdir build
19         sed -e "s,@PREFIX@,${PREFIX},;s,@LIBDIR@,${LIBDIR},;s,@VERSION@,${VERSION}," \
20                 < ${NAME} > build/${NAME}
21         pod2man ${NAME} > build/${NAME}.1
22         
23
24 install: all install-dirs
25         install -m 0755 build/${NAME} ${DESTDIR}${BINDIR}
26         install -m 0644 build/${NAME}.1 ${DESTDIR}${MAN1DIR}
27
28 install-dirs:
29         install -d ${DESTDIR}${BINDIR}
30         install -d ${DESTDIR}${MAN1DIR}
31
32 uninstall:
33         rm -f ${DESTDIR}${BINDIR}/${NAME}
34         rm -f ${DESTDIR}${MAN1DIR}/${NAME}.1
35
36 clean-build:
37         rm -rf build
38
39 clean:
40         rm -f ${NAME}.1 *~
41
42 .PHONY: all build install install-dirs uninstall clean clean-build
43