German translation update by Axel Köllhofer
[clawsker.git] / Makefile
1 #
2 # Clawsker Makefile
3 # Copyright 2007-2016 Ricardo Mones <ricardo@mones.org>
4 #
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.
9 #
10 # See COPYING file for license details.
11 #
12
13 NAME = clawsker
14 VERSION ?= 0.7.13
15 PREFIX ?= /usr/local
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
23 ICONRES = 64 128
24
25 all: build
26
27 build:
28         -mkdir build
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
31         ${MAKE} -C po build
32         
33
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}
38         ${MAKE} -C po install
39
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
45
46 install-icons-dirs:
47         install -d ${DESTDIR}${THEMEDIR}
48         for res in ${ICONRES}; do \
49                 install -d ${DESTDIR}${THEMEDIR}/$${res}x$${res}/apps; \
50         done
51
52 install-icons:
53         for res in ${ICONRES}; do \
54                 install -m 0644 icons/${NAME}-$${res}.png ${DESTDIR}${THEMEDIR}/$${res}x$${res}/apps/${NAME}.png; \
55         done
56
57 uninstall-icons:
58         for res in ${ICONRES}; do \
59                 rm -f ${DESTDIR}${THEMEDIR}/$${res}x$${res}/apps/${NAME}.png; \
60         done
61
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
67
68 dist:
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}
77
78 clean-build:
79         rm -rf build
80
81 clean: clean-build
82         rm -f *~
83         ${MAKE} -C po clean
84
85 .PHONY: all build install install-dirs uninstall clean clean-build dist
86