blob: 81103b0b5daf1ed59f67bea805aadb8498cf0d18 [file] [log] [blame]
Werner Lemberg60a04df2005-06-04 23:04:30 +00001# FreeType 2 top Jamfile.
David Turner5bf0a392001-03-24 17:10:09 +00002#
Werner Lemberg169a6d82005-08-25 06:00:55 +00003# Copyright 2001, 2002, 2003, 2004, 2005 by
Werner Lemberg60a04df2005-06-04 23:04:30 +00004# David Turner, Robert Wilhelm, and Werner Lemberg.
5#
6# This file is part of the FreeType project, and may only be used, modified,
7# and distributed under the terms of the FreeType project license,
8# LICENSE.TXT. By continuing to use, modify, or distribute this file you
9# indicate that you have read the license and understand and accept it
10# fully.
11
David Turner5bf0a392001-03-24 17:10:09 +000012
David Turner60b32e12002-11-06 22:32:54 +000013# The HDRMACRO is already defined in FTJam and is used to add
14# the content of certain macros to the list of included header
15# files.
16#
Werner Lemberga16c4a72003-04-21 13:30:27 +000017# We can compile FreeType 2 with classic Jam however thanks to
David Turner60b32e12002-11-06 22:32:54 +000018# the following code
19#
20if ! $(JAM_TOOLSET)
21{
22 rule HDRMACRO
23 {
Werner Lemberga16c4a72003-04-21 13:30:27 +000024 # nothing
David Turner60b32e12002-11-06 22:32:54 +000025 }
26}
27
Werner Lemberga16c4a72003-04-21 13:30:27 +000028
Werner Lemberga1844e02001-04-03 21:07:36 +000029# We need to invoke a SubDir rule if the FT2 source directory top is not the
30# current directory. This allows us to build FreeType 2 as part of a larger
31# project easily.
David Turner5bf0a392001-03-24 17:10:09 +000032#
33if $(FT2_TOP) != $(DOT)
34{
Werner Lemberga1844e02001-04-03 21:07:36 +000035 SubDir FT2_TOP ;
David Turner5bf0a392001-03-24 17:10:09 +000036}
37
Werner Lemberga16c4a72003-04-21 13:30:27 +000038
39# The following macros define the include directory, the source directory,
40# and the final library name (without library extensions). They can be
David Turner60b32e12002-11-06 22:32:54 +000041# replaced by other definitions when the library is compiled as part of
42# a larger project.
43#
David Turner5bf0a392001-03-24 17:10:09 +000044
Werner Lemberga16c4a72003-04-21 13:30:27 +000045# Name of FreeType include directory during compilation.
46# This is relative to FT2_TOP.
David Turner60b32e12002-11-06 22:32:54 +000047#
48FT2_INCLUDE_DIR ?= include ;
David Turner5bf0a392001-03-24 17:10:09 +000049
Werner Lemberga16c4a72003-04-21 13:30:27 +000050# Name of FreeType source directory during compilation.
51# This is relative to FT2_TOP.
David Turner60b32e12002-11-06 22:32:54 +000052#
53FT2_SRC_DIR ?= src ;
54
Werner Lemberga16c4a72003-04-21 13:30:27 +000055# Name of final library, without extension.
David Turner60b32e12002-11-06 22:32:54 +000056#
57FT2_LIB ?= $(LIBPREFIX)freetype ;
58
59
Werner Lemberga16c4a72003-04-21 13:30:27 +000060# Define FT2_BUILD_INCLUDE to point to your build-specific directory.
61# This is prepended to FT2_INCLUDE_DIR. It can be used to specify
David Turner60b32e12002-11-06 22:32:54 +000062# the location of a custom <ft2build.h> which will point to custom
Werner Lemberg8e6c56f2005-10-18 06:09:13 +000063# versions of `ftmodule.h' and `ftoption.h', for example.
David Turner60b32e12002-11-06 22:32:54 +000064#
65FT2_BUILD_INCLUDE ?= ;
66
Werner Lemberga16c4a72003-04-21 13:30:27 +000067# The list of modules to compile on any given build of the library.
68# By default, this will contain _all_ modules defined in FT2_SRC_DIR.
David Turner60b32e12002-11-06 22:32:54 +000069#
Werner Lemberg8e6c56f2005-10-18 06:09:13 +000070# IMPORTANT: You'll need to change the content of `ftmodule.h' as well
David Turner60b32e12002-11-06 22:32:54 +000071# if you modify this list or provide your own.
72#
David Turnercf2c49c2003-12-24 18:42:04 +000073FT2_COMPONENTS ?= autofit # auto-fitter
David Turner60b32e12002-11-06 22:32:54 +000074 base # base component (public APIs)
75 bdf # BDF font driver
76 cache # cache sub-system
77 cff # CFF/CEF font driver
Werner Lemberga16c4a72003-04-21 13:30:27 +000078 cid # PostScript CID-keyed font driver
Suzuki, Toshiya (鈴木俊哉)a4386212005-08-24 04:31:31 +000079 gxvalid # validation of TrueTypeGX/AAT tables
Werner Lembergdfa46192004-03-05 09:26:24 +000080 gzip # support for gzip-compressed files
81 lzw # support for LZW-compressed files
David Turnerc5621622005-06-30 11:46:46 +000082 otvalid # validation of OpenType tables
David Turner60b32e12002-11-06 22:32:54 +000083 pcf # PCF font driver
84 pfr # PFR/TrueDoc font driver
Werner Lemberga16c4a72003-04-21 13:30:27 +000085 psaux # common PostScript routines module
86 pshinter # PostScript hinter module
87 psnames # PostScript names handling
88 raster # monochrome rasterizer
89 smooth # anti-aliased rasterizer
David Turner60b32e12002-11-06 22:32:54 +000090 sfnt # SFNT-based format support routines
91 truetype # TrueType font driver
Werner Lemberga16c4a72003-04-21 13:30:27 +000092 type1 # PostScript Type 1 font driver
93 type42 # PostScript Type 42 (embedded TrueType) driver
David Turner60b32e12002-11-06 22:32:54 +000094 winfonts # Windows FON/FNT font driver
95 ;
96
97
Werner Lemberga16c4a72003-04-21 13:30:27 +000098# Don't touch.
David Turner60b32e12002-11-06 22:32:54 +000099#
100FT2_INCLUDE = $(FT2_BUILD_INCLUDE)
101 [ FT2_SubDir $(FT2_INCLUDE_DIR) ] ;
102
103FT2_SRC = [ FT2_SubDir $(FT2_SRC_DIR) ] ;
104
David Turner3c40d732003-08-17 22:31:23 +0000105# Location of API Reference Documentation
106#
107if $(DOC_DIR)
108{
109 DOC_DIR = $(DOCDIR:T) ;
110}
111else
112{
113 DOC_DIR = docs/reference ;
114}
115
116
Werner Lemberga16c4a72003-04-21 13:30:27 +0000117# Only used by FreeType developers.
David Turner60b32e12002-11-06 22:32:54 +0000118#
David Turnerc9349c92001-10-18 11:59:08 +0000119if $(DEBUG_HINTER)
120{
121 CCFLAGS += -DDEBUG_HINTER ;
122}
123
124
Werner Lemberg8e6c56f2005-10-18 06:09:13 +0000125# We need `freetype2/include' in the current include path in order to
Werner Lemberga1844e02001-04-03 21:07:36 +0000126# compile any part of FreeType 2.
David Turner5bf0a392001-03-24 17:10:09 +0000127#
David Turnercce3c802003-01-08 09:10:53 +0000128HDRS += $(FT2_INCLUDE) ;
129
David Turnerff0e9e62006-01-27 09:15:53 +0000130# We need to #define FT2_BUILD_LIBRARY so that our sources find the
131# internal headers
132#
133DEFINES += FT2_BUILD_LIBRARY ;
David Turnercce3c802003-01-08 09:10:53 +0000134
Werner Lemberga1844e02001-04-03 21:07:36 +0000135# Uncomment the following line if you want to build individual source files
Werner Lemberga16c4a72003-04-21 13:30:27 +0000136# for each FreeType 2 module. This is only useful during development, and
137# is better defined as an environment variable anyway!
David Turner5bf0a392001-03-24 17:10:09 +0000138#
Werner Lemberg1429db62001-04-02 23:54:01 +0000139# FT2_MULTI = true ;
David Turner5bf0a392001-03-24 17:10:09 +0000140
Werner Lemberga16c4a72003-04-21 13:30:27 +0000141
David Turner6059b032001-05-14 14:01:00 +0000142# The file <freetype/config/ftheader.h> is used to define macros that are
Werner Lemberga1844e02001-04-03 21:07:36 +0000143# later used in #include statements. It needs to be parsed in order to
144# record these definitions.
David Turner5bf0a392001-03-24 17:10:09 +0000145#
David Turnerb3de8172001-05-11 14:25:02 +0000146HDRMACRO [ FT2_SubDir include freetype config ftheader.h ] ;
David Turnerc9349c92001-10-18 11:59:08 +0000147HDRMACRO [ FT2_SubDir include freetype internal internal.h ] ;
David Turner5bf0a392001-03-24 17:10:09 +0000148
Werner Lemberga16c4a72003-04-21 13:30:27 +0000149
Werner Lemberg8e6c56f2005-10-18 06:09:13 +0000150# Now include the Jamfile in `freetype2/src', used to drive the compilation
Werner Lemberga1844e02001-04-03 21:07:36 +0000151# of each FreeType 2 component and/or module.
David Turner5bf0a392001-03-24 17:10:09 +0000152#
David Turner60b32e12002-11-06 22:32:54 +0000153SubInclude FT2_TOP $(FT2_SRC_DIR) ;
David Turner5bf0a392001-03-24 17:10:09 +0000154
Werner Lemberg8e6c56f2005-10-18 06:09:13 +0000155# Handle the generation of the `ftexport.sym' file which contain the list
156# of exported symbols. This can be used on Unix by libtool.
David Turner6c5299e2005-10-16 08:29:12 +0000157#
158SubInclude FT2_TOP $(FT2_SRC_DIR) tools ;
159
160rule GenExportSymbols
161{
David Turner9fbd2ab2005-10-28 16:14:14 +0000162 local apinames = apinames$(SUFEXE) ;
163 local headers = [ Glob $(2) : *.h ] ;
David Turner6c5299e2005-10-16 08:29:12 +0000164
David Turner8def3c82005-12-14 16:38:31 +0000165 LOCATE on $(1) = $(ALL_LOCATE_TARGET) ;
166
David Turner6c5299e2005-10-16 08:29:12 +0000167 APINAMES on $(1) = apinames$(SUFEXE) ;
168
David Turner9fbd2ab2005-10-28 16:14:14 +0000169 Depends $(1) : $(apinames) $(headers) ;
David Turner6c5299e2005-10-16 08:29:12 +0000170 GenExportSymbols1 $(1) : $(headers) ;
David Turner9fbd2ab2005-10-28 16:14:14 +0000171 Clean clean : $(1) ;
David Turner6c5299e2005-10-16 08:29:12 +0000172}
173
174actions GenExportSymbols1 bind APINAMES
175{
176 $(APINAMES) $(2) > $(1)
177}
178
179GenExportSymbols ftexport.sym : include/freetype include/freetype/cache ;
David Turner5bf0a392001-03-24 17:10:09 +0000180
Werner Lemberga16c4a72003-04-21 13:30:27 +0000181# Test files (hinter debugging). Only used by FreeType developers.
David Turnerc9349c92001-10-18 11:59:08 +0000182#
183if $(DEBUG_HINTER)
184{
185 SubInclude FT2_TOP tests ;
186}
187
David Turnere6bb9532005-12-23 13:32:06 +0000188rule RefDoc
189{
190 Depends $1 : all ;
191 NotFile $1 ;
192 Always $1 ;
193}
194
David Turner3c40d732003-08-17 22:31:23 +0000195actions RefDoc
196{
Werner Lemberg17439422004-08-11 05:25:37 +0000197 python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.1.10 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h $(FT2_INCLUDE)/freetype/cache/*.h
David Turner3c40d732003-08-17 22:31:23 +0000198}
199
200RefDoc refdoc ;
201
202
Werner Lemberga1844e02001-04-03 21:07:36 +0000203# end of top Jamfile