blob: 5932377e8d2904a488c49a5a764147a06a3f385e [file] [log] [blame]
David Turnerd2b1f351999-12-16 23:11:37 +00001#******************************************************************************
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#
33ifndef TOP
34TOP := .
35endif
36
37CONFIG_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#
51ifeq ($(wildcard $(CONFIG_MK)),)
52check_platform := 1
53first_time := 1
54endif
55
56# if `setup' is one of the targets requested, set "check_platform"
57#
58ifneq ($(findstring setup,$(MAKECMDGOALS)),)
59check_platform := 1
60endif
61
62
63#########################################################################
64#
65# include the automatic host platform detection rules when we need to
66# check the platform.
67#
68#
69ifdef check_platform
70
71all: setup
72
73include $(TOP)/config/detect.mk
74
75# "setup" must be defined by the host platform detection rules
76
77else
78
79########################################################################
80#
81# A configuration sub-Makefile is present, simply run it..
82#
83#
84all: build_freetype
85
86BUILD_FREETYPE := yes
87include $(CONFIG_MK)
88
89endif #test check_platform
90