release 0.2.0
[clawsker.git] / Makefile
index 572d5f65bac7689cf37eac41ad7f01a0c728c994..954ec3027e6cf03bc93a8c5812977aad65f43226 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,34 +1,48 @@
 #
 # Clawsker makefile
+# $Id$
 #
 
-NAME=clawsker
-PREFIX=/usr/local
-BINDIR=${PREFIX}/bin
-DATADIR=${PREFIX}/share
-LIBDIR=${PREFIX}/lib/${NAME}
-MANDIR=${DATADIR}/man
-MAN1DIR=${MANDIR}/man1
-
-all: ${NAME}.1
-
-${NAME}.1:
-       pod2man ${NAME} > ${NAME}.1
+NAME = clawsker
+VERSION = $(shell cat VERSION)
+PREFIX ?= /usr/local
+BINDIR = ${PREFIX}/bin
+DATADIR = ${PREFIX}/share
+LIBDIR = ${PREFIX}/lib/${NAME}
+MANDIR = ${DATADIR}/man
+MAN1DIR = ${MANDIR}/man1
+
+all: build
+
+build:
+       -mkdir build
+       sed -e "s,@PREFIX@,${PREFIX},;s,@LIBDIR@,${LIBDIR},;s,@VERSION@,${VERSION}," \
+               < ${NAME} > build/${NAME}
+       pod2man ${NAME} > 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-build:
+       rm -rf build
 
-clean:
-       rm -f ${NAME}.1 *~
+clean: clean-build
+       rm -f *~
+       ${MAKE} -C po clean
 
-.PHONY: all install install-dirs uninstall clean
+.PHONY: all build install install-dirs uninstall clean clean-build