blob: d81b97170a342e51c777a4d0267ae34d8b7b5f06 [file] [log] [blame]
David Turner74043012000-07-08 00:22:20 +00001#
2# FreeType 2 host platform detection rules
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# This sub-Makefile is in charge of detecting the current platform. It sets
17# the following variables:
18#
19# BUILD The configuration and system-specific directory. Usually
David Turnera90663f2000-07-08 00:41:13 +000020# `freetype/builds/$(PLATFORM)' but can be different for
David Turner74043012000-07-08 00:22:20 +000021# custom builds of the library.
22#
23# The following variables must be defined in system specific `detect.mk'
24# files:
25#
26# PLATFORM The detected platform. This will default to `ansi' if
27# auto-detection fails.
28# CONFIG_FILE The configuration sub-makefile to use. This usually depends
29# on the compiler defined in the `CC' environment variable.
30# DELETE The shell command used to remove a given file.
31# COPY The shell command used to copy one file.
32# SEP The platform-specific directory separator.
33# CC The compiler to use.
34#
35# You need to set the following variable(s) before calling it:
36#
37# TOP The top-most directory in the FreeType library source
38# hierarchy. If not defined, it will default to `.'.
39
40# If TOP is not defined, default it to `.'
41#
42ifndef TOP
43 TOP := .
44endif
45
46# Set auto-detection default to `ansi' resp. UNIX-like operating systems.
Werner Lembergbd547dc2000-09-22 21:23:29 +000047# Note that we delay evaluation of $(BUILD_CONFIG_), $(BUILD), and
David Turner74043012000-07-08 00:22:20 +000048# $(CONFIG_RULES).
49#
50PLATFORM := ansi
51DELETE := $(RM)
52COPY := cp
53SEP := /
54
David Turnera90663f2000-07-08 00:41:13 +000055BUILD_CONFIG_ = $(TOP)$(SEP)builds$(SEP)
David Turner74043012000-07-08 00:22:20 +000056BUILD = $(BUILD_CONFIG_)$(PLATFORM)
57CONFIG_RULES = $(BUILD)$(SEP)$(CONFIG_FILE)
58
59# We define the BACKSLASH variable to hold a single back-slash character.
60# This is needed because a line like
61#
62# SEP := \
63#
64# does not work with GNU Make (the backslash is interpreted as a line
65# continuation). While a line like
66#
67# SEP := \\
68#
69# really defines $(SEP) as `\' on Unix, and `\\' on Dos and Windows!
70#
71BACKSLASH := $(strip \ )
72
David Turnera90663f2000-07-08 00:41:13 +000073# Now, include all detection rule files found in the `builds/<system>'
David Turner74043012000-07-08 00:22:20 +000074# directories. Note that the calling order of the various `detect.mk' files
75# isn't predictable.
76#
77include $(wildcard $(BUILD_CONFIG_)*/detect.mk)
78
79# In case no detection rule file was successful, use the default.
80#
81ifndef CONFIG_FILE
82 CONFIG_FILE := ansi.mk
83 setup: std_setup
84endif
85
86# The following targets are equivalent, with the exception that they use
87# a slightly different syntax for the `echo' command.
88#
89# std_setup: defined for most (i.e. Unix-like) platforms
90# dos_setup: defined for Dos-ish platforms like Dos, Windows & OS/2
91#
92.PHONY: std_setup dos_setup
93
94std_setup:
95 @echo ""
96 @echo "FreeType build system -- automatic system detection"
97 @echo ""
98 @echo "The following settings are used:"
99 @echo ""
100 @echo " platform $(PLATFORM)"
101 @echo " compiler $(CC)"
102 @echo " configuration directory $(BUILD)"
103 @echo " configuration rules $(CONFIG_RULES)"
104 @echo ""
105 @echo "If this does not correspond to your system or settings please remove the file"
106 @echo "\`$(CONFIG_MK)' from this directory then read the INSTALL file for help."
107 @echo ""
108 @echo "Otherwise, simply type \`make' again to build the library."
109 @echo ""
110 @$(COPY) $(CONFIG_RULES) $(CONFIG_MK)
111
112dos_setup:
113 @echo ÿ
114 @echo FreeType build system -- automatic system detection
115 @echo ÿ
116 @echo The following settings are used:
117 @echo ÿ
118 @echo ÿÿplatformÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$(PLATFORM)
119 @echo ÿÿcompilerÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$(CC)
120 @echo ÿÿconfiguration directoryÿÿÿÿÿÿ$(BUILD)
121 @echo ÿÿconfiguration rulesÿÿÿÿÿÿÿÿÿÿ$(CONFIG_RULES)
122 @echo ÿ
123 @echo If this does not correspond to your system or settings please remove the file
124 @echo '$(CONFIG_MK)' from this directory then read the INSTALL file for help.
125 @echo ÿ
126 @echo Otherwise, simply type 'make' again to build the library.
127 @echo ÿ
128 @$(COPY) $(subst /,\,$(CONFIG_RULES) $(CONFIG_MK)) > nul
129
130# EOF