| 1 |
#! /usr/bin/make -f |
| 2 |
# |
| 3 |
# Makefile |
| 4 |
# Part of ComixCursors, a desktop cursor theme. |
| 5 |
# |
| 6 |
# Copyright © 2010–2013 Ben Finney <[email protected]> |
| 7 |
# Copyright © 2006–2013 Jens Luetkens <[email protected]> |
| 8 |
# Copyright © 2003 Unai G |
| 9 |
# |
| 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. |
| 14 |
# |
| 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. |
| 19 |
# |
| 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/>. |
| 22 |
|
| 23 |
# Makefile for ComixCursors project. |
| 24 |
|
| 25 |
SHELL = /bin/bash |
| 26 |
|
| 27 |
CURSORSNAME = ComixCursors |
| 28 |
PACKAGENAME ?= ${CURSORSNAME} |
| 29 |
SUMMARY ?= The original Comix Cursors |
| 30 |
THEMENAME ?= Custom |
| 31 |
THEMEVARIANT ?= ${THEMENAME}-${THEMEOPTIONS}-${THEMEINCLUDE} |
| 32 |
|
| 33 |
GENERATED_FILES := |
| 34 |
|
| 35 |
ifeq (@LH-,$(findstring @LH-,@${THEMEOPTIONS})) |
| 36 |
orientation = LeftHanded |
| 37 |
else |
| 38 |
orientation = RightHanded |
| 39 |
endif |
| 40 |
|
| 41 |
bindir = bin |
| 42 |
svgdir = svg |
| 43 |
indir = ${svgdir}/${orientation} |
| 44 |
workdir = tmp |
| 45 |
builddir = build |
| 46 |
buildvariantdir = ${builddir}/${THEMEVARIANT} |
| 47 |
xcursor_builddir = cursors |
| 48 |
xcursor_buildvariantdir = ${xcursor_builddir}/${THEMEVARIANT} |
| 49 |
distdir = dist |
| 50 |
configdir = ComixCursorsConfigs |
| 51 |
configfile = ${configdir}/${THEMENAME}.CONFIG |
| 52 |
themefile = ${buildvariantdir}/${THEMENAME}.theme |
| 53 |
|
| •54 |
ifdef DESTDIR |
| 55 |
icons_destdir = ${DESTDIR}/usr/share/icons |
| 56 |
else |
| 57 |
icons_destdir = ${HOME}/.icons |
| 58 |
endif |
| 59 |
|
| 60 |
theme_destdir = ${icons_destdir}/${CURSORSNAME}${THEMEOPTIONS}${THEMEINCLUDE}${SIZENAME}-${THEMENAME} |
| 61 |
xcursor_destdir = ${theme_destdir}/cursors |
| 62 |
|
| 63 |
template_configfile = ${configdir}/Custom.CONFIG |
| 64 |
template_themefile = ${configdir}/Custom.theme |
| 65 |
|
| 66 |
# Derive cursor file names. |
| 67 |
conffiles = $(wildcard ${buildvariantdir}/*.conf) |
| 68 |
cursornames = $(foreach conffile,${conffiles},$(basename $(notdir ${conffile}))) |
| 69 |
cursorfiles = $(foreach cursor,${cursornames},${xcursor_buildvariantdir}/${cursor}) |
| 70 |
|
| 71 |
GENERATED_FILES += ${svgdir}/*/*.frame*.svg |
| 72 |
GENERATED_FILES += ${workdir} |
| 73 |
GENERATED_FILES += ${builddir} |
| 74 |
GENERATED_FILES += ${xcursor_builddir} |
| 75 |
GENERATED_FILES += ${distdir} |
| 76 |
|
| 77 |
# Packaging files. |
| 78 |
news_file = NEWS |
| 79 |
rpm_specfile_changelog = specfile-changelog |
| 80 |
rpm_specfile = ${PACKAGENAME}.spec |
| 81 |
rpm_spec_template = ${CURSORSNAME}.spec.in |
| 82 |
|
| 83 |
GENERATED_FILES += ${rpm_specfile_changelog} *.spec |
| 84 |
|
| 85 |
LINK_CURSORS = "${bindir}/link-cursors" |
| 86 |
MAKE_SPECFILE_CHANGELOG = "${bindir}/news-to-specfile-changelog" |
| 87 |
MAKE_SPECFILE = "${bindir}/make-specfile" |
| 88 |
|
| 89 |
.PHONY: all |
| 90 |
all: ${cursorfiles} |
| 91 |
|
| 92 |
${xcursor_buildvariantdir}/%: ${buildvariantdir}/%.conf $(wildcard ${buildvariantdir}/%*.png) |
| 93 |
xcursorgen "$<" "$@" |
| 94 |
|
| 95 |
.PHONY: install |
| 96 |
install: all |
| 97 |
# Create necessary directories. |
| •98 |
install -d "${icons_destdir}" "${icons_destdir}/default" |
| 99 |
$(RM) -r "${theme_destdir}" |
| 100 |
install -d "${xcursor_destdir}" |
| 101 |
|
| 102 |
# Install the cursors. |
| 103 |
install -m u=rw,go=r "${xcursor_buildvariantdir}"/* "${xcursor_destdir}" |
| 104 |
|
| 105 |
# Install the theme configuration file. |
| •106 |
install -m u=rw,go=r "${themefile}" "${theme_destdir}/index.theme" |
| 107 |
|
| 108 |
# Install alternative name symlinks for the cursors. |
| 109 |
$(LINK_CURSORS) "${xcursor_destdir}" |
| 110 |
|
| 111 |
.PHONY: uninstall |
| 112 |
uninstall: |
| •113 |
$(RM) -r "${theme_destdir}" |
| 114 |
|
| 115 |
.PHONY: custom-theme |
| 116 |
custom-theme: ${configfile} ${themefile} |
| 117 |
|
| 118 |
${configfile}: ${template_configfile} |
| 119 |
cp "$<" "$@" |
| 120 |
|
| 121 |
${themefile}: ${template_themefile} |
| 122 |
install -d "${buildvariantdir}" |
| 123 |
cp "$<" "$@" |
| 124 |
|
| 125 |
.PHONY: rpm |
| 126 |
rpm: ${rpm_specfile} |
| 127 |
|
| 128 |
${rpm_specfile_changelog}: ${news_file} |
| 129 |
$(MAKE_SPECFILE_CHANGELOG) < "$<" > "$@" |
| 130 |
|
| 131 |
${rpm_specfile}: ${rpm_spec_template} ${rpm_specfile_changelog} |
| 132 |
$(MAKE_SPECFILE) |
| 133 |
|
| 134 |
.PHONY: clean |
| 135 |
clean: |
| 136 |
$(RM) -r ${GENERATED_FILES} |
| 137 |
|
| 138 |
# Local Variables: |
| 139 |
# mode: makefile |
| 140 |
# coding: utf-8 |
| 141 |
# End: |
| 142 |
# vim: filetype=make fileencoding=utf-8 : |