Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. #! /usr/bin/make -f
  2. #
  3. # Makefile
  4. # Part of ComixCursors, a desktop cursor theme.
  5. #
  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
  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. # Makefile for ComixCursors project.
  23. SHELL = /bin/bash
  24. CURSORSNAME = ComixCursors
  25. PACKAGENAME ?= ${CURSORSNAME}
  26. SUMMARY ?= The original Comix Cursors
  27. ICONSDIR ?= ${HOME}/.icons
  28. THEMENAME ?= Custom
  29. GENERATED_FILES :=
  30. ifeq (@LH-,$(findstring @LH-,@${THEMEOPTIONS}))
  31. orientation = LeftHanded
  32. else
  33. orientation = RightHanded
  34. endif
  35. bindir = bin
  36. svgdir = svg
  37. indir = ${svgdir}/${orientation}
  38. workdir = tmp
  39. builddir = build
  40. xcursor_builddir = cursors
  41. distdir = dist
  42. configdir = ComixCursorsConfigs
  43. configfile = ${configdir}/${THEMENAME}.CONFIG
  44. themefile = ${builddir}/${THEMENAME}.theme
  45. destdir = ${ICONSDIR}/${CURSORSNAME}${THEMEOPTIONS}${THEMEINCLUDE}${SIZENAME}-${THEMENAME}
  46. xcursor_destdir = ${destdir}/cursors
  47. template_configfile = ${configdir}/Custom.CONFIG
  48. template_themefile = ${configdir}/Custom.theme
  49. # Derive cursor file names.
  50. conffiles = $(wildcard ${builddir}/*.conf)
  51. cursornames = $(foreach conffile,${conffiles},$(basename $(notdir ${conffile})))
  52. cursorfiles = $(foreach cursor,${cursornames},${xcursor_builddir}/${cursor})
  53. GENERATED_FILES += ${svgdir}/*/*.frame*.svg
  54. GENERATED_FILES += ${workdir}
  55. GENERATED_FILES += ${builddir}
  56. GENERATED_FILES += ${xcursor_builddir}
  57. GENERATED_FILES += ${distdir}
  58. # Packaging files.
  59. news_file = NEWS
  60. rpm_specfile_changelog = specfile-changelog
  61. rpm_specfile = ${PACKAGENAME}.spec
  62. rpm_spec_template = ${CURSORSNAME}.spec.in
  63. GENERATED_FILES += ${rpm_specfile_changelog} *.spec
  64. LINK_CURSORS = "${bindir}/link-cursors"
  65. MAKE_SPECFILE_CHANGELOG = "${bindir}/news-to-specfile-changelog"
  66. MAKE_SPECFILE = "${bindir}/make-specfile"
  67. .PHONY: all
  68. all: ${cursorfiles}
  69. ${xcursor_builddir}/%: ${builddir}/%.conf $(wildcard ${builddir}/%*.png)
  70. xcursorgen "$<" "$@"
  71. .PHONY: install
  72. install: all
  73. # Create necessary directories.
  74. install -d "${ICONSDIR}" "${ICONSDIR}/default"
  75. $(RM) -r "${destdir}"
  76. install -d "${xcursor_destdir}"
  77. # Install the cursors.
  78. install -m u=rw,go=r "${xcursor_builddir}"/* "${xcursor_destdir}"
  79. # Install the theme configuration file.
  80. install -m u=rw,go=r "${themefile}" "${destdir}/index.theme"
  81. # Install alternative name symlinks for the cursors.
  82. $(LINK_CURSORS) "${xcursor_destdir}"
  83. .PHONY: uninstall
  84. uninstall:
  85. $(RM) -r "${destdir}"
  86. .PHONY: custom-theme
  87. custom-theme: ${configfile} ${themefile}
  88. ${configfile}: ${template_configfile}
  89. cp "$<" "$@"
  90. ${themefile}: ${template_themefile}
  91. install -d "${builddir}"
  92. cp "$<" "$@"
  93. .PHONY: rpm
  94. rpm: ${rpm_specfile}
  95. ${rpm_specfile_changelog}: ${news_file}
  96. $(MAKE_SPECFILE_CHANGELOG) < "$<" > "$@"
  97. ${rpm_specfile}: ${rpm_spec_template} ${rpm_specfile_changelog}
  98. $(MAKE_SPECFILE)
  99. .PHONY: clean
  100. clean:
  101. $(RM) -r ${GENERATED_FILES}
  102. # Local Variables:
  103. # mode: makefile
  104. # coding: utf-8
  105. # End:
  106. # vim: filetype=make fileencoding=utf-8 :