046784887d8588506bc65ef02c781ee7f922b378
[reactos.git] / lib / freetype / builds / dos / detect.mk
1 #
2 # FreeType 2 configuration file to detect a DOS host platform.
3 #
4
5
6 # Copyright 1996-2000 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   # Test for DJGPP by checking the DJGPP environment variable, which must be
22   # set in order to use the system (ie. it will always be present when the
23   # `make' utility is run).
24   #
25   # We test for the COMSPEC environment variable, then run the `ver'
26   # command-line program to see if its output contains the word `Dos'.
27   #
28   # If this is true, we are running a Dos-ish platform (or an emulation).
29   #
30   ifdef DJGPP
31     PLATFORM := dos
32   else
33     ifdef COMSPEC
34       is_dos := $(findstring Dos,$(shell ver))
35
36       # We try to recognize a Dos session under OS/2.  The `ver' command
37       # returns `Operating System/2 ...' there, so `is_dos' should be empty.
38       #
39       # To recognize a Dos session under OS/2, we check COMSPEC for the
40       # substring `MDOS\COMMAND'
41       #
42       ifeq ($(is_dos),)
43         is_dos := $(findstring MDOS\COMMAND,$(COMSPEC))
44       endif
45     endif # test COMSPEC
46
47     ifneq ($(is_dos),)
48
49       PLATFORM := dos
50
51     endif # test Dos
52   endif # test DJGPP
53 endif # test PLATFORM ansi
54
55 ifeq ($(PLATFORM),dos)
56
57   # Use DJGPP (i.e. gcc) by default.
58   #
59   CONFIG_FILE := dos-gcc.mk
60   SEP         := /
61   ifndef CC
62     CC        := gcc
63   endif
64
65   # additionally, we provide hooks for various other compilers
66   #
67   ifneq ($(findstring turboc,$(MAKECMDGOALS)),)     # Turbo C
68     CONFIG_FILE := dos-tcc.mk
69     SEP         := $(BACKSLASH)
70     CC          := tcc
71     turboc: setup
72     .PHONY: turboc
73   endif
74
75   ifneq ($(findstring watcom,$(MAKECMDGOALS)),)     # Watcom C/C++
76     CONFIG_FILE := dos-wat.mk
77     SEP         := $(BACKSLASH)
78     CC          := wcc386
79     watcom: setup
80     .PHONY: watcom
81   endif
82
83   ifneq ($(findstring borlandc,$(MAKECMDGOALS)),)   # Borland C/C++ 32-bit
84     CONFIG_FILE := dos-bcc.mk
85     SEP         := $(BACKSLASH)
86     CC          := bcc32
87     borlandc: setup
88     .PHONY: borlandc
89   endif
90
91   ifneq ($(findstring borlandc16,$(MAKECMDGOALS)),) # Borland C/C++ 16-bit
92     CONFIG_FILE := dos-bcc.mk
93     SEP         := $(BACKSLASH)
94     CC          := bcc
95     borlandc16: setup
96     .PHONY: borlandc16
97   endif
98
99   ifneq ($(findstring bash,$(SHELL)),)              # check for bash
100     DELETE := rm
101     COPY   := cp
102     setup: std_setup
103   else
104     DELETE := del
105     COPY   := copy
106     setup: dos_setup
107   endif
108
109 endif     # test PLATFORM dos
110
111 # EOF