english corrections from Paul
[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         ${MAKE} -C po build
23         
24
25 install: all install-dirs
26         install -m 0755 build/${NAME} ${DESTDIR}${BINDIR}
27         install -m 0644 build/${NAME}.1 ${DESTDIR}${MAN1DIR}
28         ${MAKE} -C po install
29
30 install-dirs:
31         install -d ${DESTDIR}${BINDIR}
32         install -d ${DESTDIR}${MAN1DIR}
33         ${MAKE} -C po install-dirs
34
35 uninstall:
36         rm -f ${DESTDIR}${BINDIR}/${NAME}
37         rm -f ${DESTDIR}${MAN1DIR}/${NAME}.1
38         ${MAKE} -C po uninstall
39
40 clean-build:
41         rm -rf build
42
43 clean: clean-build
44         rm -f *~
45         ${MAKE} -C po clean
46
47 .PHONY: all build install install-dirs uninstall clean clean-build
48