[go: up one dir, main page]

File: Makefile

package info (click to toggle)
comixcursors 0.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 876 kB
  • sloc: sh: 588; makefile: 153; python: 128
file content (142 lines) | stat: -rw-r--r-- 3,975 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#! /usr/bin/make -f
#
# Makefile
# Part of ComixCursors, a desktop cursor theme.
#
# Copyright © 2010–2013 Ben Finney <ben+opendesktop@benfinney.id.au>
# Copyright © 2006–2013 Jens Luetkens <j.luetkens@limitland.de>
# Copyright © 2003 Unai G
#
# This work is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This work is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this work. If not, see <http://www.gnu.org/licenses/>.

# Makefile for ComixCursors project.

SHELL = /bin/bash

CURSORSNAME = ComixCursors
PACKAGENAME ?= ${CURSORSNAME}
SUMMARY ?= The original Comix Cursors
THEMENAME ?= Custom
THEMEVARIANT ?= ${THEMENAME}-${THEMEOPTIONS}-${THEMEINCLUDE}

GENERATED_FILES :=

ifeq (@LH-,$(findstring @LH-,@${THEMEOPTIONS}))
	orientation = LeftHanded
else
	orientation = RightHanded
endif

bindir = bin
svgdir = svg
indir = ${svgdir}/${orientation}
workdir = tmp
builddir = build
buildvariantdir = ${builddir}/${THEMEVARIANT}
xcursor_builddir = cursors
xcursor_buildvariantdir = ${xcursor_builddir}/${THEMEVARIANT}
distdir = dist
configdir = ComixCursorsConfigs
configfile = ${configdir}/${THEMENAME}.CONFIG
themefile = ${buildvariantdir}/${THEMENAME}.theme

ifdef DESTDIR
icons_destdir = ${DESTDIR}/usr/share/icons
else
icons_destdir = ${HOME}/.icons
endif

theme_destdir = ${icons_destdir}/${CURSORSNAME}${THEMEOPTIONS}${THEMEINCLUDE}${SIZENAME}-${THEMENAME}
xcursor_destdir = ${theme_destdir}/cursors

template_configfile = ${configdir}/Custom.CONFIG
template_themefile = ${configdir}/Custom.theme

# Derive cursor file names.
conffiles = $(wildcard ${buildvariantdir}/*.conf)
cursornames = $(foreach conffile,${conffiles},$(basename $(notdir ${conffile})))
cursorfiles = $(foreach cursor,${cursornames},${xcursor_buildvariantdir}/${cursor})

GENERATED_FILES += ${svgdir}/*/*.frame*.svg
GENERATED_FILES += ${workdir}
GENERATED_FILES += ${builddir}
GENERATED_FILES += ${xcursor_builddir}
GENERATED_FILES += ${distdir}

# Packaging files.
news_file = NEWS
rpm_specfile_changelog = specfile-changelog
rpm_specfile = ${PACKAGENAME}.spec
rpm_spec_template = ${CURSORSNAME}.spec.in

GENERATED_FILES += ${rpm_specfile_changelog} *.spec

LINK_CURSORS = "${bindir}/link-cursors"
MAKE_SPECFILE_CHANGELOG = "${bindir}/news-to-specfile-changelog"
MAKE_SPECFILE = "${bindir}/make-specfile"

.PHONY: all
all: ${cursorfiles}

${xcursor_buildvariantdir}/%: ${buildvariantdir}/%.conf $(wildcard ${buildvariantdir}/%*.png)
	xcursorgen "$<" "$@"

.PHONY: install
install: all
# Create necessary directories.
	install -d "${icons_destdir}" "${icons_destdir}/default"
	$(RM) -r "${theme_destdir}"
	install -d "${xcursor_destdir}"

# Install the cursors.
	install -m u=rw,go=r "${xcursor_buildvariantdir}"/* "${xcursor_destdir}"

# Install the theme configuration file.
	install -m u=rw,go=r "${themefile}" "${theme_destdir}/index.theme"

# Install alternative name symlinks for the cursors.
	$(LINK_CURSORS) "${xcursor_destdir}"

.PHONY: uninstall
uninstall:
	$(RM) -r "${theme_destdir}"

.PHONY: custom-theme
custom-theme: ${configfile} ${themefile}

${configfile}: ${template_configfile}
	cp "$<" "$@"

${themefile}: ${template_themefile}
	install -d "${buildvariantdir}"
	cp "$<" "$@"

.PHONY: rpm
rpm: ${rpm_specfile}

${rpm_specfile_changelog}: ${news_file}
	$(MAKE_SPECFILE_CHANGELOG) < "$<" > "$@"

${rpm_specfile}: ${rpm_spec_template} ${rpm_specfile_changelog}
	$(MAKE_SPECFILE)

.PHONY: clean
clean:
	$(RM) -r ${GENERATED_FILES}

# Local Variables:
# mode: makefile
# coding: utf-8
# End:
# vim: filetype=make fileencoding=utf-8 :