2
# FreeType 2 host platform detection rules
6
# Copyright 1996-2000, 2001, 2002, 2003, 2006, 2008 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
16
# This sub-Makefile is in charge of detecting the current platform. It sets
17
# the following variables:
19
# BUILD_DIR The configuration and system-specific directory. Usually
20
# `freetype/builds/$(PLATFORM)' but can be different for
21
# custom builds of the library.
23
# The following variables must be defined in system specific `detect.mk'
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
# COMPILER_SEP The separator used in arguments of the compilation tools.
34
# CC The compiler to use.
36
# You need to set the following variable(s) before calling it:
38
# TOP_DIR The top-most directory in the FreeType library source
39
# hierarchy. If not defined, it will default to `.'.
41
# Set auto-detection default to `ansi' resp. UNIX-like operating systems.
49
BUILD_CONFIG := $(TOP_DIR)/builds
51
# These two assignments must be delayed.
52
BUILD_DIR = $(BUILD_CONFIG)/$(PLATFORM)
53
CONFIG_RULES = $(BUILD_DIR)/$(CONFIG_FILE)
55
# We define the BACKSLASH variable to hold a single back-slash character.
56
# This is needed because a line like
60
# does not work with GNU Make (the backslash is interpreted as a line
61
# continuation). While a line like
65
# really defines $(SEP) as `\' on Unix, and `\\' on Dos and Windows!
67
BACKSLASH := $(strip \ )
69
# Find all auto-detectable platforms.
71
PLATFORMS := $(notdir $(subst /detect.mk,,$(wildcard $(BUILD_CONFIG)/*/detect.mk)))
72
.PHONY: $(PLATFORMS) ansi
74
# Filter out platform specified as setup target.
76
PLATFORM := $(firstword $(filter $(MAKECMDGOALS),$(PLATFORMS)))
78
# If no setup target platform was specified, enable auto-detection/
85
# If the user has explicitly asked for `ansi' on the command line,
86
# disable auto-detection.
88
ifeq ($(findstring ansi,$(MAKECMDGOALS)),)
89
# Now, include all detection rule files found in the `builds/<system>'
90
# directories. Note that the calling order of the various `detect.mk'
91
# files isn't predictable.
93
include $(wildcard $(BUILD_CONFIG)/*/detect.mk)
96
# In case no detection rule file was successful, use the default.
99
CONFIG_FILE := ansi.mk
104
# The following targets are equivalent, with the exception that they use
105
# a slightly different syntax for the `echo' command.
107
# std_setup: defined for most (i.e. Unix-like) platforms
108
# dos_setup: defined for Dos-ish platforms like Dos, Windows & OS/2
110
.PHONY: std_setup dos_setup
114
@echo "$(PROJECT_TITLE) build system -- automatic system detection"
116
@echo "The following settings are used:"
118
@echo " platform $(PLATFORM)"
119
@echo " compiler $(CC)"
120
@echo " configuration directory $(BUILD_DIR)"
121
@echo " configuration rules $(CONFIG_RULES)"
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."
126
@echo "Otherwise, simply type \`$(MAKE)' again to build the library,"
127
@echo "or \`$(MAKE) refdoc' to build the API reference (the latter needs python)."
129
@$(COPY) $(CONFIG_RULES) $(CONFIG_MK)
132
# Special case for Dos, Windows, OS/2, where echo "" doesn't work correctly!
135
@type builds$(SEP)newline
136
@echo $(PROJECT_TITLE) build system -- automatic system detection
137
@type builds$(SEP)newline
138
@echo The following settings are used:
139
@type builds$(SEP)newline
140
@echo platform���������������������$(PLATFORM)
141
@echo compiler���������������������$(CC)
142
@echo configuration directory������$(subst /,$(SEP),$(BUILD_DIR))
143
@echo configuration rules����������$(subst /,$(SEP),$(CONFIG_RULES))
144
@type builds$(SEP)newline
145
@echo If this does not correspond to your system or settings please remove the file
146
@echo '$(CONFIG_MK)' from this directory then read the INSTALL file for help.
147
@type builds$(SEP)newline
148
@echo Otherwise, simply type 'make' again to build the library.
149
@echo or 'make refdoc' to build the API reference (the latter needs python).
150
@type builds$(SEP)newline
151
@$(COPY) $(subst /,$(SEP),$(CONFIG_RULES) $(CONFIG_MK)) > nul