David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame^] | 1 | #****************************************************************************** |
| 2 | #* |
| 3 | #* FreeType build system - top-level Makefile |
| 4 | #* |
| 5 | #* This file is designed for GNU Make, do not use it with another Make tool. |
| 6 | #* It works as follows : |
| 7 | #* |
| 8 | #* - when invoked for the first time, this Makefile will include |
| 9 | #* the rules found in `freetype/config/detect.mk'. They are in charge |
| 10 | #* of detecting the current platform. |
| 11 | #* |
| 12 | #* A summary of the detection will be displayed, and the file `config.mk' |
| 13 | #* will be created in the current directory |
| 14 | #* |
| 15 | #* |
| 16 | #* - when invoked later, this Makefile will include the rules found in |
| 17 | #* `config.mk'. This sub-Makefile will define some system-specific |
| 18 | #* variables (like compiler, compilation flags, object suffix, etc..), |
| 19 | #* then include the rules found in `freetype/config/freetype.mk', |
| 20 | #* used to build the library. |
| 21 | #* |
| 22 | #* See the comments in `config/detect.mk' and `config/freetype.mk' for |
| 23 | #* more details on host platform detection and library builds.. |
| 24 | #* |
| 25 | #****************************************************************************** |
| 26 | |
| 27 | .PHONY: setup |
| 28 | |
| 29 | # |
| 30 | # The variable TOP holds the path to the topmost directory in the FreeType |
| 31 | # engine source hierarchy. If it is not defined, default it to '.' |
| 32 | # |
| 33 | ifndef TOP |
| 34 | TOP := . |
| 35 | endif |
| 36 | |
| 37 | CONFIG_MK := config.mk |
| 38 | |
| 39 | ############################################################################# |
| 40 | # |
| 41 | # If no configuration sub-makefile is present, or if "setup" is the target |
| 42 | # to be built, run the auto-detection rules to figure out which configuration |
| 43 | # rules file to use.. |
| 44 | # |
| 45 | # Note that the configuration file is put in the current directory, which is |
| 46 | # not necessarily TOP. |
| 47 | # |
| 48 | |
| 49 | # if `config.mk' is not present, set "check_platform" and "first_time" |
| 50 | # |
| 51 | ifeq ($(wildcard $(CONFIG_MK)),) |
| 52 | check_platform := 1 |
| 53 | first_time := 1 |
| 54 | endif |
| 55 | |
| 56 | # if `setup' is one of the targets requested, set "check_platform" |
| 57 | # |
| 58 | ifneq ($(findstring setup,$(MAKECMDGOALS)),) |
| 59 | check_platform := 1 |
| 60 | endif |
| 61 | |
| 62 | |
| 63 | ######################################################################### |
| 64 | # |
| 65 | # include the automatic host platform detection rules when we need to |
| 66 | # check the platform. |
| 67 | # |
| 68 | # |
| 69 | ifdef check_platform |
| 70 | |
| 71 | all: setup |
| 72 | |
| 73 | include $(TOP)/config/detect.mk |
| 74 | |
| 75 | # "setup" must be defined by the host platform detection rules |
| 76 | |
| 77 | else |
| 78 | |
| 79 | ######################################################################## |
| 80 | # |
| 81 | # A configuration sub-Makefile is present, simply run it.. |
| 82 | # |
| 83 | # |
| 84 | all: build_freetype |
| 85 | |
| 86 | BUILD_FREETYPE := yes |
| 87 | include $(CONFIG_MK) |
| 88 | |
| 89 | endif #test check_platform |
| 90 | |