Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #
  2. # FreeType 2 configuration file to detect a Win32 host platform.
  3. #
  4.  
  5.  
  6. # Copyright 1996-2000, 2003, 2004, 2006, 2007 by
  7. # David Turner, Robert Wilhelm, and Werner Lemberg.
  8. #
  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
  13. # fully.
  14.  
  15.  
  16. .PHONY: setup
  17.  
  18.  
  19. ifeq ($(PLATFORM),ansi)
  20.  
  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.
  23.   #
  24.   ifeq ($(OS),Windows_NT)
  25.  
  26.     PLATFORM := win32
  27.  
  28.   else
  29.  
  30.     # Detecting Windows 9X
  31.  
  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:
  34.     #
  35.     #   ifdef COMSPEC
  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)))
  39.     #   endif
  40.     #
  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
  43.     # launching the GUI.
  44.     #
  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 win32 is available.
  48.     #
  49.     # Note that on Windows NT, such an environment variable will not be seen
  50.     # from DOS-based tools like DJGPP's make; this is not actually a problem
  51.     # since NT is detected independently above.  But do not try to be clever!
  52.     #
  53.     ifdef winbootdir
  54.       ifdef windir
  55.  
  56.         PLATFORM := win32
  57.  
  58.       endif
  59.     endif
  60.  
  61.   endif  # test NT
  62.  
  63. endif # test PLATFORM ansi
  64.  
  65. ifeq ($(PLATFORM),win32)
  66.  
  67.   DELETE := del
  68.   CAT    := type
  69.   SEP    := $(BACKSLASH)
  70.  
  71.   # Setting COPY is a bit trickier.  Plain COPY on NT will not work
  72.   # correctly, because it will uppercase 8.3 filenames, creating a
  73.   # `CONFIG.MK' file which isn't found later on by `make'.
  74.   # Since we do not want that, we need to force execution of CMD.EXE.
  75.   # Unfortunately, CMD.EXE is not available on Windows 9X.
  76.   # So we need to hack.
  77.   #
  78.   # Kudos to Eli Zaretskii (DJGPP guru) that helped debug it.
  79.   # Details are available in threads of the freetype mailing list
  80.   # (2004-11-11), and then in the devel mailing list (2004-11-20 to -23).
  81.   #
  82.   ifeq ($(OS),Windows_NT)
  83.     COPY := cmd.exe /c copy
  84.   else
  85.     COPY := copy
  86.   endif  # test NT
  87.  
  88.  
  89.   # gcc Makefile by default
  90.   CONFIG_FILE := w32-gcc.mk
  91.   ifeq ($(firstword $(CC)),cc)
  92.     CC        := gcc
  93.   endif
  94.  
  95.   ifneq ($(findstring list,$(MAKECMDGOALS)),)  # test for the "list" target
  96.     dump_target_list:
  97.             @echo ÿ
  98.             @echo $(PROJECT_TITLE) build system -- supported compilers
  99.             @echo ÿ
  100.             @echo Several command-line compilers are supported on Win32:
  101.             @echo ÿ
  102.             @echo ÿÿmake setupÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿgcc (with Mingw)
  103.             @echo ÿÿmake setup visualcÿÿÿÿÿÿÿÿÿÿÿÿÿMicrosoft Visual C++
  104.             @echo ÿÿmake setup bcc32ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿBorland C/C++
  105.             @echo ÿÿmake setup lccÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿWin32-LCC
  106.             @echo ÿÿmake setup intelcÿÿÿÿÿÿÿÿÿÿÿÿÿÿIntel C/C++
  107.             @echo ÿ
  108.  
  109.     setup: dump_target_list
  110.     .PHONY: dump_target_list list
  111.   else
  112.     setup: dos_setup
  113.   endif
  114.  
  115.   # additionally, we provide hooks for various other compilers
  116.   #
  117.   ifneq ($(findstring visualc,$(MAKECMDGOALS)),)     # Visual C/C++
  118.     CONFIG_FILE := w32-vcc.mk
  119.     CC          := cl
  120.     visualc: setup
  121.     .PHONY: visualc
  122.   endif
  123.  
  124.   ifneq ($(findstring intelc,$(MAKECMDGOALS)),)      # Intel C/C++
  125.     CONFIG_FILE := w32-intl.mk
  126.     CC          := cl
  127.     visualc: setup
  128.     .PHONY: intelc
  129.   endif
  130.  
  131.   ifneq ($(findstring watcom,$(MAKECMDGOALS)),)      # Watcom C/C++
  132.     CONFIG_FILE := w32-wat.mk
  133.     CC          := wcc386
  134.     watcom: setup
  135.     .PHONY: watcom
  136.   endif
  137.  
  138.   ifneq ($(findstring visualage,$(MAKECMDGOALS)),)   # Visual Age C++
  139.     CONFIG_FILE := w32-icc.mk
  140.     CC          := icc
  141.     visualage: setup
  142.     .PHONY: visualage
  143.   endif
  144.  
  145.   ifneq ($(findstring lcc,$(MAKECMDGOALS)),)         # LCC-Win32
  146.     CONFIG_FILE := w32-lcc.mk
  147.     CC          := lcc
  148.     lcc: setup
  149.     .PHONY: lcc
  150.   endif
  151.  
  152.   ifneq ($(findstring mingw32,$(MAKECMDGOALS)),)     # mingw32
  153.     CONFIG_FILE := w32-mingw32.mk
  154.     CC          := gcc
  155.     mingw32: setup
  156.     .PHONY: mingw32
  157.   endif
  158.  
  159.   ifneq ($(findstring bcc32,$(MAKECMDGOALS)),)       # Borland C++
  160.     CONFIG_FILE := w32-bcc.mk
  161.     CC          := bcc32
  162.     bcc32: setup
  163.     .PHONY: bcc32
  164.   endif
  165.  
  166.   ifneq ($(findstring devel-bcc,$(MAKECMDGOALS)),)   # development target
  167.     CONFIG_FILE := w32-bccd.mk
  168.     CC          := bcc32
  169.     devel-bcc: setup
  170.     .PHONY: devel-bcc
  171.   endif
  172.  
  173.   ifneq ($(findstring devel-gcc,$(MAKECMDGOALS)),)   # development target
  174.     CONFIG_FILE := w32-dev.mk
  175.     CC          := gcc
  176.     devel-gcc: setup
  177.     .PHONY: devel-gcc
  178.   endif
  179.  
  180. endif   # test PLATFORM win32
  181.  
  182.  
  183. # EOF
  184.