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