Merge Debian packaging for release “0.9-1”.
[debian_comixcursors.git] / Makefile
blobe2b8d08e77a90c3eee829b2223319952d5b58b3c
1 #! /usr/bin/make -f
3 # Makefile
4 # Part of ComixCursors, a desktop cursor theme.
6 # Copyright © 2010–2013 Ben Finney <ben+opendesktop@benfinney.id.au>
7 # Copyright © 2006–2013 Jens Luetkens <j.luetkens@limitland.de>
8 # Copyright © 2003 Unai G
10 # This work is free software: you can redistribute it and/or modify it
11 # under the terms of the GNU General Public License as published by
12 # the Free Software Foundation, either version 3 of the License, or
13 # (at your option) any later version.
15 # This work is distributed in the hope that it will be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 # General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this work. If not, see <http://www.gnu.org/licenses/>.
23 # Makefile for ComixCursors project.
25 SHELL = /bin/bash
27 CURSORSNAME = ComixCursors
28 PACKAGENAME ?= ${CURSORSNAME}
29 SUMMARY ?= The original Comix Cursors
30 ICONSDIR ?= ${HOME}/.icons
31 THEMENAME ?= Custom
33 GENERATED_FILES :=
35 ifeq (@LH-,$(findstring @LH-,@${THEMEOPTIONS}))
36 orientation = LeftHanded
37 else
38 orientation = RightHanded
39 endif
41 bindir = bin
42 svgdir = svg
43 indir = ${svgdir}/${orientation}
44 workdir = tmp
45 builddir = build
46 xcursor_builddir = cursors
47 distdir = dist
48 configdir = ComixCursorsConfigs
49 configfile = ${configdir}/${THEMENAME}.CONFIG
50 themefile = ${builddir}/${THEMENAME}.theme
52 destdir = ${ICONSDIR}/${CURSORSNAME}${THEMEOPTIONS}${THEMEINCLUDE}${SIZENAME}-${THEMENAME}
53 xcursor_destdir = ${destdir}/cursors
55 template_configfile = ${configdir}/Custom.CONFIG
56 template_themefile = ${configdir}/Custom.theme
58 # Derive cursor file names.
59 conffiles = $(wildcard ${builddir}/*.conf)
60 cursornames = $(foreach conffile,${conffiles},$(basename $(notdir ${conffile})))
61 cursorfiles = $(foreach cursor,${cursornames},${xcursor_builddir}/${cursor})
63 GENERATED_FILES += ${svgdir}/*/*.frame*.svg
64 GENERATED_FILES += ${workdir}
65 GENERATED_FILES += ${builddir}
66 GENERATED_FILES += ${xcursor_builddir}
67 GENERATED_FILES += ${distdir}
69 # Packaging files.
70 news_file = NEWS
71 rpm_specfile_changelog = specfile-changelog
72 rpm_specfile = ${PACKAGENAME}.spec
73 rpm_spec_template = ${CURSORSNAME}.spec.in
75 GENERATED_FILES += ${rpm_specfile_changelog} *.spec
77 LINK_CURSORS = "${bindir}/link-cursors"
78 MAKE_SPECFILE_CHANGELOG = "${bindir}/news-to-specfile-changelog"
79 MAKE_SPECFILE = "${bindir}/make-specfile"
82 .PHONY: all
83 all: ${cursorfiles}
85 ${xcursor_builddir}/%: ${builddir}/%.conf $(wildcard ${builddir}/%*.png)
86 xcursorgen "$<" "$@"
89 .PHONY: install
90 install: all
91 # Create necessary directories.
92 install -d "${ICONSDIR}" "${ICONSDIR}/default"
93 $(RM) -r "${destdir}"
94 install -d "${xcursor_destdir}"
96 # Install the cursors.
97 install -m u=rw,go=r "${xcursor_builddir}"/* "${xcursor_destdir}"
99 # Install the theme configuration file.
100 install -m u=rw,go=r "${themefile}" "${destdir}/index.theme"
102 # Install alternative name symlinks for the cursors.
103 $(LINK_CURSORS) "${xcursor_destdir}"
105 .PHONY: uninstall
106 uninstall:
107 $(RM) -r "${destdir}"
110 .PHONY: custom-theme
111 custom-theme: ${configfile} ${themefile}
113 ${configfile}: ${template_configfile}
114 cp "$<" "$@"
116 ${themefile}: ${template_themefile}
117 install -d "${builddir}"
118 cp "$<" "$@"
121 .PHONY: rpm
122 rpm: ${rpm_specfile}
124 ${rpm_specfile_changelog}: ${news_file}
125 $(MAKE_SPECFILE_CHANGELOG) < "$<" > "$@"
127 ${rpm_specfile}: ${rpm_spec_template} ${rpm_specfile_changelog}
128 $(MAKE_SPECFILE)
131 .PHONY: clean
132 clean:
133 $(RM) -r ${GENERATED_FILES}
136 # Local Variables:
137 # mode: makefile
138 # coding: utf-8
139 # End:
140 # vim: filetype=make fileencoding=utf-8 :