blob: f5aa8a6bf7796383a205aafb9b1413ca41fe192b [file] [log] [blame]
Werner Lembergfebe3fb2000-03-05 01:14:19 +00001#
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 Turnerd2b1f351999-12-16 23:11:37 +000036
37.PHONY: setup
38
David Turnerd2b1f351999-12-16 23:11:37 +000039# The variable TOP holds the path to the topmost directory in the FreeType
Werner Lembergfebe3fb2000-03-05 01:14:19 +000040# engine source hierarchy. If it is not defined, default it to `.'.
David Turnerd2b1f351999-12-16 23:11:37 +000041#
42ifndef TOP
Werner Lembergfebe3fb2000-03-05 01:14:19 +000043 TOP := .
David Turnerd2b1f351999-12-16 23:11:37 +000044endif
45
46CONFIG_MK := config.mk
47
Werner Lembergfebe3fb2000-03-05 01:14:19 +000048# 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 Turnerd2b1f351999-12-16 23:11:37 +000051#
52# Note that the configuration file is put in the current directory, which is
Werner Lembergfebe3fb2000-03-05 01:14:19 +000053# not necessarily $(TOP).
David Turnerd2b1f351999-12-16 23:11:37 +000054
Werner Lembergfebe3fb2000-03-05 01:14:19 +000055# If `config.mk' is not present, set `check_platform'.
David Turnerd2b1f351999-12-16 23:11:37 +000056#
57ifeq ($(wildcard $(CONFIG_MK)),)
Werner Lembergfebe3fb2000-03-05 01:14:19 +000058 check_platform := 1
David Turnerd2b1f351999-12-16 23:11:37 +000059endif
60
Werner Lembergfebe3fb2000-03-05 01:14:19 +000061# If `setup' is one of the targets requested, set `check_platform'.
David Turnerd2b1f351999-12-16 23:11:37 +000062#
63ifneq ($(findstring setup,$(MAKECMDGOALS)),)
Werner Lembergfebe3fb2000-03-05 01:14:19 +000064 check_platform := 1
David Turnerd2b1f351999-12-16 23:11:37 +000065endif
66
Werner Lembergfebe3fb2000-03-05 01:14:19 +000067# Include the automatic host platform detection rules when we need to
David Turnerd2b1f351999-12-16 23:11:37 +000068# check the platform.
69#
David Turnerd2b1f351999-12-16 23:11:37 +000070ifdef check_platform
71
Werner Lembergfebe3fb2000-03-05 01:14:19 +000072 all: setup
David Turnerd2b1f351999-12-16 23:11:37 +000073
Werner Lembergfebe3fb2000-03-05 01:14:19 +000074 # If the module list $(FT_MODULE_LIST) file is not present, generate it.
75 #
76 modules: make_module_list setup
David Turneraa50b821999-12-29 00:24:51 +000077
Werner Lembergfebe3fb2000-03-05 01:14:19 +000078 include $(TOP)/config/detect.mk
79 include $(TOP)/config/modules.mk
David Turneraa50b821999-12-29 00:24:51 +000080
Werner Lembergfebe3fb2000-03-05 01:14:19 +000081 ifeq ($(wildcard $(FT_MODULE_LIST)),)
82 setup: make_module_list
83 endif
David Turneraa50b821999-12-29 00:24:51 +000084
Werner Lembergfebe3fb2000-03-05 01:14:19 +000085 # 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 Turnerd2b1f351999-12-16 23:11:37 +000089
90else
91
Werner Lembergfebe3fb2000-03-05 01:14:19 +000092 # A configuration sub-Makefile is present -- simply run it.
93 #
94 all: build_freetype
David Turnerd2b1f351999-12-16 23:11:37 +000095
Werner Lembergfebe3fb2000-03-05 01:14:19 +000096 modules: make_module_list
David Turneraa50b821999-12-29 00:24:51 +000097
Werner Lembergfebe3fb2000-03-05 01:14:19 +000098 BUILD_FREETYPE := yes
99 include $(CONFIG_MK)
David Turnerd2b1f351999-12-16 23:11:37 +0000100
Werner Lembergfebe3fb2000-03-05 01:14:19 +0000101endif # test check_platform
David Turnerd2b1f351999-12-16 23:11:37 +0000102
Werner Lembergfebe3fb2000-03-05 01:14:19 +0000103# EOF