Update copyright years
[clawsker.git] / Makefile
index b9b8b63f0506b75292e7cba6dc96884feba5f018..c68cf5d5e42c44ae8d22c1c62276bbdc6de93d83 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,35 +1,55 @@
 #
 # Clawsker makefile
-# $Id$
 #
 
-NAME=clawsker
-PREFIX=/usr/local
-BINDIR=${PREFIX}/bin
-DATADIR=${PREFIX}/share
-LIBDIR=${PREFIX}/lib/${NAME}
-MANDIR=${DATADIR}/man
-MAN1DIR=${MANDIR}/man1
+NAME = clawsker
+VERSION ?= 0.7.10
+PREFIX ?= /usr/local
+BINDIR = ${PREFIX}/bin
+DATADIR = ${PREFIX}/share
+LIBDIR = ${PREFIX}/lib/${NAME}
+MANDIR = ${DATADIR}/man
+MAN1DIR = ${MANDIR}/man1
 
-all: ${NAME}.1
+all: build
 
-${NAME}.1:
-       pod2man ${NAME} > ${NAME}.1
+build:
+       -mkdir build
+       sed -e "s,@PREFIX@,${PREFIX},;s,@LIBDIR@,${LIBDIR},;s,@VERSION@,${VERSION}," < ${NAME} > build/${NAME}
+       pod2man --release ${VERSION} -c '' ${NAME}.pod > build/${NAME}.1
+       ${MAKE} -C po build
+       
 
 install: all install-dirs
-       install -m 0755 ${NAME} ${DESTDIR}${BINDIR}
-       install -m 0644 ${NAME}.1 ${DESTDIR}${MAN1DIR}
+       install -m 0755 build/${NAME} ${DESTDIR}${BINDIR}
+       install -m 0644 build/${NAME}.1 ${DESTDIR}${MAN1DIR}
+       ${MAKE} -C po install
 
 install-dirs:
        install -d ${DESTDIR}${BINDIR}
        install -d ${DESTDIR}${MAN1DIR}
+       ${MAKE} -C po install-dirs
 
 uninstall:
        rm -f ${DESTDIR}${BINDIR}/${NAME}
        rm -f ${DESTDIR}${MAN1DIR}/${NAME}.1
+       ${MAKE} -C po uninstall
 
-clean:
-       rm -f ${NAME}.1 *~
+dist:
+       rm -rf ${NAME}-${VERSION}
+       mkdir ${NAME}-${VERSION}
+       cp -p AUTHORS ChangeLog.old clawsker clawsker.pod \
+               COPYING Makefile NEWS README ${NAME}-${VERSION}
+       cp -rp po ${NAME}-${VERSION}
+       tar czf ${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION} \
+               && rm -rf ${NAME}-${VERSION}
 
-.PHONY: all install install-dirs uninstall clean
+clean-build:
+       rm -rf build
+
+clean: clean-build
+       rm -f *~
+       ${MAKE} -C po clean
+
+.PHONY: all build install install-dirs uninstall clean clean-build dist