Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Copyright (c) 2009 Openmoko Inc.
  2. #
  3. # This program is free software: you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation, either version 3 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # +++START_UPDATE_MAKEFILE: Start of auto included code
  16. # The text between the +++ and --- tags is copied by the
  17. # UpdateMakefiles script. Do not remove or change these tags.
  18. # ---
  19. # Autodetect root directory
  20. define FIND_ROOT_DIR
  21. while : ; do \
  22. d=$$(pwd) ; \
  23. [ -d "$${d}/samo-lib" ] && echo $${d} && exit 0 ; \
  24. [ X"/" = X"$${d}" ] && echo ROOT_DIRECTORY_NOT_FOUND && exit 1 ; \
  25. cd .. ; \
  26. done
  27. endef
  28. ROOT_DIR := $(shell ${FIND_ROOT_DIR})
  29. # Directory of Makefile includes
  30. MK_DIR := ${ROOT_DIR}/samo-lib/Mk
  31. # Include the initial Makefile setup
  32. include ${MK_DIR}/definitions.mk
  33. # ---END_UPDATE_MAKEFILE: End of auto included code
  34. $(call REQUIRED_BINARY, bdftopcf, xfonts-utils)
  35. BDFTOPCF = $(shell which bdftopcf)
  36. PCFTOBMF = ${HOST_TOOLS}/pcf2bmf/pcf2bmf
  37. TARGETS = title.bmf
  38. TARGETS += subtitle.bmf
  39. TARGETS += texti.bmf
  40. #TARGETS += textbi.bmf
  41. TARGETS += text.bmf
  42. #TARGETS += textb.bmf
  43. #TARGETS += small.bmf
  44. TARGETS += textall.bmf
  45. #TARGETS += textallb.bmf
  46. .PHONY: all
  47. all: stamp-fonts
  48. # use a lock to avoid multiple parallel builds of this program
  49. stamp-fonts:
  50. ${RM} "$@"
  51. ${LOCKF} "${@}" ${MAKE} ${TARGETS}
  52. ${TOUCH} "$@"
  53. .PHONY: install
  54. install: all
  55. @if [ ! -d "${DESTDIR}" ] ; then echo DESTDIR: "'"${DESTDIR}"'" is not a directory ; exit 1; fi
  56. ${COPY} *.bmf "${DESTDIR}"/
  57. build:
  58. ${MKDIR} "$@"
  59. .PHONY: clean
  60. clean:
  61. ${RM} -r build ${TARGETS} *.bmf *.pcf stamp-*
  62. # fonts
  63. %.pcf: %.bdf
  64. ${BDFTOPCF} "$<" -o "$@"
  65. %.bmf: %.pcf
  66. ${PCFTOBMF} -f "$<" -o "$@"
  67. include ${MK_DIR}/rules.mk