🛠️🐜 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.

202 lines
5.1 KiB

2 years ago
  1. #
  2. # FreeType 2 configuration file to detect a Win32 host platform.
  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. .PHONY: setup
  13. ifeq ($(PLATFORM),ansi)
  14. # Detecting Windows NT is easy, as the OS variable must be defined and
  15. # contains `Windows_NT'. This also works with Windows 2000 and XP.
  16. #
  17. ifeq ($(OS),Windows_NT)
  18. PLATFORM := windows
  19. else
  20. # Detecting Windows 9X
  21. # We used to run the `ver' command to see if its output contains the
  22. # word `Windows'. If this is true, we are running Windows 95 or later:
  23. #
  24. # ifdef COMSPEC
  25. # # First, check if we have the COMSPEC environment variable, which
  26. # # indicates we can use COMMAND.COM's internal commands
  27. # is_windows := $(findstring Windows,$(strip $(shell ver)))
  28. # endif
  29. #
  30. # Unfortunately, this also detects the case when one is running
  31. # DOS 7.x (the MS-DOS version that lies below Windows) without actually
  32. # launching the GUI.
  33. #
  34. # A better test is to check whether there are both the environment
  35. # variables `winbootdir' and `windir'. The first indicates an
  36. # underlying DOS 7.x, while the second is set only if windows is
  37. # available.
  38. #
  39. # Note that on Windows NT, such an environment variable will not be seen
  40. # from DOS-based tools like DJGPP's make; this is not actually a problem
  41. # since NT is detected independently above. But do not try to be clever!
  42. #
  43. ifdef winbootdir
  44. ifdef windir
  45. PLATFORM := windows
  46. endif
  47. endif
  48. endif # test NT
  49. endif # test PLATFORM ansi
  50. ifeq ($(PLATFORM),windows)
  51. DELETE := del
  52. CAT := type
  53. SEP := $(BACKSLASH)
  54. # Setting COPY is a bit trickier. Plain COPY on NT will not work
  55. # correctly, because it will uppercase 8.3 filenames, creating a
  56. # `CONFIG.MK' file which isn't found later on by `make'.
  57. # Since we do not want that, we need to force execution of CMD.EXE.
  58. # Unfortunately, CMD.EXE is not available on Windows 9X.
  59. # So we need to hack.
  60. #
  61. # Kudos to Eli Zaretskii (DJGPP guru) that helped debug it.
  62. # Details are available in threads of the FreeType mailing list
  63. # (2004-11-11), and then in the devel mailing list (2004-11-20 to -23).
  64. #
  65. ifeq ($(OS),Windows_NT)
  66. COPY := >nul cmd.exe /c copy
  67. else
  68. COPY := >nul copy
  69. endif # test NT
  70. # gcc Makefile by default
  71. CONFIG_FILE := w32-gcc.mk
  72. ifeq ($(firstword $(CC)),cc)
  73. CC := gcc
  74. endif
  75. ifneq ($(findstring list,$(MAKECMDGOALS)),) # test for the "list" target
  76. dump_target_list:
  77. $(info )
  78. $(info $(PROJECT_TITLE) build system -- supported compilers)
  79. $(info )
  80. $(info Several command-line compilers are supported on Win32:)
  81. $(info )
  82. $(info $(empty) make setup gcc (with Mingw))
  83. $(info $(empty) make setup visualc Microsoft Visual C++)
  84. $(info $(empty) make setup bcc32 Borland C/C++)
  85. $(info $(empty) make setup lcc Win32-LCC)
  86. $(info $(empty) make setup intelc Intel C/C++)
  87. $(info )
  88. setup: dump_target_list
  89. .PHONY: dump_target_list list
  90. else
  91. setup: std_setup
  92. endif
  93. # additionally, we provide hooks for various other compilers
  94. #
  95. ifneq ($(findstring visualc,$(MAKECMDGOALS)),) # Visual C/C++
  96. CONFIG_FILE := w32-vcc.mk
  97. CC := cl
  98. .PHONY: visualc
  99. visualc: setup
  100. @cd .
  101. endif
  102. ifneq ($(findstring intelc,$(MAKECMDGOALS)),) # Intel C/C++
  103. CONFIG_FILE := w32-intl.mk
  104. CC := cl
  105. .PHONY: intelc
  106. visualc: setup
  107. @cd .
  108. endif
  109. ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++
  110. CONFIG_FILE := w32-wat.mk
  111. CC := wcc386
  112. .PHONY: watcom
  113. watcom: setup
  114. @cd .
  115. endif
  116. ifneq ($(findstring visualage,$(MAKECMDGOALS)),) # Visual Age C++
  117. CONFIG_FILE := w32-icc.mk
  118. CC := icc
  119. .PHONY: visualage
  120. visualage: setup
  121. @cd .
  122. endif
  123. ifneq ($(findstring lcc,$(MAKECMDGOALS)),) # LCC-Win32
  124. CONFIG_FILE := w32-lcc.mk
  125. CC := lcc
  126. .PHONY: lcc
  127. lcc: setup
  128. @cd .
  129. endif
  130. ifneq ($(findstring mingw32,$(MAKECMDGOALS)),) # mingw32
  131. CONFIG_FILE := w32-mingw32.mk
  132. CC := gcc
  133. .PHONY: mingw32
  134. mingw32: setup
  135. @cd .
  136. endif
  137. ifneq ($(findstring bcc32,$(MAKECMDGOALS)),) # Borland C++
  138. CONFIG_FILE := w32-bcc.mk
  139. CC := bcc32
  140. .PHONY: bcc32
  141. bcc32: setup
  142. @cd .
  143. endif
  144. ifneq ($(findstring devel-bcc,$(MAKECMDGOALS)),) # development target
  145. CONFIG_FILE := w32-bccd.mk
  146. CC := bcc32
  147. .PHONY: devel-bcc
  148. devel-bcc: setup
  149. @cd .
  150. endif
  151. ifneq ($(findstring devel-gcc,$(MAKECMDGOALS)),) # development target
  152. CONFIG_FILE := w32-dev.mk
  153. CC := gcc
  154. .PHONY: devel-gcc
  155. devel-gcc: setup
  156. @cd .
  157. endif
  158. endif # test PLATFORM windows
  159. # EOF