🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
4.0 KiB

2 years ago
  1. #
  2. # FreeType 2 host platform detection rules
  3. #
  4. # Copyright (C) 1996-2022 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. # This sub-Makefile is in charge of detecting the current platform. It sets
  13. # the following variables:
  14. #
  15. # PLATFORM_DIR The configuration and system-specific directory. Usually
  16. # `builds/$(PLATFORM)' but can be different for custom builds
  17. # of the library.
  18. #
  19. # The following variables must be defined in system specific `detect.mk'
  20. # files:
  21. #
  22. # PLATFORM The detected platform. This will default to `ansi' if
  23. # auto-detection fails.
  24. # CONFIG_FILE The configuration sub-makefile to use. This usually depends
  25. # on the compiler defined in the `CC' environment variable.
  26. # DELETE The shell command used to remove a given file.
  27. # COPY The shell command used to copy one file.
  28. # SEP The platform-specific directory separator.
  29. # COMPILER_SEP The separator used in arguments of the compilation tools.
  30. # CC The compiler to use.
  31. #
  32. # You need to set the following variable(s) before calling it:
  33. #
  34. # TOP_DIR The top-most directory in the FreeType library source
  35. # hierarchy. If not defined, it will default to `.'.
  36. # Set auto-detection default to `ansi' resp. UNIX-like operating systems.
  37. #
  38. PLATFORM := ansi
  39. DELETE := $(RM)
  40. COPY := cp
  41. CAT := cat
  42. SEP := /
  43. BUILD_CONFIG := $(TOP_DIR)/builds
  44. # These two assignments must be delayed.
  45. PLATFORM_DIR = $(BUILD_CONFIG)/$(PLATFORM)
  46. CONFIG_RULES = $(PLATFORM_DIR)/$(CONFIG_FILE)
  47. # We define the BACKSLASH variable to hold a single back-slash character.
  48. # This is needed because a line like
  49. #
  50. # SEP := \
  51. #
  52. # does not work with GNU Make (the backslash is interpreted as a line
  53. # continuation). While a line like
  54. #
  55. # SEP := \\
  56. #
  57. # really defines $(SEP) as `\' on Unix, and `\\' on Dos and Windows!
  58. #
  59. BACKSLASH := $(strip \ )
  60. # Find all auto-detectable platforms.
  61. #
  62. PLATFORMS := $(notdir $(subst /detect.mk,,$(wildcard $(BUILD_CONFIG)/*/detect.mk)))
  63. .PHONY: $(PLATFORMS) ansi
  64. # Filter out platform specified as setup target.
  65. #
  66. PLATFORM := $(firstword $(filter $(MAKECMDGOALS),$(PLATFORMS)))
  67. # If no setup target platform was specified, enable auto-detection/
  68. # default platform.
  69. #
  70. ifeq ($(PLATFORM),)
  71. PLATFORM := ansi
  72. endif
  73. # If the user has explicitly asked for `ansi' on the command line,
  74. # disable auto-detection.
  75. #
  76. ifeq ($(findstring ansi,$(MAKECMDGOALS)),)
  77. # Now, include all detection rule files found in the `builds/<system>'
  78. # directories. Note that the calling order of the various `detect.mk'
  79. # files isn't predictable.
  80. #
  81. include $(wildcard $(BUILD_CONFIG)/*/detect.mk)
  82. endif
  83. # In case no detection rule file was successful, use the default.
  84. #
  85. ifndef CONFIG_FILE
  86. CONFIG_FILE := ansi.mk
  87. setup: std_setup
  88. .PHONY: setup
  89. endif
  90. # Flash out and copy rules.
  91. #
  92. .PHONY: std_setup
  93. std_setup:
  94. $(info )
  95. $(info $(PROJECT_TITLE) build system -- automatic system detection)
  96. $(info )
  97. $(info The following settings are used:)
  98. $(info )
  99. $(info $(empty) platform $(PLATFORM))
  100. $(info $(empty) compiler $(CC))
  101. $(info $(empty) configuration directory $(subst /,$(SEP),$(PLATFORM_DIR)))
  102. $(info $(empty) configuration rules $(subst /,$(SEP),$(CONFIG_RULES)))
  103. $(info )
  104. $(info If this does not correspond to your system or settings please remove the file)
  105. $(info `$(CONFIG_MK)' from this directory then read the INSTALL file for help.)
  106. $(info )
  107. $(info Otherwise, simply type `$(MAKE)' again to build the library,)
  108. $(info or `$(MAKE) refdoc' to build the API reference (this needs Python >= 3.5).)
  109. $(info )
  110. @$(COPY) $(subst /,$(SEP),$(CONFIG_RULES) $(CONFIG_MK))
  111. # EOF