mmm, not what i want
[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}," < ${NAME} > build/${NAME}
20         pod2man --release ${VERSION} -c '' ${NAME}.pod > build/${NAME}.1
21         ${MAKE} -C po build
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         ${MAKE} -C po install
28
29 install-dirs:
30         install -d ${DESTDIR}${BINDIR}
31         install -d ${DESTDIR}${MAN1DIR}
32         ${MAKE} -C po install-dirs
33
34 uninstall:
35         rm -f ${DESTDIR}${BINDIR}/${NAME}
36         rm -f ${DESTDIR}${MAN1DIR}/${NAME}.1
37         ${MAKE} -C po uninstall
38
39 clean-build:
40         rm -rf build
41
42 clean: clean-build
43         rm -f *~
44         ${MAKE} -C po clean
45
46 .PHONY: all build install install-dirs uninstall clean clean-build
47