3 # Copyright 2007-2016 Ricardo Mones <ricardo@mones.org>
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # See COPYING file for license details.
16 BINDIR = ${PREFIX}/bin
17 DATADIR = ${PREFIX}/share
18 LIBDIR = ${PREFIX}/lib/${NAME}
19 MANDIR = ${DATADIR}/man
20 MAN1DIR = ${MANDIR}/man1
21 APPSDIR = ${DATADIR}/applications
22 THEMEDIR = ${DATADIR}/icons/hicolor
29 sed -e "s,@PREFIX@,${PREFIX},;s,@LIBDIR@,${LIBDIR},;s,@VERSION@,${VERSION},;s,@DATADIR@,${DATADIR}," < ${NAME} > build/${NAME}
33 ${NAME}.1: ${NAME}.pod
34 pod2man --release ${VERSION} -c '' $< > $@
36 install: all install-dirs install-icons
37 install -m 0755 build/${NAME} ${DESTDIR}${BINDIR}
38 install -m 0644 build/${NAME}.1 ${DESTDIR}${MAN1DIR}
39 install -m 0644 ${NAME}.desktop ${DESTDIR}${APPSDIR}
42 install-dirs: install-icons-dirs
43 install -d ${DESTDIR}${BINDIR}
44 install -d ${DESTDIR}${MAN1DIR}
45 install -d ${DESTDIR}${APPSDIR}
46 ${MAKE} -C po install-dirs
49 install -d ${DESTDIR}${THEMEDIR}
50 for res in ${ICONRES}; do \
51 install -d ${DESTDIR}${THEMEDIR}/$${res}x$${res}/apps; \
55 for res in ${ICONRES}; do \
56 install -m 0644 icons/${NAME}-$${res}.png ${DESTDIR}${THEMEDIR}/$${res}x$${res}/apps/${NAME}.png; \
60 for res in ${ICONRES}; do \
61 rm -f ${DESTDIR}${THEMEDIR}/$${res}x$${res}/apps/${NAME}.png; \
64 uninstall: uninstall-icons
65 rm -f ${DESTDIR}${BINDIR}/${NAME}
66 rm -f ${DESTDIR}${MAN1DIR}/${NAME}.1
67 rm -f ${DESTDIR}${APPSDIR}/${NAME}.desktop
68 ${MAKE} -C po uninstall
71 rm -rf ${NAME}-${VERSION}
72 mkdir ${NAME}-${VERSION}
73 cp -p AUTHORS ChangeLog.old ${NAME} ${NAME}.pod ${NAME}.desktop \
74 COPYING Makefile NEWS README ${NAME}-${VERSION}
75 cp -rp po ${NAME}-${VERSION}
76 cp -rp icons ${NAME}-${VERSION}
77 tar cJf ${NAME}-${VERSION}.tar.xz ${NAME}-${VERSION} \
78 && rm -rf ${NAME}-${VERSION}
88 .PHONY: all build install install-dirs install-icons-dirs install-icons uninstall uninstall-icons clean clean-build dist