/modules/freetype2/builds/unix/detect.mk

http://github.com/zpao/v8monkey · Makefile · 91 lines · 41 code · 16 blank · 34 comment · 0 complexity · 8353ecbca9d0f4c22ddd3d811a73f4c8 MD5 · raw file

  1. #
  2. # FreeType 2 configuration file to detect a UNIX host platform.
  3. #
  4. # Copyright 1996-2000, 2002, 2003, 2004, 2006 by
  5. # David Turner, Robert Wilhelm, and Werner Lemberg.
  6. #
  7. # This file is part of the FreeType project, and may only be used, modified,
  8. # and distributed under the terms of the FreeType project license,
  9. # LICENSE.TXT. By continuing to use, modify, or distribute this file you
  10. # indicate that you have read the license and understand and accept it
  11. # fully.
  12. .PHONY: setup
  13. ifeq ($(PLATFORM),ansi)
  14. # Note: this test is duplicated in "builds/toplevel.mk".
  15. #
  16. is_unix := $(strip $(wildcard /sbin/init) \
  17. $(wildcard /usr/sbin/init) \
  18. $(wildcard /hurd/auth))
  19. ifneq ($(is_unix),)
  20. PLATFORM := unix
  21. endif # test is_unix
  22. endif # test PLATFORM ansi
  23. ifeq ($(PLATFORM),unix)
  24. COPY := cp
  25. DELETE := rm -f
  26. CAT := cat
  27. # If `devel' is the requested target, we use a special configuration
  28. # file named `unix-dev.mk'. It disables optimization and libtool.
  29. #
  30. ifneq ($(findstring devel,$(MAKECMDGOALS)),)
  31. CONFIG_FILE := unix-dev.mk
  32. CC := gcc
  33. devel: setup
  34. .PHONY: devel
  35. else
  36. # If `lcc' is the requested target, we use a special configuration
  37. # file named `unix-lcc.mk'. It disables libtool for LCC.
  38. #
  39. ifneq ($(findstring lcc,$(MAKECMDGOALS)),)
  40. CONFIG_FILE := unix-lcc.mk
  41. CC := lcc
  42. lcc: setup
  43. .PHONY: lcc
  44. else
  45. # If a Unix platform is detected, the configure script is called and
  46. # `unix-def.mk' together with `unix-cc.mk' is created.
  47. #
  48. # Arguments to `configure' should be in the CFG variable. Example:
  49. #
  50. # make CFG="--prefix=/usr --disable-static"
  51. #
  52. # If you need to set CFLAGS or LDFLAGS, do it here also.
  53. #
  54. # Feel free to add support for other platform specific compilers in
  55. # this directory (e.g. solaris.mk + changes here to detect the
  56. # platform).
  57. #
  58. CONFIG_FILE := unix.mk
  59. unix: setup
  60. must_configure := 1
  61. .PHONY: unix
  62. endif
  63. endif
  64. have_Makefile := $(wildcard $(OBJ_DIR)/Makefile)
  65. setup: std_setup
  66. ifdef must_configure
  67. ifneq ($(have_Makefile),)
  68. # we are building FT2 not in the src tree
  69. $(TOP_DIR)/builds/unix/configure $(value CFG)
  70. else
  71. cd builds/unix; ./configure $(value CFG)
  72. endif
  73. endif
  74. endif # test PLATFORM unix
  75. # EOF