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}
30 pod2man --release ${VERSION} -c '' ${NAME}.pod > build/${NAME}.1
34 install: all install-dirs install-icons
35 install -m 0755 build/${NAME} ${DESTDIR}${BINDIR}
36 install -m 0644 build/${NAME}.1 ${DESTDIR}${MAN1DIR}
37 install -m 0644 ${NAME}.desktop ${DESTDIR}${APPSDIR}
40 install-dirs: install-icons-dirs
41 install -d ${DESTDIR}${BINDIR}
42 install -d ${DESTDIR}${MAN1DIR}
43 install -d ${DESTDIR}${APPSDIR}
44 ${MAKE} -C po install-dirs
47 install -d ${DESTDIR}${THEMEDIR}
48 for res in ${ICONRES}; do \
49 install -d ${DESTDIR}${THEMEDIR}/$${res}x$${res}/apps; \
53 for res in ${ICONRES}; do \
54 install -m 0644 icons/${NAME}-$${res}.png ${DESTDIR}${THEMEDIR}/$${res}x$${res}/apps/${NAME}.png; \
58 for res in ${ICONRES}; do \
59 rm -f ${DESTDIR}${THEMEDIR}/$${res}x$${res}/apps/${NAME}.png; \
62 uninstall: uninstall-icons
63 rm -f ${DESTDIR}${BINDIR}/${NAME}
64 rm -f ${DESTDIR}${MAN1DIR}/${NAME}.1
65 rm -f ${DESTDIR}${APPSDIR}/${NAME}.desktop
66 ${MAKE} -C po uninstall
69 rm -rf ${NAME}-${VERSION}
70 mkdir ${NAME}-${VERSION}
71 cp -p AUTHORS ChangeLog.old ${NAME} ${NAME}.pod ${NAME}.desktop \
72 COPYING Makefile NEWS README ${NAME}-${VERSION}
73 cp -rp po ${NAME}-${VERSION}
74 cp -rp icons ${NAME}-${VERSION}
75 tar cJf ${NAME}-${VERSION}.tar.xz ${NAME}-${VERSION} \
76 && rm -rf ${NAME}-${VERSION}
85 .PHONY: all build install install-dirs uninstall clean clean-build dist