2 # FreeType 2 configuration file to detect a Win32 host platform.
6 # Copyright (C) 1996-2020 by
7 # David Turner, Robert Wilhelm, and Werner Lemberg.
9 # This file is part of the FreeType project, and may only be used, modified,
10 # and distributed under the terms of the FreeType project license,
11 # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 # indicate that you have read the license and understand and accept it
19 ifeq ($(PLATFORM),ansi)
21 # Detecting Windows NT is easy, as the OS variable must be defined and
22 # contains `Windows_NT'. This also works with Windows 2000 and XP.
24 ifeq ($(OS),Windows_NT)
30 # Detecting Windows 9X
32 # We used to run the `ver' command to see if its output contains the
33 # word `Windows'. If this is true, we are running Windows 95 or later:
36 # # First, check if we have the COMSPEC environment variable, which
37 # # indicates we can use COMMAND.COM's internal commands
38 # is_windows := $(findstring Windows,$(strip $(shell ver)))
41 # Unfortunately, this also detects the case when one is running
42 # DOS 7.x (the MS-DOS version that lies below Windows) without actually
45 # A better test is to check whether there are both the environment
46 # variables `winbootdir' and `windir'. The first indicates an
47 # underlying DOS 7.x, while the second is set only if windows is
50 # Note that on Windows NT, such an environment variable will not be seen
51 # from DOS-based tools like DJGPP's make; this is not actually a problem
52 # since NT is detected independently above. But do not try to be clever!
64 endif # test PLATFORM ansi
66 ifeq ($(PLATFORM),windows)
72 # Setting COPY is a bit trickier. Plain COPY on NT will not work
73 # correctly, because it will uppercase 8.3 filenames, creating a
74 # `CONFIG.MK' file which isn't found later on by `make'.
75 # Since we do not want that, we need to force execution of CMD.EXE.
76 # Unfortunately, CMD.EXE is not available on Windows 9X.
79 # Kudos to Eli Zaretskii (DJGPP guru) that helped debug it.
80 # Details are available in threads of the FreeType mailing list
81 # (2004-11-11), and then in the devel mailing list (2004-11-20 to -23).
83 ifeq ($(OS),Windows_NT)
84 COPY := cmd.exe /c copy
90 # gcc Makefile by default
91 CONFIG_FILE := w32-gcc.mk
92 ifeq ($(firstword $(CC)),cc)
96 ifneq ($(findstring list,$(MAKECMDGOALS)),) # test for the "list" target
99 $(info $(PROJECT_TITLE) build system -- supported compilers)
101 $(info Several command-line compilers are supported on Win32:)
103 $(info $(empty) make setup gcc (with Mingw))
104 $(info $(empty) make setup visualc Microsoft Visual C++)
105 $(info $(empty) make setup bcc32 Borland C/C++)
106 $(info $(empty) make setup lcc Win32-LCC)
107 $(info $(empty) make setup intelc Intel C/C++)
110 setup: dump_target_list
111 .PHONY: dump_target_list list
116 # additionally, we provide hooks for various other compilers
118 ifneq ($(findstring visualc,$(MAKECMDGOALS)),) # Visual C/C++
119 CONFIG_FILE := w32-vcc.mk
127 ifneq ($(findstring intelc,$(MAKECMDGOALS)),) # Intel C/C++
128 CONFIG_FILE := w32-intl.mk
136 ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++
137 CONFIG_FILE := w32-wat.mk
145 ifneq ($(findstring visualage,$(MAKECMDGOALS)),) # Visual Age C++
146 CONFIG_FILE := w32-icc.mk
154 ifneq ($(findstring lcc,$(MAKECMDGOALS)),) # LCC-Win32
155 CONFIG_FILE := w32-lcc.mk
163 ifneq ($(findstring mingw32,$(MAKECMDGOALS)),) # mingw32
164 CONFIG_FILE := w32-mingw32.mk
172 ifneq ($(findstring bcc32,$(MAKECMDGOALS)),) # Borland C++
173 CONFIG_FILE := w32-bcc.mk
181 ifneq ($(findstring devel-bcc,$(MAKECMDGOALS)),) # development target
182 CONFIG_FILE := w32-bccd.mk
190 ifneq ($(findstring devel-gcc,$(MAKECMDGOALS)),) # development target
191 CONFIG_FILE := w32-dev.mk
199 endif # test PLATFORM windows