Home | History | Annotate | Download | only in freetype
      1 # FreeType 2 top Jamfile.
      2 #
      3 # Copyright 2001-2018 by
      4 # 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 
     12 
     13 # 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 #
     17 # We can compile FreeType 2 with classic Jam however thanks to
     18 # the following code
     19 #
     20 if ! $(JAM_TOOLSET)
     21 {
     22   rule HDRMACRO
     23   {
     24     # nothing
     25   }
     26 }
     27 
     28 
     29 # 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.
     32 #
     33 if $(FT2_TOP) != $(DOT)
     34 {
     35   SubDir  FT2_TOP ;
     36 }
     37 
     38 
     39 # The following macros define the include directory, the source directory,
     40 # and the final library name (without library extensions).  They can be
     41 # replaced by other definitions when the library is compiled as part of
     42 # a larger project.
     43 #
     44 
     45 # Name of FreeType include directory during compilation.
     46 # This is relative to FT2_TOP.
     47 #
     48 FT2_INCLUDE_DIR ?= include ;
     49 
     50 # Name of FreeType source directory during compilation.
     51 # This is relative to FT2_TOP.
     52 #
     53 FT2_SRC_DIR ?= src ;
     54 
     55 # Name of final library, without extension.
     56 #
     57 FT2_LIB ?= $(LIBPREFIX)freetype ;
     58 
     59 
     60 # 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
     62 # the location of a custom <ft2build.h> which will point to custom
     63 # versions of `ftmodule.h' and `ftoption.h', for example.
     64 #
     65 FT2_BUILD_INCLUDE ?= ;
     66 
     67 # 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.
     69 #
     70 # IMPORTANT: You'll need to change the content of `ftmodule.h' as well
     71 #            if you modify this list or provide your own.
     72 #
     73 FT2_COMPONENTS ?= autofit    # auto-fitter
     74                   base       # base component (public APIs)
     75                   bdf        # BDF font driver
     76                   bzip2      # support for bzip2-compressed PCF font
     77                   cache      # cache sub-system
     78                   cff        # CFF/CEF font driver
     79                   cid        # PostScript CID-keyed font driver
     80                   gzip       # support for gzip-compressed PCF font
     81                   lzw        # support for LZW-compressed PCF font
     82                   pcf        # PCF font driver
     83                   pfr        # PFR/TrueDoc font driver
     84                   psaux      # common PostScript routines module
     85                   pshinter   # PostScript hinter module
     86                   psnames    # PostScript names handling
     87                   raster     # monochrome rasterizer
     88                   sfnt       # SFNT-based format support routines
     89                   smooth     # anti-aliased rasterizer
     90                   truetype   # TrueType font driver
     91                   type1      # PostScript Type 1 font driver
     92                   type42     # PostScript Type 42 (embedded TrueType) driver
     93                   winfonts   # Windows FON/FNT font driver
     94                   ;
     95 
     96 
     97 # Don't touch.
     98 #
     99 FT2_INCLUDE  = $(FT2_BUILD_INCLUDE)
    100                [ FT2_SubDir $(FT2_INCLUDE_DIR) ] ;
    101 
    102 FT2_SRC      = [ FT2_SubDir $(FT2_SRC_DIR) ] ;
    103 
    104 # Location of API Reference Documentation
    105 #
    106 if $(DOC_DIR)
    107 {
    108   DOC_DIR = $(DOCDIR:T) ;
    109 }
    110 else
    111 {
    112   DOC_DIR = docs/reference ;
    113 }
    114 
    115 
    116 # Only used by FreeType developers.
    117 #
    118 if $(DEBUG_HINTER)
    119 {
    120   CCFLAGS += -DDEBUG_HINTER ;
    121 }
    122 
    123 
    124 # We need `include' in the current include path in order to
    125 # compile any part of FreeType 2.
    126 #
    127 HDRS += $(FT2_INCLUDE) ;
    128 
    129 
    130 # We need to #define FT2_BUILD_LIBRARY so that our sources find the
    131 # internal headers
    132 #
    133 CCFLAGS += -DFT2_BUILD_LIBRARY ;
    134 
    135 # Uncomment the following line if you want to build individual source files
    136 # for each FreeType 2 module.  This is only useful during development, and
    137 # is better defined as an environment variable anyway!
    138 #
    139 # FT2_MULTI = true ;
    140 
    141 
    142 # The files `ftheader.h', `internal.h', and `ftserv.h' are used to define
    143 # macros that are later used in #include statements.  They need to be parsed
    144 # in order to record these definitions.
    145 #
    146 HDRMACRO  [ FT2_SubDir  $(FT2_INCLUDE_DIR) freetype config ftheader.h ] ;
    147 HDRMACRO  [ FT2_SubDir  $(FT2_INCLUDE_DIR) freetype internal internal.h ] ;
    148 HDRMACRO  [ FT2_SubDir  $(FT2_INCLUDE_DIR) freetype internal ftserv.h ] ;
    149 
    150 
    151 # Now include the Jamfile in `freetype2/src', used to drive the compilation
    152 # of each FreeType 2 component and/or module.
    153 #
    154 SubInclude  FT2_TOP $(FT2_SRC_DIR) ;
    155 
    156 # Handle the generation of the `ftexport.sym' file, which contains the list
    157 # of exported symbols.  This can be used on Unix by libtool.
    158 #
    159 SubInclude FT2_TOP $(FT2_SRC_DIR) tools ;
    160 
    161 rule GenExportSymbols
    162 {
    163   local  apinames = apinames$(SUFEXE) ;
    164   local  aheader ;
    165   local  headers ;
    166 
    167   for aheader in [ Glob $(2) : *.h ]
    168   {
    169     switch $(aheader)
    170     {
    171       case */ftmac.h :
    172         if ( $(MAC) || $(OS) = MACOSX ) {
    173           headers += $(aheader) ;
    174         }
    175       case *.h : headers += $(aheader) ;
    176     }
    177   }
    178 
    179   LOCATE on $(1) = $(ALL_LOCATE_TARGET) ;
    180 
    181   APINAMES on $(1) = apinames$(SUFEXE) ;
    182 
    183   Depends            $(1) : $(apinames) $(headers) ;
    184   GenExportSymbols1  $(1) : $(headers) ;
    185   Clean              clean : $(1) ;
    186 }
    187 
    188 actions GenExportSymbols1 bind APINAMES
    189 {
    190   $(APINAMES) $(2) > $(1)
    191 }
    192 
    193 GenExportSymbols  ftexport.sym : include/freetype ;
    194 
    195 # Test files (hinter debugging).  Only used by FreeType developers.
    196 #
    197 if $(DEBUG_HINTER)
    198 {
    199   SubInclude FT2_TOP tests ;
    200 }
    201 
    202 rule RefDoc
    203 {
    204   Depends  $1 : all ;
    205   NotFile  $1 ;
    206   Always   $1 ;
    207 }
    208 
    209 actions RefDoc
    210 {
    211   python $(FT2_SRC)/tools/docmaker/docmaker.py
    212          --prefix=ft2
    213          --title=FreeType-2.9
    214          --output=$(DOC_DIR)
    215          $(FT2_INCLUDE)/freetype/*.h
    216          $(FT2_INCLUDE)/freetype/config/*.h
    217 }
    218 
    219 RefDoc  refdoc ;
    220 
    221 
    222 # end of top Jamfile
    223