modules/freetype2/builds/detect.mk

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/modules/freetype2/builds/detect.mk	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,154 @@
     1.4 +#
     1.5 +# FreeType 2 host platform detection rules
     1.6 +#
     1.7 +
     1.8 +
     1.9 +# Copyright 1996-2003, 2006, 2008, 2013 by
    1.10 +# David Turner, Robert Wilhelm, and Werner Lemberg.
    1.11 +#
    1.12 +# This file is part of the FreeType project, and may only be used, modified,
    1.13 +# and distributed under the terms of the FreeType project license,
    1.14 +# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
    1.15 +# indicate that you have read the license and understand and accept it
    1.16 +# fully.
    1.17 +
    1.18 +
    1.19 +# This sub-Makefile is in charge of detecting the current platform.  It sets
    1.20 +# the following variables:
    1.21 +#
    1.22 +#   BUILD_DIR    The configuration and system-specific directory.  Usually
    1.23 +#                `builds/$(PLATFORM)' but can be different for custom builds
    1.24 +#                of the library.
    1.25 +#
    1.26 +# The following variables must be defined in system specific `detect.mk'
    1.27 +# files:
    1.28 +#
    1.29 +#   PLATFORM     The detected platform.  This will default to `ansi' if
    1.30 +#                auto-detection fails.
    1.31 +#   CONFIG_FILE  The configuration sub-makefile to use.  This usually depends
    1.32 +#                on the compiler defined in the `CC' environment variable.
    1.33 +#   DELETE       The shell command used to remove a given file.
    1.34 +#   COPY         The shell command used to copy one file.
    1.35 +#   SEP          The platform-specific directory separator.
    1.36 +#   COMPILER_SEP The separator used in arguments of the compilation tools.
    1.37 +#   CC           The compiler to use.
    1.38 +#
    1.39 +# You need to set the following variable(s) before calling it:
    1.40 +#
    1.41 +#   TOP_DIR      The top-most directory in the FreeType library source
    1.42 +#                hierarchy.  If not defined, it will default to `.'.
    1.43 +
    1.44 +# Set auto-detection default to `ansi' resp. UNIX-like operating systems.
    1.45 +#
    1.46 +PLATFORM     := ansi
    1.47 +DELETE       := $(RM)
    1.48 +COPY         := cp
    1.49 +CAT          := cat
    1.50 +SEP          := /
    1.51 +
    1.52 +BUILD_CONFIG := $(TOP_DIR)/builds
    1.53 +
    1.54 +# These two assignments must be delayed.
    1.55 +BUILD_DIR    = $(BUILD_CONFIG)/$(PLATFORM)
    1.56 +CONFIG_RULES = $(BUILD_DIR)/$(CONFIG_FILE)
    1.57 +
    1.58 +# We define the BACKSLASH variable to hold a single back-slash character.
    1.59 +# This is needed because a line like
    1.60 +#
    1.61 +#   SEP := \
    1.62 +#
    1.63 +# does not work with GNU Make (the backslash is interpreted as a line
    1.64 +# continuation).  While a line like
    1.65 +#
    1.66 +#   SEP := \\
    1.67 +#
    1.68 +# really defines $(SEP) as `\' on Unix, and `\\' on Dos and Windows!
    1.69 +#
    1.70 +BACKSLASH := $(strip \ )
    1.71 +
    1.72 +# Find all auto-detectable platforms.
    1.73 +#
    1.74 +PLATFORMS := $(notdir $(subst /detect.mk,,$(wildcard $(BUILD_CONFIG)/*/detect.mk)))
    1.75 +.PHONY: $(PLATFORMS) ansi
    1.76 +
    1.77 +# Filter out platform specified as setup target.
    1.78 +#
    1.79 +PLATFORM := $(firstword $(filter $(MAKECMDGOALS),$(PLATFORMS)))
    1.80 +
    1.81 +# If no setup target platform was specified, enable auto-detection/
    1.82 +# default platform.
    1.83 +#
    1.84 +ifeq ($(PLATFORM),)
    1.85 +  PLATFORM := ansi
    1.86 +endif
    1.87 +
    1.88 +# If the user has explicitly asked for `ansi' on the command line,
    1.89 +# disable auto-detection.
    1.90 +#
    1.91 +ifeq ($(findstring ansi,$(MAKECMDGOALS)),)
    1.92 +  # Now, include all detection rule files found in the `builds/<system>'
    1.93 +  # directories.  Note that the calling order of the various `detect.mk'
    1.94 +  # files isn't predictable.
    1.95 +  #
    1.96 +  include $(wildcard $(BUILD_CONFIG)/*/detect.mk)
    1.97 +endif
    1.98 +
    1.99 +# In case no detection rule file was successful, use the default.
   1.100 +#
   1.101 +ifndef CONFIG_FILE
   1.102 +  CONFIG_FILE := ansi.mk
   1.103 +  setup: std_setup
   1.104 +  .PHONY: setup
   1.105 +endif
   1.106 +
   1.107 +# The following targets are equivalent, with the exception that they use
   1.108 +# a slightly different syntax for the `echo' command.
   1.109 +#
   1.110 +# std_setup: defined for most (i.e. Unix-like) platforms
   1.111 +# dos_setup: defined for Dos-ish platforms like Dos, Windows & OS/2
   1.112 +#
   1.113 +.PHONY: std_setup dos_setup
   1.114 +
   1.115 +std_setup:
   1.116 +	@echo ""
   1.117 +	@echo "$(PROJECT_TITLE) build system -- automatic system detection"
   1.118 +	@echo ""
   1.119 +	@echo "The following settings are used:"
   1.120 +	@echo ""
   1.121 +	@echo "  platform                    $(PLATFORM)"
   1.122 +	@echo "  compiler                    $(CC)"
   1.123 +	@echo "  configuration directory     $(BUILD_DIR)"
   1.124 +	@echo "  configuration rules         $(CONFIG_RULES)"
   1.125 +	@echo ""
   1.126 +	@echo "If this does not correspond to your system or settings please remove the file"
   1.127 +	@echo "\`$(CONFIG_MK)' from this directory then read the INSTALL file for help."
   1.128 +	@echo ""
   1.129 +	@echo "Otherwise, simply type \`$(MAKE)' again to build the library,"
   1.130 +	@echo "or \`$(MAKE) refdoc' to build the API reference (the latter needs python)."
   1.131 +	@echo ""
   1.132 +	@$(COPY) $(CONFIG_RULES) $(CONFIG_MK)
   1.133 +
   1.134 +
   1.135 +# Special case for Dos, Windows, OS/2, where echo "" doesn't work correctly!
   1.136 +#
   1.137 +dos_setup:
   1.138 +	@type builds$(SEP)newline
   1.139 +	@echo $(PROJECT_TITLE) build system -- automatic system detection
   1.140 +	@type builds$(SEP)newline
   1.141 +	@echo The following settings are used:
   1.142 +	@type builds$(SEP)newline
   1.143 +	@echo   platform˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙$(PLATFORM)
   1.144 +	@echo   compiler˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙$(CC)
   1.145 +	@echo   configuration directory˙˙˙˙˙˙$(subst /,$(SEP),$(BUILD_DIR))
   1.146 +	@echo   configuration rules˙˙˙˙˙˙˙˙˙˙$(subst /,$(SEP),$(CONFIG_RULES))
   1.147 +	@type builds$(SEP)newline
   1.148 +	@echo If this does not correspond to your system or settings please remove the file
   1.149 +	@echo '$(CONFIG_MK)' from this directory then read the INSTALL file for help.
   1.150 +	@type builds$(SEP)newline
   1.151 +	@echo Otherwise, simply type 'make' again to build the library.
   1.152 +	@echo or 'make refdoc' to build the API reference (the latter needs python).
   1.153 +	@type builds$(SEP)newline
   1.154 +	@$(COPY) $(subst /,$(SEP),$(CONFIG_RULES) $(CONFIG_MK)) > nul
   1.155 +
   1.156 +
   1.157 +# EOF

mercurial