shithub: freetype+ttf2subf

Download patch

ref: e35cac66c652480b0d682647e92c2e7ef5cf7081
parent: cb9109fc4013c04b1fdb6c6c1bd1294dd3602448
author: Werner Lemberg <[email protected]>
date: Sat Jun 10 23:46:57 EDT 2000

A complete revision of FreeType 2's GNU makefiles (of the library):

  Tons of unnecessary stuff have been removed; only the essential rules
  have been retained.

  The source files now depend on all header files in include/freetype,
  include/freetype/config, and include/freetype/internal.  This is not
  optimal, I know, and I'll try to improve this, but it is better than
  before (namely no dependencies on `internal').

  FTDEBUG_SRC has been added (similar to FTSYS_SRC) -- I don't know
  exactly whether this is really useful, but it doesn't harm.

  There is now more documentation in the makefiles itself.

io-frames.html: Use of <th>, <code>, and <var> for better tagging.

Reactivating of FT_DEBUG_LEVEL_xxx macros.

Added a lot of #include directives to make `multi' builds possible -- note
that currently the modules cid, t1, and t1z have clashing structures and
functions which means that you can only use one of these three modules for a
multi build.

Added some missing function declarations to (local) header files.

Renamed some T1_Open_Face() to CID_Open_Face() in the cid module -- a lot
of other functions should be renamed also...

Replaced many FT_xxx stuff with T1_xxx in t1z driver -- this isn't finished
yet...

Fixed FT_Free() to allow a NULL pointer without an assertion (this has
always been a valid assumption in FreeType, at least in FT 1.x).

A lot of other, minor fixes (mostly documentation).

git/fs: mount .git/fs: mount/attach disallowed
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT. By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
@@ -91,7 +91,7 @@
 
   # A configuration sub-Makefile is present -- simply run it.
   #
-  all: build_freetype
+  all: single
 
   modules: make_module_list
 
--- a/config/ansi/ansi.mk
+++ b/config/ansi/ansi.mk
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
@@ -36,7 +36,7 @@
 OBJ_DIR := obj
 
 
-# The directory where all library files are placed
+# The directory where all library files are placed.
 #
 # By default, this is the same as $(OBJ_DIR), however, this can be changed
 # to suit particular needs.
@@ -121,7 +121,7 @@
   # It is part of the system-specific sub-Makefile because not all
   # librarians accept a simple syntax like:
   #
-  #    librarian library_file {list of object files} 
+  #   librarian library_file {list of object files}
   #
   $(FT_LIBRARY): $(OBJECTS_LIST)
 	  -$(DELETE) $@
--- a/config/detect.mk
+++ b/config/detect.mk
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
@@ -40,17 +40,17 @@
 # If TOP is not defined, default it to `.'
 #
 ifndef TOP
-TOP := .
+  TOP := .
 endif
 
-# Set auto-detection default to `ansi'.
+# Set auto-detection default to `ansi' resp. UNIX-like operating systems.
 # Note that we delay the evaluation of $(BUILD_CONFIG_), $(BUILD), and
 # $(CONFIG_RULES).
 #
-PLATFORM    := ansi
-DELETE      := $(RM)
-COPY        := cp
-SEP         := /
+PLATFORM := ansi
+DELETE   := $(RM)
+COPY     := cp
+SEP      := /
 
 BUILD_CONFIG_ = $(TOP)$(SEP)config$(SEP)
 BUILD         = $(BUILD_CONFIG_)$(PLATFORM)
@@ -84,7 +84,7 @@
 endif
 
 # The following targets are equivalent, with the exception that they use
-# slightly different syntaxes for the `echo' command.
+# a slightly different syntax for the `echo' command.
 #
 # std_setup: defined for most (i.e. Unix-like) platforms
 # dos_setup: defined for Dos-ish platforms like Dos, Windows & OS/2
--- a/config/dos/detect.mk
+++ b/config/dos/detect.mk
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
@@ -25,8 +25,7 @@
     is_dos := $(findstring Dos,$(shell ver))
 
     # We try to recognize a Dos session under OS/2.  The `ver' command
-    # returns `Operating System/2 ...' there, so `is_dos' should be empty
-    # there.
+    # returns `Operating System/2 ...' there, so `is_dos' should be empty.
     #
     # To recognize a Dos session under OS/2, we check COMSPEC for the
     # substring `MDOS\COMMAND'
@@ -49,6 +48,8 @@
         CC        := gcc
       endif
 
+      # additionally, we provide hooks for various other compilers
+      #
       ifneq ($(findstring turboc,$(MAKECMDGOALS)),)     # Turbo C
         CONFIG_FILE := dos-tcc.mk
         SEP         := $(BACKSLASH)
@@ -63,7 +64,7 @@
         .PHONY: watcom
       endif
 
-      ifneq ($(findstring borlandc16,$(MAKECMDGOALS)),) # Borland C/C++ 16 bits
+      ifneq ($(findstring borlandc16,$(MAKECMDGOALS)),) # Borland C/C++ 16-bit
         CONFIG_FILE := dos-bcc.mk
         SEP         := $(BACKSLASH)
         CC          := bcc
@@ -70,7 +71,7 @@
         .PHONY: borlandc16
       endif
 
-      ifneq ($(findstring borlandc,$(MAKECMDGOALS)),)   # Borland C/C++ 32 bits
+      ifneq ($(findstring borlandc,$(MAKECMDGOALS)),)   # Borland C/C++ 32-bit
         CONFIG_FILE := dos-bcc.mk
         SEP         := $(BACKSLASH)
         CC          := bcc32
--- a/config/dos/dos-gcc.mk
+++ b/config/dos/dos-gcc.mk
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
--- a/config/freetype.mk
+++ b/config/freetype.mk
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
@@ -17,14 +17,59 @@
 # OTHER MAKEFILES.
 
 
+# The following variables (set by other Makefile components, in the
+# environment, or on the command line) are used:
+#
+#   BUILD          The architecture dependent directory,
+#                  e.g. `$(TOP)/config/unix'.
+#
+#   OBJ_DIR        The directory in which object files are created.
+#
+#   LIB_DIR        The directory in which the library is created.
+#
+#   INCLUDES       A list of directories to be included additionally.
+#                  Usually empty.
+#
+#   CFLAGS         Compilation flags.  This overrides the default settings
+#                  in the platform-specific configuration files.
+#
+#   FTSYS_SRC      If set, its value is used as the name of a replacement
+#                  file for `src/base/ftsystem.c'.
+#
+#   FTDEBUG_SRC    If set, its value is used as the name of a replacement
+#                  file for `src/base/ftdebug.c'.  [For a normal build, this
+#                  file does nothing.]
+#
+#   FT_MODULE_LIST The file which contains the list of modules for the
+#                  current build.  Usually, this is automatically created by
+#                  `modules.mk'.
+#
+#   BASE_OBJ_S
+#   BASE_OBJ_M     A list of base objects (for single object and multiple
+#                  object builds, respectively).  Set up in
+#                  `src/base/rules.mk'.
+#
+#   BASE_EXT_OBJ   A list of base extension objects.  Set up in
+#                  `src/base/rules.mk'.
+#
+#   DRV_OBJ_S
+#   DRV_OBJ_M      A list of driver objects (for single object and multiple
+#                  object builds, respectively).  Set up cumulatively in
+#                  `src/<driver>/rules.mk'.
+#
+#   TOP, SEP,
+#   LIBRARY, CC,
+#   A, I, O, T     Check `config.mk' for details.
+
+
 # The targets `objects' and `library' are defined at the end of this
-# Makefile when all rules have been included.
+# Makefile after all other rules have been included.
 #
-.PHONY: build_freetype objects library
+.PHONY: single objects library
 
-# default target -- build objects and library
+# default target -- build single objects and library
 #
-build_freetype: objects library
+single: objects library
 
 # `multi' target -- build multiple objects and library
 #
@@ -31,13 +76,13 @@
 multi: objects library
 
 
-# The FreeType source directory.
+# The FreeType source directory, usually `./src'.
 #
 SRC := $(TOP)$(SEP)src
 
 
-# The directory where the base layer components are placed.  By default,
-# this is `freetype/src/base'.
+# The directory where the base layer components are placed, usually
+# `./src/base'.
 #
 BASE_DIR := $(SRC)$(SEP)base
 
@@ -45,7 +90,7 @@
 # A few short-cuts in order to avoid typing $(SEP) all the time for the
 # directory separator.
 #
-# For example:  SRC_ equals to `./src/' where `.' is $(TOP).
+# For example: $(SRC_) equals to `./src/' where `.' is $(TOP).
 #
 #
 SRC_      := $(SRC)$(SEP)
@@ -57,7 +102,7 @@
 CONFIG_   := $(PUBLIC_)config$(SEP)
 
 
-# The name of the final library file.
+# The final name of the library file.
 #
 FT_LIBRARY := $(LIB_)$(LIBRARY).$A
 
@@ -76,7 +121,7 @@
 
 
 # C flags used for the compilation of an object file.  This must include at
-# least the paths for the `base' and `config/<system>' directories,
+# least the paths for the `base' and `config/<system>' directories;
 # debug/optimization/warning flags + ansi compliance if needed.
 #
 FT_CFLAGS  = $(CFLAGS) $(INCLUDE_FLAGS)
@@ -84,65 +129,64 @@
 FT_COMPILE = $(CC) $(ANSIFLAGS) $(FT_CFLAGS)
 
 
-# include the `modules' rules file
+# Include the `modules' rules file.
 #
 include $(TOP)/config/modules.mk
 
 
-# Free the lists of driver objects.
+# Initialize the list of objects.
 #
-COMPONENTS_LIST :=
-DRIVERS_LIST    :=
-OBJECTS_LIST    :=
+OBJECTS_LIST :=
 
+
 # Define $(PUBLIC_H) as the list of all public header files located in
-# `$(TOP)/include'.
+# `$(TOP)/include/freetype'.  $(BASE_H) and $(CONFIG_H) are defined
+# similarly.
 #
-PUBLIC_H := $(wildcard $(PUBLIC_)*.h)
-BASE_H   := $(wildcard $(INTERNAL_)*.h)
+# This is used to simplify the dependency rules -- if one of these files
+# changes, the whole library is recompiled.
+#
+PUBLIC_H   := $(wildcard $(PUBLIC_)*.h)
+BASE_H     := $(wildcard $(INTERNAL_)*.h)
+CONFIG_H   := $(wildcard $(CONFIG_)*.h)
 
-# System-specific component -- this must be defined in this Makefile for
-# easy updates.  The default ANSI ftsystem.c is located in
-# `freetype/config/ftsystem.c'.  However, some system-specific configuration
-# might define $(FTSYS_SRC) to fetch it in other places, like
-# `freetype/config/<system>/ftsystem.c'.
+FREETYPE_H := $(PUBLIC_H) $(BASE_H) $(CONFIG_H)
+
+
+# ftsystem component
 #
-# $(BASE_H) is defined in `src/base/rules.mk' and contains the list of all
-# base layer header files.
-#
 ifndef FTSYS_SRC
   FTSYS_SRC = $(BASE_)ftsystem.c
 endif
+
 FTSYS_OBJ = $(OBJ_)ftsystem.$O
 
 OBJECTS_LIST += $(FTSYS_OBJ)
 
-$(FTSYS_OBJ): $(FTSYS_SRC) $(BASE_H)
+$(FTSYS_OBJ): $(FTSYS_SRC) $(FREETYPE_H)
 	$(FT_COMPILE) $T$@ $<
 
 
 # ftdebug component
 #
-# FTDebug contains code used to print traces and errors.  It is normally
-# empty for a release build (see ftoption.h).
-#
-FTDEBUG_SRC = $(BASE_)ftdebug.c
+ifndef FTDEBUG_SRC
+  FTDEBUG_SRC = $(BASE_)ftdebug.c
+endif
+
 FTDEBUG_OBJ = $(OBJ_)ftdebug.$O
 
 OBJECTS_LIST += $(FTDEBUG_OBJ)
 
-$(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(BASE_H)
+$(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(FREETYPE_H)
 	$(FT_COMPILE) $T$@ $<
 
 
-
-
 # Include all rule files from FreeType components.
 #
 include $(wildcard $(SRC)/*/rules.mk)
 
 
-# FTInit file
+# ftinit component
 #
 #   The C source `ftinit.c' contains the FreeType initialization routines.
 #   It is able to automatically register one or more drivers when the API
@@ -149,7 +193,7 @@
 #   function FT_Init_FreeType() is called.
 #
 #   The set of initial drivers is determined by the driver Makefiles
-#   includes above.  Each driver Makefile updates the FTINIT_xxxx lists
+#   includes above.  Each driver Makefile updates the FTINIT_xxx lists
 #   which contain additional include paths and macros used to compile the
 #   single `ftinit.c' source.
 #
@@ -158,7 +202,7 @@
 
 OBJECTS_LIST += $(FTINIT_OBJ)
 
-$(FTINIT_OBJ): $(FTINIT_SRC) $(PUBLIC_H) $(FT_MODULE_LIST)
+$(FTINIT_OBJ): $(FTINIT_SRC) $(FREETYPE_H) $(FT_MODULE_LIST)
 	$(FT_COMPILE) $T$@ $<
 
 
@@ -221,11 +265,10 @@
 
 # The `config.mk' file must define `clean_freetype' and
 # `distclean_freetype'.  Implementations may use to relay these to either
-# the `std' or `dos' versions, or simply provide their own implementation.
+# the `std' or `dos' versions from above, or simply provide their own
+# implementation.
 #
 clean: clean_freetype
 distclean: distclean_freetype remove_config_mk
 
 # EOF
-
-
--- a/config/modules.mk
+++ b/config/modules.mk
@@ -5,7 +5,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
@@ -17,12 +17,12 @@
 
 
 # This file is in charge of handling the generation of the modules list
-# file, normally located in `config/ftmodule.h'.
+# file.
 
 .PHONY: make_module_list clean_module_list remake_module_list
 
 # MODULE_LIST, as its name suggests, indicates where the modules list
-# resides.  For now, it is in `config/ftmodule.h'.
+# resides.  For now, it is in `include/freetype/config/ftmodule.h'.
 #
 ifndef FT_MODULE_LIST
   FT_MODULE_LIST := $(TOP)$(SEP)include$(SEP)freetype$(SEP)config$(SEP)ftmodule.h
@@ -29,6 +29,9 @@
 endif
 
 # To build the modules list, we invoke the `make_module_list' target.
+#
+# This rule is commented out by default since FreeType comes already with
+# a ftmodule.h file.
 #
 #$(FT_MODULE_LIST): make_module_list
 
--- a/config/os2/detect.mk
+++ b/config/os2/detect.mk
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
@@ -14,6 +14,7 @@
 
 
 ifeq ($(PLATFORM),ansi)
+
   ifdef OS2_SHELL
 
     PLATFORM := os2
@@ -23,6 +24,8 @@
     CONFIG_FILE := os2-gcc.mk   # gcc-emx by default
     SEP         := /
 
+    # additionally, we provide hooks for various other compilers
+    #
     ifneq ($(findstring visualage,$(MAKECMDGOALS)),)     # Visual Age C++
       CONFIG_FILE := os2-icc.mk
       SEP         := $(BACKSLASH)
@@ -37,7 +40,7 @@
       .PHONY: watcom
     endif
 
-    ifneq ($(findstring borlandc,$(MAKECMDGOALS)),)      # Borland C++ 32 bits
+    ifneq ($(findstring borlandc,$(MAKECMDGOALS)),)      # Borland C++ 32-bit
       CONFIG_FILE := os2-bcc.mk
       SEP         := $(BACKSLASH)
       CC          := bcc32
@@ -44,7 +47,7 @@
       .PHONY: borlandc
     endif
 
-    ifneq ($(findstring devel,$(MAKECMDGOALS)),)
+    ifneq ($(findstring devel,$(MAKECMDGOALS)),)         # development target
       CONFIG_FILE := os2-dev.mk
       CC          := gcc
       SEP         := /
--- a/config/os2/os2-dev.mk
+++ b/config/os2/os2-dev.mk
@@ -1,24 +1,22 @@
-#*******************************************************************
-#*
-#*  FreeType 2 Configuration rules for OS/2 + gcc
-#*  THIS VERSION TURNS OFF OPTIMIZATIONS FOR DEBUGGING !!
-#*
-#*  Copyright 1996-2000 by
-#*  David Turner, Robert Wilhelm, and Werner Lemberg.
-#*
-#*  This file is part of the FreeType project, and may only be used
-#*  modified and distributed under the terms of the FreeType project
-#*  license, LICENSE.TXT.  By continuing to use, modify, or distribute
-#*  this file you indicate that you have read the license and
-#*  understand and accept it fully.
-#*
-#*  Please read the file "freetype/docs/config.txt" to understand
-#*  what this file does..
-#*
-#*******************************************************************
+#
+# FreeType 2 configuration rules for OS/2 + gcc
+#
+#   Development version without optimizations.
+#
 
+
+# Copyright 1996-2000 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+
+
 ifndef TOP
-TOP := .
+  TOP := .
 endif
 
 DELETE   := del
@@ -28,88 +26,79 @@
 PLATFORM := os2
 CC       := gcc
 
-# the directory where all object files are placed
+# The directory where all object files are placed.
 #
-# Note that this is not $(TOP)/obj !!
-# This lets you build the library in your own directory
-# with something like :
+# Note that this is not $(TOP)/obj!
+# This lets you build the library in your own directory with something like
 #
-#  set TOP=....../path/to/freetype2/top/dir...
-#  mkdir obj
-#  make -f %TOP%/Makefile setup  [options]
-#  make -f %TOP%/Makefile
+#   set TOP=.../path/to/freetype2/top/dir...
+#   mkdir obj
+#   make -f %TOP%/Makefile setup [options]
+#   make -f %TOP%/Makefile
 #
-#
 OBJ_DIR := obj
 
 
-# the directory where all library files are placed
+# The directory where all library files are placed.
 #
-#  by default, this is the same as OBJ_DIR, however, this can be
-#  changed to suit particular needs..
+# By default, this is the same as $(OBJ_DIR), however, this can be changed
+# to suit particular needs.
 #
 LIB_DIR := $(OBJ_DIR)
 
 
-# the object file extension, this can be .o, .tco, .obj, etc..
-# depending on the platform
+# The object file extension.  This can be .o, .tco, .obj, etc., depending on
+# the platform.
 #
 O := o
 
-# the library file extension, this can be .a, .lib, etc..
-# depending on the platform
+# The library file extension.  This can be .a, .lib, etc., depending on the
+# platform.
 #
 A := a
 
 
-# The name of the final library file.
-# Note that the DOS-specific Makefile uses a shorter (8.3) name
+# The name of the final library file.  Note that the DOS-specific Makefile
+# uses a shorter (8.3) name.
 #
 LIBRARY := libfreetype
 
 
-# path inclusion flag.
+# Path inclusion flag.  Some compilers use a different flag than `-I' to
+# specify an additional include path.  Examples are `/i=' or `-J'.
 #
-#  Some compilers use a different flag than '-I' to specify an
-#  additional include path. Examples are "/i=" or "-J", etc...
-#
 I := -I
 
 
-# The link flag used to specify a given library file on link.
-# Note that this is only used to compile the demo programs, not
-# the library itself.
+# C flag used to define a macro before the compilation of a given source
+# object.  Usually is `-D' like in `-DDEBUG'.
 #
-L := -l
+D := -D
 
 
-# C flag used to define a macro before the compilation of a given
-# source object. Usually is '-D' like in "-DDEBUG"
+# The link flag used to specify a given library file on link.  Note that
+# this is only used to compile the demo programs, not the library itself.
 #
-D := -D
+L := -l
 
 
-# Target flag - beware, there is a space after the 'o' !!
+# Target flag.
 #
-#
-T := -o 
+T := -o # Don't remove this comment line!  We need the space after `-o'.
 
 
 # C flags
 #
-#   These should concern :
+#   These should concern: debug output, optimization & warnings.
 #
-#     - debug output
-#     - optimization
-#     - warnings
-#     - ansi compliance..
+#   Use the ANSIFLAGS variable to define the compiler flags used to enfore
+#   ANSI compliance.
 #
 ifndef CFLAGS
-CFLAGS := -c -g -O0 -Wall
+  CFLAGS := -c -g -O0 -Wall
 endif
 
-# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant
-#             nothing (if it already is by default like LCC).
+# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
 ANSIFLAGS := -ansi -pedantic
 
@@ -116,41 +105,31 @@
 
 ifdef BUILD_FREETYPE
 
-include $(TOP)/config/freetype.mk
+  # Now include the main sub-makefile.  It contains all the rules used to
+  # build the library with the previous variables defined.
+  #
+  include $(TOP)/config/freetype.mk
 
-clean_freetype: clean_freetype_dos
-distclean_freetype: distclean_freetype_dos
+  # The cleanup targets.
+  #
+  clean_freetype: clean_freetype_dos
+  distclean_freetype: distclean_freetype_dos
 
-# Librarian to use to build the static library
-#
-FT_LIBRARIAN := $(AR) -r
+  # Librarian to use to build the static library
+  #
+  FT_LIBRARIAN := $(AR) -r
 
 
-# This final rule is used to link all object files into a single
-# library. It is part of the system-specific sub-Makefile because not
-# all librarians accept a simple syntax like :
-#
-#    librarian library_file {list of object files} 
-#
-$(FT_LIBRARY): $(OBJECTS_LIST)
-	-$(DELETE) $@
-	$(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
+  # This final rule is used to link all object files into a single library. 
+  # It is part of the system-specific sub-Makefile because not all
+  # librarians accept a simple syntax like
+  #
+  #   librarian library_file {list of object files} 
+  #
+  $(FT_LIBRARY): $(OBJECTS_LIST)
+	  -$(DELETE) $@
+	  $(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
 
-
-# Cleaning rules
-#
-DIR_OBJ := $(subst $(SEP),\,$(OBJ_DIR))
-
-clean_freetype_objects:
-	-del $(DIR_OBJ)\*.$O
-
-clean_freetype_lib:
-	-del $(subst $(SEP),\,$(FT_LIBRARY))
-
-clean: clean_freetype_objects
-
-
-
 endif
 
-
+# EOF
--- a/config/os2/os2-gcc.mk
+++ b/config/os2/os2-gcc.mk
@@ -1,23 +1,20 @@
-#*******************************************************************
-#*
-#*  FreeType 2 Configuration rules for OS/2 + gcc
-#*
-#*  Copyright 1996-2000 by
-#*  David Turner, Robert Wilhelm, and Werner Lemberg.
-#*
-#*  This file is part of the FreeType project, and may only be used
-#*  modified and distributed under the terms of the FreeType project
-#*  license, LICENSE.TXT.  By continuing to use, modify, or distribute
-#*  this file you indicate that you have read the license and
-#*  understand and accept it fully.
-#*
-#*  Please read the file "freetype/docs/config.txt" to understand
-#*  what this file does..
-#*
-#*******************************************************************
+#
+# FreeType 2 configuration rules for OS/2 + gcc
+#
 
+
+# Copyright 1996-2000 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+
+
 ifndef TOP
-TOP := .
+  TOP := .
 endif
 
 DELETE   := del
@@ -27,88 +24,79 @@
 PLATFORM := os2
 CC       := gcc
 
-# the directory where all object files are placed
+# The directory where all object files are placed.
 #
-# Note that this is not $(TOP)/obj !!
-# This lets you build the library in your own directory
-# with something like :
+# Note that this is not $(TOP)/obj!
+# This lets you build the library in your own directory with something like
 #
-#  set TOP=....../path/to/freetype2/top/dir...
-#  mkdir obj
-#  make -f %TOP%/Makefile setup  [options]
-#  make -f %TOP%/Makefile
+#   set TOP=.../path/to/freetype2/top/dir...
+#   mkdir obj
+#   make -f %TOP%/Makefile setup [options]
+#   make -f %TOP%/Makefile
 #
-#
 OBJ_DIR := obj
 
 
-# the directory where all library files are placed
+# The directory where all library files are placed.
 #
-#  by default, this is the same as OBJ_DIR, however, this can be
-#  changed to suit particular needs..
+# By default, this is the same as $(OBJ_DIR), however, this can be changed
+# to suit particular needs.
 #
 LIB_DIR := $(OBJ_DIR)
 
 
-# the object file extension, this can be .o, .tco, .obj, etc..
-# depending on the platform
+# The object file extension.  This can be .o, .tco, .obj, etc., depending on
+# the platform.
 #
 O := o
 
-# the library file extension, this can be .a, .lib, etc..
-# depending on the platform
+# The library file extension.  This can be .a, .lib, etc., depending on the
+# platform.
 #
 A := a
 
 
-# The name of the final library file.
-# Note that the DOS-specific Makefile uses a shorter (8.3) name
+# The name of the final library file.  Note that the DOS-specific Makefile
+# uses a shorter (8.3) name.
 #
 LIBRARY := libfreetype
 
 
-# path inclusion flag.
+# Path inclusion flag.  Some compilers use a different flag than `-I' to
+# specify an additional include path.  Examples are `/i=' or `-J'.
 #
-#  Some compilers use a different flag than '-I' to specify an
-#  additional include path. Examples are "/i=" or "-J", etc...
-#
 I := -I
 
 
-# The link flag used to specify a given library file on link.
-# Note that this is only used to compile the demo programs, not
-# the library itself.
+# C flag used to define a macro before the compilation of a given source
+# object.  Usually is `-D' like in `-DDEBUG'.
 #
-L := -l
+D := -D
 
 
-# C flag used to define a macro before the compilation of a given
-# source object. Usually is '-D' like in "-DDEBUG"
+# The link flag used to specify a given library file on link.  Note that
+# this is only used to compile the demo programs, not the library itself.
 #
-D := -D
+L := -l
 
 
-# Target flag - beware, there is a space after the 'o' !!
+# Target flag.
 #
-#
-T := -o 
+T := -o # Don't remove this comment line!  We need the space after `-o'.
 
 
 # C flags
 #
-#   These should concern :
+#   These should concern: debug output, optimization & warnings.
 #
-#     - debug output
-#     - optimization
-#     - warnings
-#     - ansi compliance..
+#   Use the ANSIFLAGS variable to define the compiler flags used to enfore
+#   ANSI compliance.
 #
 ifndef CFLAGS
-CFLAGS := -c -g -O6 -Wall
+  CFLAGS := -c -g -O6 -Wall
 endif
 
-# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant
-#             nothing (if it already is by default like LCC).
+# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
 ANSIFLAGS := -ansi -pedantic
 
@@ -115,41 +103,31 @@
 
 ifdef BUILD_FREETYPE
 
-include $(TOP)/config/freetype.mk
+  # Now include the main sub-makefile.  It contains all the rules used to
+  # build the library with the previous variables defined.
+  #
+  include $(TOP)/config/freetype.mk
 
-clean_freetype: clean_freetype_dos
-distclean_freetype: distclean_freetype_dos
+  # The cleanup targets.
+  #
+  clean_freetype: clean_freetype_dos
+  distclean_freetype: distclean_freetype_dos
 
-# Librarian to use to build the static library
-#
-FT_LIBRARIAN := $(AR) -r
+  # Librarian to use to build the static library
+  #
+  FT_LIBRARIAN := $(AR) -r
 
 
-# This final rule is used to link all object files into a single
-# library. It is part of the system-specific sub-Makefile because not
-# all librarians accept a simple syntax like :
-#
-#    librarian library_file {list of object files} 
-#
-$(FT_LIBRARY): $(OBJECTS_LIST)
-	-$(DELETE) $@
-	$(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
+  # This final rule is used to link all object files into a single library. 
+  # It is part of the system-specific sub-Makefile because not all
+  # librarians accept a simple syntax like
+  #
+  #   librarian library_file {list of object files} 
+  #
+  $(FT_LIBRARY): $(OBJECTS_LIST)
+	  -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul
+	  $(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
 
-
-# Cleaning rules
-#
-DIR_OBJ := $(subst $(SEP),\,$(OBJ_DIR))
-
-clean_freetype_objects:
-	-del $(DIR_OBJ)\*.$O
-
-clean_freetype_lib:
-	-del $(subst $(SEP),\,$(FT_LIBRARY))
-
-clean: clean_freetype_objects
-
-
-
 endif
 
-
+# EOF
--- a/config/unix/detect.mk
+++ b/config/unix/detect.mk
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
@@ -19,10 +19,6 @@
 
 ifeq ($(PLATFORM),ansi)
 
-# Some Unix systems like *BSD do not have a /etc/inittab so we commented
-# the line.. (thanks to Yamano-uchi, Hidetoshi for pointing this out)..
-#
-# has_inittab := $(strip $(wildcard /etc/inittab))
   has_init := $(strip $(wildcard /sbin/init))
   ifneq ($(has_init),)
 
@@ -30,7 +26,7 @@
     COPY     := cp
     DELETE   := rm -f
 
-    # Test whether we're using gcc.  If so, we select the `unix-gcc.mk'
+    # Test whether we are using gcc.  If so, we select the `unix-gcc.mk'
     # configuration file.  Otherwise, the standard `unix.mk' is used which
     # simply calls `cc -c' with no extra arguments.
     #
@@ -37,7 +33,7 @@
     # Feel free to add support for other platform specific compilers in this
     # directory (e.g. solaris.mk + changes here to detect the platform).
     #
-    ifeq ($(CC),gcc)
+    ifeq ($(firstword $(CC)),gcc)
       is_gcc := 1
     else
       ifneq ($(findstring gcc,$(shell $(CC) -v 2>&1)),)
--- a/config/unix/unix-dev.mk
+++ b/config/unix/unix-dev.mk
@@ -1,24 +1,22 @@
-#*******************************************************************
-#*
-#*  FreeType 2 Configuration rules for a standard Unix + GCC
-#*  NOTE: THIS VERSION TURNS OFF ALL OPTIMIZATIONS FOR DEBUGGING !!
-#*
-#*  Copyright 1996-2000 by
-#*  David Turner, Robert Wilhelm, and Werner Lemberg.
-#*
-#*  This file is part of the FreeType project, and may only be used
-#*  modified and distributed under the terms of the FreeType project
-#*  license, LICENSE.TXT.  By continuing to use, modify, or distribute
-#*  this file you indicate that you have read the license and
-#*  understand and accept it fully.
-#*
-#*  Please read the file "freetype/docs/config.txt" to understand
-#*  what this file does..
-#*
-#*******************************************************************
+#
+# FreeType 2 configuration rules for the gcc compiler under UNIX
+#
+#   Development version without optimizations.
+#
 
+
+# Copyright 1996-2000 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+
+
 ifndef TOP
-TOP := .
+  TOP := .
 endif
 
 DELETE   := rm -f
@@ -27,105 +25,110 @@
 BUILD    := $(TOP)/config/unix
 PLATFORM := unix
 
-# the directory where all object files are placed
+# The directory where all object files are placed.
 #
-# Note that this is not $(TOP)/obj !!
-# This lets you build the library in your own directory
-# with something like :
+# Note that this is not $(TOP)/obj!
+# This lets you build the library in your own directory with something like
 #
-#  set TOP=....../path/to/freetype2/top/dir...
-#  mkdir obj
-#  make -f %TOP%/Makefile setup  [options]
-#  make -f %TOP%/Makefile
+#   set TOP=.../path/to/freetype2/top/dir...
+#   mkdir obj
+#   make -f $TOP/Makefile setup [options]
+#   make -f $TOP/Makefile
 #
-#
 OBJ_DIR := obj
 
 
-# the directory where all library files are placed
+# The directory where all library files are placed.
 #
-#  by default, this is the same as OBJ_DIR, however, this can be
-#  changed to suit particular needs..
+# By default, this is the same as $(OBJ_DIR), however, this can be changed
+# to suit particular needs.
 #
 LIB_DIR := $(OBJ_DIR)
 
 
-# the object file extension, this can be .o, .tco, .obj, etc..
-# depending on the platform
+# The object file extension.  This can be .o, .tco, .obj, etc., depending on
+# the platform.
 #
 O := o
 
-# the library file extension, this can be .a, .lib, etc..
-# depending on the platform
+# The library file extension.  This can be .a, .lib, etc., depending on the
+# platform.
 #
 A := a
 
 
-# The name of the final library file.
-# Note that the DOS-specific Makefile uses a shorter (8.3) name
+# The name of the final library file.  Note that the DOS-specific Makefile
+# uses a shorter (8.3) name.
 #
 LIBRARY := libfreetype
 
 
-# path inclusion flag.
+# Path inclusion flag.  Some compilers use a different flag than `-I' to
+# specify an additional include path.  Examples are `/i=' or `-J'.
 #
-#  Some compilers use a different flag than '-I' to specify an
-#  additional include path. Examples are "/i=" or "-J", etc...
-#
 I := -I
 
 
-# The link flag used to specify a given library file on link.
-# Note that this is only used to compile the demo programs, not
-# the library itself.
+# C flag used to define a macro before the compilation of a given source
+# object.  Usually is `-D' like in `-DDEBUG'.
 #
-L := -l
+D := -D
 
 
-# C flag used to define a macro before the compilation of a given
-# source object. Usually is '-D' like in "-DDEBUG"
+# The link flag used to specify a given library file on link.  Note that
+# this is only used to compile the demo programs, not the library itself.
 #
-D := -D
+L := -l
 
 
-# Target flag - beware, there is a space after the 'o' !!
+# Target flag.
 #
-#
-T := -o 
+T := -o # Don't remove this comment line!  We need the space after `-o'.
 
+
 # C flags
 #
-#   These should concern :
+#   These should concern: debug output, optimization & warnings.
 #
-#     - debug output
-#     - optimization
-#     - warnings
-#     - ansi compliance..
+#   Use the ANSIFLAGS variable to define the compiler flags used to enfore
+#   ANSI compliance.
 #
 ifndef CFLAGS
-CFLAGS := -c -g -O0 -Wall
+  CFLAGS := -c -g -O0 -Wall
 endif
 
-# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant
-#             nothing (if it already is by default like LCC).
+# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
 ANSIFLAGS := -ansi -pedantic
 
+
 ifdef BUILD_FREETYPE
 
-include $(TOP)/config/freetype.mk
+  # Now include the main sub-makefile.  It contains all the rules used to
+  # build the library with the previous variables defined.
+  #
+  include $(TOP)/config/freetype.mk
 
-clean_freetype: clean_freetype_std
-distclean_freetype: distclean_freetype_std
+  # The cleanup targets.
+  #
+  clean_freetype: clean_freetype_std
+  distclean_freetype: distclean_freetype_std
 
-# This final rule is used to link all object files into a single
-# library. It is part of the system-specific sub-Makefile because not
-# all librarians accept a simple syntax like :
-#
-#    librarian library_file {list of object files} 
-#
-$(FT_LIBRARY): $(OBJECTS_LIST)
-	-$(DELETE) $@
-	$(AR) -r $@ $(OBJECTS_LIST)
+  # Librarian to use to build the static library
+  #
+  FT_LIBRARIAN := $(AR) -r
 
+
+  # This final rule is used to link all object files into a single library.
+  # It is part of the system-specific sub-Makefile because not all
+  # librarians accept a simple syntax like:
+  #
+  #   librarian library_file {list of object files}
+  #
+  $(FT_LIBRARY): $(OBJECTS_LIST)
+	  -$(DELETE) $@
+	  $(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
+
 endif
+
+# EOF
--- a/config/unix/unix-gcc.mk
+++ b/config/unix/unix-gcc.mk
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
@@ -36,7 +36,7 @@
 OBJ_DIR := obj
 
 
-# The directory where all library files are placed
+# The directory where all library files are placed.
 #
 # By default, this is the same as $(OBJ_DIR), however, this can be changed
 # to suit particular needs.
@@ -117,11 +117,11 @@
   FT_LIBRARIAN := $(AR) -r
 
 
-  # This final rule is used to link all object files into a single library. 
+  # This final rule is used to link all object files into a single library.
   # It is part of the system-specific sub-Makefile because not all
   # librarians accept a simple syntax like:
   #
-  #    librarian library_file {list of object files}
+  #   librarian library_file {list of object files}
   #
   $(FT_LIBRARY): $(OBJECTS_LIST)
 	  -$(DELETE) $@
--- a/config/unix/unix.mk
+++ b/config/unix/unix.mk
@@ -1,23 +1,20 @@
-#*******************************************************************
-#*
-#*  FreeType 2 Configuration rules for a standard Unix compiler
-#*
-#*  Copyright 1996-2000 by
-#*  David Turner, Robert Wilhelm, and Werner Lemberg.
-#*
-#*  This file is part of the FreeType project, and may only be used
-#*  modified and distributed under the terms of the FreeType project
-#*  license, LICENSE.TXT.  By continuing to use, modify, or distribute
-#*  this file you indicate that you have read the license and
-#*  understand and accept it fully.
-#*
-#*  Please read the file "freetype/docs/config.txt" to understand
-#*  what this file does..
-#*
-#*******************************************************************
+#
+# FreeType 2 configuration rules for a standard Unix compiler
+#
 
+
+# Copyright 1996-2000 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+
+
 ifndef TOP
-TOP := .
+  TOP := .
 endif
 
 DELETE   := rm -f
@@ -26,105 +23,110 @@
 BUILD    := $(TOP)/config/unix
 PLATFORM := unix
 
-# the directory where all object files are placed
+# The directory where all object files are placed.
 #
-# Note that this is not $(TOP)/obj !!
-# This lets you build the library in your own directory
-# with something like :
+# Note that this is not $(TOP)/obj!
+# This lets you build the library in your own directory with something like
 #
-#  set TOP=....../path/to/freetype2/top/dir...
-#  mkdir obj
-#  make -f %TOP%/Makefile setup  [options]
-#  make -f %TOP%/Makefile
+#   set TOP=.../path/to/freetype2/top/dir...
+#   mkdir obj
+#   make -f $TOP/Makefile setup [options]
+#   make -f $TOP/Makefile
 #
-#
 OBJ_DIR := obj
 
 
-# the directory where all library files are placed
+# The directory where all library files are placed.
 #
-#  by default, this is the same as OBJ_DIR, however, this can be
-#  changed to suit particular needs..
+# By default, this is the same as $(OBJ_DIR), however, this can be changed
+# to suit particular needs.
 #
 LIB_DIR := $(OBJ_DIR)
 
 
-# the object file extension, this can be .o, .tco, .obj, etc..
-# depending on the platform
+# The object file extension.  This can be .o, .tco, .obj, etc., depending on
+# the platform.
 #
 O := o
 
-# the library file extension, this can be .a, .lib, etc..
-# depending on the platform
+# The library file extension.  This can be .a, .lib, etc., depending on the
+# platform.
 #
 A := a
 
 
-# The name of the final library file.
-# Note that the DOS-specific Makefile uses a shorter (8.3) name
+# The name of the final library file.  Note that the DOS-specific Makefile
+# uses a shorter (8.3) name.
 #
 LIBRARY := libfreetype
 
 
-# path inclusion flag.
+# Path inclusion flag.  Some compilers use a different flag than `-I' to
+# specify an additional include path.  Examples are `/i=' or `-J'.
 #
-#  Some compilers use a different flag than '-I' to specify an
-#  additional include path. Examples are "/i=" or "-J", etc...
-#
 I := -I
 
 
-# The link flag used to specify a given library file on link.
-# Note that this is only used to compile the demo programs, not
-# the library itself.
+# C flag used to define a macro before the compilation of a given source
+# object.  Usually is `-D' like in `-DDEBUG'.
 #
-L := -l
+D := -D
 
 
-# C flag used to define a macro before the compilation of a given
-# source object. Usually is '-D' like in "-DDEBUG"
+# The link flag used to specify a given library file on link.  Note that
+# this is only used to compile the demo programs, not the library itself.
 #
-D := -D
+L := -l
 
 
-# Target flag - beware, there is a space after the 'o' !!
+# Target flag.
 #
-#
-T := -o 
+T := -o # Don't remove this comment line!  We need the space after `-o'.
 
+
 # C flags
 #
-#   These should concern :
+#   These should concern: debug output, optimization & warnings.
 #
-#     - debug output
-#     - optimization
-#     - warnings
-#     - ansi compliance..
+#   Use the ANSIFLAGS variable to define the compiler flags used to enfore
+#   ANSI compliance.
 #
 ifndef CFLAGS
-CFLAGS := -c
+  CFLAGS := -c
 endif
 
-# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant
-#             nothing (if it already is by default like LCC).
+# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
 ANSIFLAGS :=
 
+
 ifdef BUILD_FREETYPE
 
-include $(TOP)/config/freetype.mk
+  # Now include the main sub-makefile.  It contains all the rules used to
+  # build the library with the previous variables defined.
+  #
+  include $(TOP)/config/freetype.mk
 
-clean_freetype: clean_freetype_std
-distclean_freetype: distclean_freetype_std
+  # The cleanup targets.
+  #
+  clean_freetype: clean_freetype_std
+  distclean_freetype: distclean_freetype_std
 
-# This final rule is used to link all object files into a single
-# library. It is part of the system-specific sub-Makefile because not
-# all librarians accept a simple syntax like :
-#
-#    librarian library_file {list of object files} 
-#
-$(FT_LIBRARY): $(OBJECTS_LIST)
-	-$(DELETE) $@
-	$(AR) -r $@ $(OBJECTS_LIST)
+  # Librarian to use to build the static library
+  #
+  FT_LIBRARIAN := $(AR) -r
 
+
+  # This final rule is used to link all object files into a single library.
+  # It is part of the system-specific sub-Makefile because not all
+  # librarians accept a simple syntax like:
+  #
+  #   librarian library_file {list of object files}
+  #
+  $(FT_LIBRARY): $(OBJECTS_LIST)
+	  -$(DELETE) $@
+	  $(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
+
 endif
+
+# EOF
--- a/config/win32/detect.mk
+++ b/config/win32/detect.mk
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
@@ -25,13 +25,13 @@
     # We test for the COMSPEC environment variable, then run the `ver'
     # command-line program to see if its output contains the word `Windows'.
     #
-    # If this is true, we're running a win32 platform (or an emulation).
+    # If this is true, we are running a win32 platform (or an emulation).
     #
   else
     ifdef COMSPEC
       is_windows := $(findstring Windows,$(strip $(shell ver)))
     endif
-  endif  #test NT
+  endif  # test NT
 
   ifdef is_windows
 
@@ -41,10 +41,12 @@
 
     CONFIG_FILE := w32-gcc.mk  # gcc Makefile by default
     SEP         := /
-    ifeq ($(CC),cc)
+    ifeq ($(firstword $(CC)),cc)
       CC        := gcc
     endif
 
+    # additionally, we provide hooks for various other compilers
+    #
     ifneq ($(findstring visualc,$(MAKECMDGOALS)),)     # Visual C/C++
       CONFIG_FILE := w32-vcc.mk
       SEP         := $(BACKSLASH)
@@ -73,7 +75,7 @@
       lcc: setup
     endif
 
-    ifneq ($(findstring devel,$(MAKECMDGOALS)),)
+    ifneq ($(findstring devel,$(MAKECMDGOALS)),)       # development target
       CONFIG_FILE := w32-dev.mk
       CC          := gcc
       SEP         := /
--- a/config/win32/w32-dev.mk
+++ b/config/win32/w32-dev.mk
@@ -1,28 +1,25 @@
-#*******************************************************************
-#*
-#*  FreeType 2 Configuration rules for Win32 + GCC
-#*  THIS VERSION DISABLES OPTIMIZATIONS FOR DEBUGGING !!
-#*
-#*  Copyright 1996-2000 by
-#*  David Turner, Robert Wilhelm, and Werner Lemberg.
-#*
-#*  This file is part of the FreeType project, and may only be used
-#*  modified and distributed under the terms of the FreeType project
-#*  license, LICENSE.TXT.  By continuing to use, modify, or distribute
-#*  this file you indicate that you have read the license and
-#*  understand and accept it fully.
-#*
-#*  Please read the file "freetype/docs/config.txt" to understand
-#*  what this file does..
-#*
-#*
-#*  NOTE : This version requires that GNU Make be invoked from the
-#*         Windows Shell (_not_ Cygwin BASH !!)
-#*
-#*******************************************************************
+#
+# FreeType 2 Configuration rules for Win32 + GCC
+#
+#   Development version without optimizations.
+#
 
+
+# Copyright 1996-2000 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+#
+# NOTE: This version requires that GNU Make be invoked from the Windows
+#       Shell (_not_ Cygwin BASH)!
+#
+
 ifndef TOP
-TOP := .
+  TOP := .
 endif
 
 DELETE   := del
@@ -32,111 +29,110 @@
 PLATFORM := win32
 CC       := gcc
 
-# the directory where all object files are placed
+# The directory where all object files are placed.
 #
-# Note that this is not $(TOP)/obj !!
-# This lets you build the library in your own directory
-# with something like :
+# Note that this is not $(TOP)/obj!
+# This lets you build the library in your own directory with something like
 #
-#  set TOP=....../path/to/freetype2/top/dir...
-#  mkdir obj
-#  make -f %TOP%/Makefile setup  [options]
-#  make -f %TOP%/Makefile
+#   set TOP=.../path/to/freetype2/top/dir...
+#   mkdir obj
+#   make -f %TOP%/Makefile setup [options]
+#   make -f %TOP%/Makefile
 #
-#
 OBJ_DIR := obj
 
 
-# the directory where all library files are placed
+# The directory where all library files are placed.
 #
-#  by default, this is the same as OBJ_DIR, however, this can be
-#  changed to suit particular needs..
+# By default, this is the same as $(OBJ_DIR), however, this can be changed
+# to suit particular needs.
 #
 LIB_DIR := $(OBJ_DIR)
 
 
-# the object file extension, this can be .o, .tco, .obj, etc..
-# depending on the platform
+# The object file extension.  This can be .o, .tco, .obj, etc., depending on
+# the platform.
 #
 O := o
 
-# the library file extension, this can be .a, .lib, etc..
-# depending on the platform
+# The library file extension.  This can be .a, .lib, etc., depending on the
+# platform.
 #
 A := a
 
 
-# The name of the final library file.
-# Note that the DOS-specific Makefile uses a shorter (8.3) name
+# The name of the final library file.  Note that the DOS-specific Makefile
+# uses a shorter (8.3) name.
 #
 LIBRARY := libfreetype
 
 
-# path inclusion flag.
+# Path inclusion flag.  Some compilers use a different flag than `-I' to
+# specify an additional include path.  Examples are `/i=' or `-J'.
 #
-#  Some compilers use a different flag than '-I' to specify an
-#  additional include path. Examples are "/i=" or "-J", etc...
-#
 I := -I
 
 
-# The link flag used to specify a given library file on link.
-# Note that this is only used to compile the demo programs, not
-# the library itself.
+# C flag used to define a macro before the compilation of a given source
+# object.  Usually is `-D' like in `-DDEBUG'.
 #
-L := -l
+D := -D
 
 
-# C flag used to define a macro before the compilation of a given
-# source object. Usually is '-D' like in "-DDEBUG"
+# The link flag used to specify a given library file on link.  Note that
+# this is only used to compile the demo programs, not the library itself.
 #
-D := -D
+L := -l
 
 
-# Target flag - beware, there is a space after the 'o' !!
+# Target flag.
 #
-#
-T := -o 
+T := -o # Don't remove this comment line!  We need the space after `-o'.
 
+
 # C flags
 #
-#   These should concern :
+#   These should concern: debug output, optimization & warnings.
 #
-#     - debug output
-#     - optimization
-#     - warnings
-#     - ansi compliance..
+#   Use the ANSIFLAGS variable to define the compiler flags used to enfore
+#   ANSI compliance.
 #
 ifndef CFLAGS
-CFLAGS := -c -g -O0 -Wall
+  CFLAGS := -c -g -O0 -Wall
 endif
 
-# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant
-#             nothing (if it already is by default like LCC).
+# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
 ANSIFLAGS := -ansi -pedantic
 
+
 ifdef BUILD_FREETYPE
 
-include $(TOP)/config/freetype.mk
+  # Now include the main sub-makefile.  It contains all the rules used to
+  # build the library with the previous variables defined.
+  #
+  include $(TOP)/config/freetype.mk
 
-clean_freetype: clean_freetype_dos
-distclean_freetype: distclean_freetype_dos
+  # The cleanup targets.
+  #
+  clean_freetype: clean_freetype_dos
+  distclean_freetype: distclean_freetype_dos
 
-# Librarian to use to build the static library
-#
-FT_LIBRARIAN := $(AR) -r
+  # Librarian to use to build the static library
+  #
+  FT_LIBRARIAN := $(AR) -r
 
 
-# This final rule is used to link all object files into a single
-# library. It is part of the system-specific sub-Makefile because not
-# all librarians accept a simple syntax like :
-#
-#    librarian library_file {list of object files} 
-#
-$(FT_LIBRARY): $(OBJECTS_LIST)
-	-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul
-	$(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
+  # This final rule is used to link all object files into a single library. 
+  # It is part of the system-specific sub-Makefile because not all
+  # librarians accept a simple syntax like
+  #
+  #   librarian library_file {list of object files} 
+  #
+  $(FT_LIBRARY): $(OBJECTS_LIST)
+	  -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul
+	  $(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
 
 endif
 
+# EOF
--- a/config/win32/w32-gcc.mk
+++ b/config/win32/w32-gcc.mk
@@ -1,27 +1,23 @@
-#*******************************************************************
-#*
-#*  FreeType 2 Configuration rules for Win32 + GCC
-#*
-#*  Copyright 1996-2000 by
-#*  David Turner, Robert Wilhelm, and Werner Lemberg.
-#*
-#*  This file is part of the FreeType project, and may only be used
-#*  modified and distributed under the terms of the FreeType project
-#*  license, LICENSE.TXT.  By continuing to use, modify, or distribute
-#*  this file you indicate that you have read the license and
-#*  understand and accept it fully.
-#*
-#*  Please read the file "freetype/docs/config.txt" to understand
-#*  what this file does..
-#*
-#*
-#*  NOTE : This version requires that GNU Make be invoked from the
-#*         Windows Shell (_not_ Cygwin BASH !!)
-#*
-#*******************************************************************
+#
+# FreeType 2 Configuration rules for Win32 + GCC
+#
 
+
+# Copyright 1996-2000 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+#
+# NOTE: This version requires that GNU Make be invoked from the Windows
+#       Shell (_not_ Cygwin BASH)!
+#
+
 ifndef TOP
-TOP := .
+  TOP := .
 endif
 
 DELETE   := del
@@ -31,111 +27,110 @@
 PLATFORM := win32
 CC       := gcc
 
-# the directory where all object files are placed
+# The directory where all object files are placed.
 #
-# Note that this is not $(TOP)/obj !!
-# This lets you build the library in your own directory
-# with something like :
+# Note that this is not $(TOP)/obj!
+# This lets you build the library in your own directory with something like
 #
-#  set TOP=....../path/to/freetype2/top/dir...
-#  mkdir obj
-#  make -f %TOP%/Makefile setup  [options]
-#  make -f %TOP%/Makefile
+#   set TOP=.../path/to/freetype2/top/dir...
+#   mkdir obj
+#   make -f %TOP%/Makefile setup [options]
+#   make -f %TOP%/Makefile
 #
-#
 OBJ_DIR := obj
 
 
-# the directory where all library files are placed
+# The directory where all library files are placed.
 #
-#  by default, this is the same as OBJ_DIR, however, this can be
-#  changed to suit particular needs..
+# By default, this is the same as $(OBJ_DIR), however, this can be changed
+# to suit particular needs.
 #
 LIB_DIR := $(OBJ_DIR)
 
 
-# the object file extension, this can be .o, .tco, .obj, etc..
-# depending on the platform
+# The object file extension.  This can be .o, .tco, .obj, etc., depending on
+# the platform.
 #
 O := o
 
-# the library file extension, this can be .a, .lib, etc..
-# depending on the platform
+# The library file extension.  This can be .a, .lib, etc., depending on the
+# platform.
 #
 A := a
 
 
-# The name of the final library file.
-# Note that the DOS-specific Makefile uses a shorter (8.3) name
+# The name of the final library file.  Note that the DOS-specific Makefile
+# uses a shorter (8.3) name.
 #
 LIBRARY := libfreetype
 
 
-# path inclusion flag.
+# Path inclusion flag.  Some compilers use a different flag than `-I' to
+# specify an additional include path.  Examples are `/i=' or `-J'.
 #
-#  Some compilers use a different flag than '-I' to specify an
-#  additional include path. Examples are "/i=" or "-J", etc...
-#
 I := -I
 
 
-# The link flag used to specify a given library file on link.
-# Note that this is only used to compile the demo programs, not
-# the library itself.
+# C flag used to define a macro before the compilation of a given source
+# object.  Usually is `-D' like in `-DDEBUG'.
 #
-L := -l
+D := -D
 
 
-# C flag used to define a macro before the compilation of a given
-# source object. Usually is '-D' like in "-DDEBUG"
+# The link flag used to specify a given library file on link.  Note that
+# this is only used to compile the demo programs, not the library itself.
 #
-D := -D
+L := -l
 
 
-# Target flag - beware, there is a space after the 'o' !!
+# Target flag.
 #
-#
-T := -o 
+T := -o # Don't remove this comment line!  We need the space after `-o'.
 
+
 # C flags
 #
-#   These should concern :
+#   These should concern: debug output, optimization & warnings.
 #
-#     - debug output
-#     - optimization
-#     - warnings
-#     - ansi compliance..
+#   Use the ANSIFLAGS variable to define the compiler flags used to enfore
+#   ANSI compliance.
 #
 ifndef CFLAGS
-CFLAGS := -c -g -O6 -Wall
+  CFLAGS := -c -g -O6 -Wall
 endif
 
-# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant
-#             nothing (if it already is by default like LCC).
+# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
 ANSIFLAGS := -ansi -pedantic
 
+
 ifdef BUILD_FREETYPE
 
-include $(TOP)/config/freetype.mk
+  # Now include the main sub-makefile.  It contains all the rules used to
+  # build the library with the previous variables defined.
+  #
+  include $(TOP)/config/freetype.mk
 
-clean_freetype: clean_freetype_dos
-distclean_freetype: distclean_freetype_dos
+  # The cleanup targets.
+  #
+  clean_freetype: clean_freetype_dos
+  distclean_freetype: distclean_freetype_dos
 
-# Librarian to use to build the static library
-#
-FT_LIBRARIAN := $(AR) -r
+  # Librarian to use to build the static library
+  #
+  FT_LIBRARIAN := $(AR) -r
 
 
-# This final rule is used to link all object files into a single
-# library. It is part of the system-specific sub-Makefile because not
-# all librarians accept a simple syntax like :
-#
-#    librarian library_file {list of object files} 
-#
-$(FT_LIBRARY): $(OBJECTS_LIST)
-	-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul
-	$(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
+  # This final rule is used to link all object files into a single library. 
+  # It is part of the system-specific sub-Makefile because not all
+  # librarians accept a simple syntax like
+  #
+  #   librarian library_file {list of object files} 
+  #
+  $(FT_LIBRARY): $(OBJECTS_LIST)
+	  -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul
+	  $(FT_LIBRARIAN) $@ $(OBJECTS_LIST)
 
 endif
 
+# EOF
--- a/config/win32/w32-lcc.mk
+++ b/config/win32/w32-lcc.mk
@@ -1,135 +1,127 @@
-#*******************************************************************
-#*
-#*  FreeType 2 Configuration rules for Win32 + LCC
-#*
-#*  Copyright 1996-2000 by
-#*  David Turner, Robert Wilhelm, and Werner Lemberg.
-#*
-#*  This file is part of the FreeType project, and may only be used
-#*  modified and distributed under the terms of the FreeType project
-#*  license, LICENSE.TXT.  By continuing to use, modify, or distribute
-#*  this file you indicate that you have read the license and
-#*  understand and accept it fully.
-#*
-#*  Please read the file "freetype/docs/config.txt" to understand
-#*  what this file does..
-#*
-#*******************************************************************
+#
+# FreeType 2 Configuration rules for Win32 + LCC
+#
 
+
+# Copyright 1996-2000 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+
 ifndef TOP
-TOP := .
+  TOP := .
 endif
 
 DELETE   := del
 SEP      := /
-HOSTSEP  := \\
-BUILD    := $(TOP)$(SEP)config$(SEP)win32
+HOSTSEP  := $(strip \ )
+BUILD    := $(TOP)/config/win32
 PLATFORM := win32
 CC       := lcc
 
-# the directory where all object files are placed
+# The directory where all object files are placed.
 #
-# Note that this is not $(TOP)/obj !!
-# This lets you build the library in your own directory
-# with something like :
+# Note that this is not $(TOP)/obj!
+# This lets you build the library in your own directory with something like
 #
-#  set TOP=....../path/to/freetype2/top/dir...
-#  mkdir obj
-#  make -f %TOP%/Makefile setup  [options]
-#  make -f %TOP%/Makefile
+#   set TOP=.../path/to/freetype2/top/dir...
+#   mkdir obj
+#   make -f %TOP%/Makefile setup [options]
+#   make -f %TOP%/Makefile
 #
-#
 OBJ_DIR := obj
 
 
-# the directory where all library files are placed
+# The directory where all library files are placed.
 #
-#  by default, this is the same as OBJ_DIR, however, this can be
-#  changed to suit particular needs..
+# By default, this is the same as $(OBJ_DIR), however, this can be changed
+# to suit particular needs.
 #
 LIB_DIR := $(OBJ_DIR)
 
 
-# the object file extension, this can be .o, .tco, .obj, etc..
-# depending on the platform
+# The object file extension.  This can be .o, .tco, .obj, etc., depending on
+# the platform.
 #
 O := obj
 
-# the library file extension, this can be .a, .lib, etc..
-# depending on the platform
+# The library file extension.  This can be .a, .lib, etc., depending on the
+# platform.
 #
 A := lib
 
 
-# The name of the final library file.
-# Note that the DOS-specific Makefile uses a shorter (8.3) name
+# The name of the final library file.  Note that the DOS-specific Makefile
+# uses a shorter (8.3) name.
 #
 LIBRARY := freetype
 
 
-# path inclusion flag.
+# Path inclusion flag.  Some compilers use a different flag than `-I' to
+# specify an additional include path.  Examples are `/i=' or `-J'.
 #
-#  Some compilers use a different flag than '-I' to specify an
-#  additional include path. Examples are "/i=" or "-J", etc...
-#
 I := -I
 
 
-# C flag used to define a macro before the compilation of a given
-# source object. Usually is '-D' like in "-DDEBUG"
+# C flag used to define a macro before the compilation of a given source
+# object.  Usually is `-D' like in `-DDEBUG'.
 #
 D := -D
 
 
-# Target flag - LCC uses "-Fo" instead of "-o ", what a broken compiler
+# The link flag used to specify a given library file on link.  Note that
+# this is only used to compile the demo programs, not the library itself.
 #
-#
-T := -Fo
-
-# The link flag used to specify a given library file on link.
-# Note that this is only used to compile the demo programs, not
-# the library itself.
-#
 L := -Fl
 
 
+# Target flag.
+#
+T := -Fo
 
+
 # C flags
 #
-#   These should concern :
+#   These should concern: debug output, optimization & warnings.
 #
-#     - debug output
-#     - optimization
-#     - warnings
-#     - ansi compliance..
+#   Use the ANSIFLAGS variable to define the compiler flags used to enfore
+#   ANSI compliance.
 #
 ifndef CFLAGS
-CFLAGS := -c -g2 -O
+  CFLAGS := -c -g2 -O
 endif
 
-# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant
-#             nothing (if it already is by default like LCC).
+# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
 ANSIFLAGS :=
 
+
 ifdef BUILD_FREETYPE
 
-include $(TOP)/config/freetype.mk
+  # Now include the main sub-makefile.  It contains all the rules used to
+  # build the library with the previous variables defined.
+  #
+  include $(TOP)/config/freetype.mk
 
-clean_freetype: clean_freetype_dos
-distclean_freetype: distclean_freetype_dos
+  # The cleanup targets.
+  #
+  clean_freetype: clean_freetype_dos
+  distclean_freetype: distclean_freetype_dos
 
-# This final rule is used to link all object files into a single
-# library. It is part of the system-specific sub-Makefile because not
-# all librarians accept a simple syntax like :
-#
-#    librarian library_file {list of object files} 
-#
-DIR_OBJ := $(subst /,\\,$(OBJ_DIR))
+  # This final rule is used to link all object files into a single library. 
+  # It is part of the system-specific sub-Makefile because not all
+  # librarians accept a simple syntax like
+  #
+  #   librarian library_file {list of object files} 
+  #
+  $(FT_LIBRARY): $(OBJECTS_LIST)
+	  lcclnk -o $(subst $(SEP),$(HOSTSEP),$@) \
+                 $(subst $(SEP),$(HOSTSEP),$(OBJECTS_LIST))
 
-$(FT_LIBRARY): $(OBJECTS_LIST)
-	lcclnk -o $(subst /,\\,$@) $(subst /,\\,$(OBJECTS_LIST))
-
 endif
 
-
+# EOF
--- a/config/win32/w32-vcc.mk
+++ b/config/win32/w32-vcc.mk
@@ -1,127 +1,126 @@
-#*******************************************************************
-#*
-#*  FreeType 2 Configuration rules for Win32 + Visual C++
-#*
-#*  Copyright 1996-2000 by
-#*  David Turner, Robert Wilhelm, and Werner Lemberg.
-#*
-#*  This file is part of the FreeType project, and may only be used
-#*  modified and distributed under the terms of the FreeType project
-#*  license, LICENSE.TXT.  By continuing to use, modify, or distribute
-#*  this file you indicate that you have read the license and
-#*  understand and accept it fully.
-#*
-#*  Please read the file "freetype/docs/config.txt" to understand
-#*  what this file does..
-#*
-#*******************************************************************
+#
+# FreeType 2 Configuration rules for Win32 + LCC
+#
 
+
+# Copyright 1996-2000 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+
+ifndef TOP
+  TOP := .
+endif
+
 DELETE   := del
 SEP      := /
 HOSTSEP  := $(strip \ )
-BUILD    := $(TOP)$(SEP)config$(SEP)win32
+BUILD    := $(TOP)/config/win32
 PLATFORM := win32
 CC       := cl
 
-# the directory where all object files are placed
+# The directory where all object files are placed.
 #
-# Note that this is not $(TOP)/obj !!
-# This lets you build the library in your own directory
-# with something like :
+# Note that this is not $(TOP)/obj!
+# This lets you build the library in your own directory with something like
 #
-#  set TOP=....../path/to/freetype2/top/dir...
-#  mkdir obj
-#  make -f %TOP%/Makefile setup  [options]
-#  make -f %TOP%/Makefile
+#   set TOP=.../path/to/freetype2/top/dir...
+#   mkdir obj
+#   make -f %TOP%/Makefile setup [options]
+#   make -f %TOP%/Makefile
 #
-#
 OBJ_DIR := obj
 
 
-# the directory where all library files are placed
+# The directory where all library files are placed.
 #
-#  by default, this is the same as OBJ_DIR, however, this can be
-#  changed to suit particular needs..
+# By default, this is the same as $(OBJ_DIR), however, this can be changed
+# to suit particular needs.
 #
 LIB_DIR := $(OBJ_DIR)
 
 
-# the object file extension, this can be .o, .tco, .obj, etc..
-# depending on the platform
+# The object file extension.  This can be .o, .tco, .obj, etc., depending on
+# the platform.
 #
 O := obj
 
-# the library file extension, this can be .a, .lib, etc..
-# depending on the platform
+# The library file extension.  This can be .a, .lib, etc., depending on the
+# platform.
 #
 A := lib
 
 
-# The name of the final library file.
-# Note that the DOS-specific Makefile uses a shorter (8.3) name
+# The name of the final library file.  Note that the DOS-specific Makefile
+# uses a shorter (8.3) name.
 #
 LIBRARY := freetype
 
 
-# path inclusion flag.
+# Path inclusion flag.  Some compilers use a different flag than `-I' to
+# specify an additional include path.  Examples are `/i=' or `-J'.
 #
-#  Some compilers use a different flag than '-I' to specify an
-#  additional include path. Examples are "/i=" or "-J", etc...
-#
 I := /I
 
 
-# The link flag used to specify a given library file on link.
-# Note that this is only used to compile the demo programs, not
-# the library itself.
+# C flag used to define a macro before the compilation of a given source
+# object.  Usually is `-D' like in `-DDEBUG'.
 #
-L := /Fl
+D := /D
 
 
-# C flag used to define a macro before the compilation of a given
-# source object. Usually is '-D' like in "-DDEBUG"
+# The link flag used to specify a given library file on link.  Note that
+# this is only used to compile the demo programs, not the library itself.
 #
-D := /D
+L := /Fl
 
-# Target flag - LCC uses "-Fo" instead of "-o ", what a broken compiler
+
+# Target flag.
 #
-#
 T := /Fo
 
+
 # C flags
 #
-#   These should concern :
+#   These should concern: debug output, optimization & warnings.
 #
-#     - debug output
-#     - optimization
-#     - warnings
-#     - ansi compliance..
+#   Use the ANSIFLAGS variable to define the compiler flags used to enfore
+#   ANSI compliance.
 #
 ifndef CFLAGS
-CFLAGS := /nologo /c /Ox /G5 /W3 /WX
+  CFLAGS := /nologo /c /Ox /G5 /W3 /WX
 endif
 
-# ANSI_FLAGS : put there the flags used to make your compiler ANSI-compliant
-#              nothing (if it already is by default like LCC).
+# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
 #
-ANSI_FLAGS := /Za
+ANSIFLAGS := /Za
 
+
 ifdef BUILD_FREETYPE
 
-include $(TOP)/config/freetype.mk
+  # Now include the main sub-makefile.  It contains all the rules used to
+  # build the library with the previous variables defined.
+  #
+  include $(TOP)/config/freetype.mk
 
-clean_freetype: clean_freetype_dos
-distclean_freetype: distclean_freetype_dos
+  # The cleanup targets.
+  #
+  clean_freetype: clean_freetype_dos
+  distclean_freetype: distclean_freetype_dos
 
-# This final rule is used to link all object files into a single
-# library. It is part of the system-specific sub-Makefile because not
-# all librarians accept a simple syntax like :
-#
-#    librarian library_file {list of object files} 
-#
-$(FT_LIBRARY): $(OBJECTS_LIST)
-	lib /nologo /out:$@ $(OBJECTS_LIST)
+  # This final rule is used to link all object files into a single library. 
+  # It is part of the system-specific sub-Makefile because not all
+  # librarians accept a simple syntax like
+  #
+  #   librarian library_file {list of object files} 
+  #
+  $(FT_LIBRARY): $(OBJECTS_LIST)
+	  lib /nologo /out:$@ $(OBJECTS_LIST)
 
 endif
 
-
+# EOF
--- a/docs/design/io-frames.html
+++ b/docs/design/io-frames.html
@@ -49,8 +49,8 @@
   </h2>
 
   <p>Simply speaking, a frame is an array of bytes in a font file that is
-  "preloaded" into memory in order to be rapidly parsed.  Frames are useful
-  to ensure that every "load" is checked against end-of-file overruns, and
+  `preloaded' into memory in order to be rapidly parsed.  Frames are useful
+  to ensure that every `load' is checked against end-of-file overruns, and
   provides nice functions to extract data in a variety of distinct
   formats.</p>
 
@@ -83,7 +83,7 @@
     FT_Forget_Frame( stream );</pre>
   </font>
 
-  <p>Here, the call to <tt>FT_Access_Frame()</tt> will</p>
+  <p>Here, the call to <code>FT_Access_Frame()</code> will</p>
 
   <ul>
     <li>
@@ -91,20 +91,20 @@
       stream.</p>
     </li>
     <li>
-      <p>"Preload" (for disk-based streams) 10&nbsp;bytes from the current
+      <p>`Preload' (for disk-based streams) 10&nbsp;bytes from the current
       stream position.</p>
     </li>
     <li>
-      <p>Set the frame "cursor" to the first byte in the frame.</p>
+      <p>Set the frame `cursor' to the first byte in the frame.</p>
     </li>
   </ul>
 
-  <p>Each <tt>FT_Get_Short()</tt> or <tt>FT_Get_ULong()</tt> call will read
-  a big-endian integer from the stream (2&nbsp;bytes for
-  <tt>FT_Get_Short()</tt>, 4&nbsp;bytes for <tt>FT_Get_ULong</tt>) and
-  advance the frame cursor accordingly.</p>
+  <p>Each <code>FT_Get_Short()</code> or <code>FT_Get_ULong()</code> call
+  will read a big-endian integer from the stream (2&nbsp;bytes for
+  <code>FT_Get_Short()</code>, 4&nbsp;bytes for <code>FT_Get_ULong</code>)
+  and advance the frame cursor accordingly.</p>
 
-  <p><tt>FT_Forget_Frame()</tt> "releases" the frame from memory.</p>
+  <p><code>FT_Forget_Frame()</code> `releases' the frame from memory.</p>
 
   <p>There are several advantages to using frames:</p>
 
@@ -126,54 +126,55 @@
   </h2>
 
   <p>By convention in the FreeType source code, macros are able to use two
-  implicit variables named <tt>error</tt> and <tt>stream</tt>.  This is
+  implicit variables named <var>error</var> and <var>stream</var>.  This is
   useful because these two variables are extremely often used in the
   library, and doing this only reduces our typing requirements and make the
   source code much clearer.</p>
 
-  <p>Note that <tt>error</tt> must be a local variable of type
-  <tt>FT_Error</tt>, while <tt>stream</tt> must be a local variable or
-  argument of type <tt>FT_Stream</tt>.</p>
+  <p>Note that <var>error</var> must be a local variable of type
+  <code>FT_Error</code>, while <var>stream</var> must be a local variable or
+  argument of type <code>FT_Stream</code>.</p>
 
   <p>The macro used to access a frame is <font
-  color="purple"><tt><b>ACCESS_Frame(_size_)</b></tt></font>, it will
+  color="purple"><code><b>ACCESS_Frame(_size_)</b></code></font>, it will
   translate to</p>
 
   <font color="blue">
   <pre>
     ( error = FT_Access_Frame( stream, _size_ ) )
-        != FT_Err_Ok</tt></pre>
+        != FT_Err_Ok</pre>
   </font>
 
   <p>Similarly, the macro <font
-  color="purple"><b><tt>FORGET_Frame()</tt></b></font> translates to</p>
+  color="purple"><b><code>FORGET_Frame()</code></b></font> translates to</p>
 
   <font color="blue">
   <pre>
-    <tt>FT_Forget_Frame( stream )</tt></pre>
+    FT_Forget_Frame( stream )</pre>
   </font>
 
-  <p>Extracting integers can be performed with the <tt>GET_xxx()</tt>
+  <p>Extracting integers can be performed with the <code>GET_xxx()</code>
   macros, like</p>
 
-  <table align=center>
+  <table align=center
+         cellpadding=5>
     <tr valign="top">
-      <td>
-        <b>Macro name</b>
-      </td>
-      <td>
+      <th>
+        Macro name
+      </th>
+      <th>
         Translation
-      </td>
-      <td>
+      </th>
+      <th>
         Description
-      </td>
+      </th>
     </tr>
     <tr valign="top">
       <td>
-        <font color="purple"><tt><b>GET_Byte()</b></tt></font>
+        <font color="purple"><code><b>GET_Byte()</b></code></font>
       </td>
       <td>
-        <font color="blue"><tt>FT_Get_Byte(stream)</tt></font>
+        <font color="blue"><code>FT_Get_Byte(stream)</code></font>
       </td>
       <td>
         <p>Reads an 8-bit unsigned byte.</p>
@@ -181,11 +182,11 @@
     </tr>
     <tr valign="top">
       <td>
-        <font color="purple"><tt><b>GET_Char()</b></tt></font>
+        <font color="purple"><code><b>GET_Char()</b></code></font>
       </td>
       <td>
-        <font color="blue"><tt>(FT_Char)<br>
-        FT_Get_Byte(stream)</tt></font>
+        <font color="blue"><code>(FT_Char)<br>
+        FT_Get_Byte(stream)</code></font>
       </td>
       <td>
         <p>Reads an 8-bit <em>signed</em> byte.</p>
@@ -193,10 +194,10 @@
     </tr>
     <tr valign="top">
       <td>
-        <font color="purple"><tt><b>GET_Short()</b></tt></font>
+        <font color="purple"><code><b>GET_Short()</b></code></font>
       </td>
       <td>
-        <font color="blue"><tt>FT_Get_Short(stream)</tt></font>
+        <font color="blue"><code>FT_Get_Short(stream)</code></font>
       </td>
       <td>
         Reads a 16-bit signed big-endian integer.
@@ -204,11 +205,11 @@
     </tr>
     <tr valign="top">
       <td>
-        <font color="purple"><tt><b>GET_UShort()</b></tt></font>
+        <font color="purple"><code><b>GET_UShort()</b></code></font>
       </td>
       <td>
-        <font color="blue"><tt>(FT_UShort)<br>
-        FT_Get_Short(stream)</tt></font>
+        <font color="blue"><code>(FT_UShort)<br>
+        FT_Get_Short(stream)</code></font>
       </td>
       <td>
         Reads a 16-bit unsigned big-endian integer.
@@ -216,10 +217,10 @@
     </tr>
     <tr valign="top">
       <td>
-        <font color="purple"><tt><b>GET_Offset()</b></tt></font>
+        <font color="purple"><code><b>GET_Offset()</b></code></font>
       </td>
       <td>
-        <font color="blue"><tt>FT_Get_Offset(stream)</tt></font>
+        <font color="blue"><code>FT_Get_Offset(stream)</code></font>
       </td>
       <td>
         Reads a 24-bit signed big-endian integer.
@@ -227,11 +228,11 @@
     </tr>
     <tr valign="top">
       <td>
-        <font color="purple"><tt><b>GET_UOffset()</b></tt></font>
+        <font color="purple"><code><b>GET_UOffset()</b></code></font>
       </td>
       <td>
-        <font color="blue"><tt>(FT_UOffset)<br>
-        FT_Get_Offset(stream)</tt></font>
+        <font color="blue"><code>(FT_UOffset)<br>
+        FT_Get_Offset(stream)</code></font>
       </td>
       <td>
         Reads a 24-bit unsigned big-endian integer.
@@ -239,10 +240,10 @@
     </tr>
     <tr valign="top">
       <td>
-        <font color="purple"><tt><b>GET_Long()</b></tt></font>
+        <font color="purple"><code><b>GET_Long()</b></code></font>
       </td>
       <td>
-        <font color="blue"><tt>FT_Get_Long(stream)</tt></font>
+        <font color="blue"><code>FT_Get_Long(stream)</code></font>
       </td>
       <td>
         Reads a 32-bit signed big-endian integer.
@@ -250,11 +251,11 @@
     </tr>
     <tr valign="top">
       <td>
-        <font color="purple"><tt><b>GET_ULong()</b></tt></font>
+        <font color="purple"><code><b>GET_ULong()</b></code></font>
       </td>
       <td>
-        <font color="blue"><tt>(FT_ULong)<br>
-        FT_Get_Long(stream)</tt></font>
+        <font color="blue"><code>(FT_ULong)<br>
+        FT_Get_Long(stream)</code></font>
       </td>
       <td>
         Reads a 32-bit unsigned big-endian integer.
@@ -292,7 +293,7 @@
     FORGET_Frame();</pre>
     </font>
 
-    <p>Which is clearer.  Notice that <tt>error</tt> and <tt>stream</tt>
+    <p>Which is clearer.  Notice that <var>error</var> and <var>stream</var>
     must be defined locally though for this code to work!</p>
 
     <hr>
@@ -304,11 +305,11 @@
   <p>It is sometimes useful to read small integers from a font file without
   using a frame.  Some functions have been introduced in FreeType&nbsp;2 to
   do just that, and they are of the form <font
-  color="blue"><tt>FT_Read_xxxx</tt></font>.</p>
+  color="blue"><code>FT_Read_xxxx</code></font>.</p>
 
-  <p>For example, <font color="blue"><tt>FT_Read_Short(stream,
-  &error)</tt></font> reads and returns a 2-byte big-endian integer from a
-  <tt>stream</tt>, and places an error code in the <tt>error</tt>
+  <p>For example, <font color="blue"><code>FT_Read_Short(stream,
+  &error)</code></font> reads and returns a 2-byte big-endian integer from a
+  <var>stream</var>, and places an error code in the <var>error</var>
   variable.</p>
 
   <p>Thus, reading a single big-endian integer is shorter than using a frame
@@ -315,7 +316,7 @@
   for it.</p>
 
   <p>Note that there are also macros <font
-  color="purple"><tt>READ_xxx()</tt></font> which translate to</p>
+  color="purple"><code>READ_xxx()</code></font> which translate to</p>
 
   <font color="blue">
   <pre>
@@ -331,7 +332,8 @@
       goto Fail;</pre>
   </font>
 
-  <p>if <tt>error</tt> and <tt>stream</tt> are already defined locally.</p>
+  <p>if <var>error</var> and <var>stream</var> are already defined
+  locally.</p>
 
 </td></tr>
 </table>
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -206,8 +206,8 @@
   /*                                                                       */
   /*   Don't define any of these macros to compile in `release' mode.      */
   /*                                                                       */
-#undef   FT_DEBUG_LEVEL_ERROR
-#undef   FT_DEBUG_LEVEL_TRACE
+#define FT_DEBUG_LEVEL_ERROR
+#define FT_DEBUG_LEVEL_TRACE
 
 
   /*************************************************************************/
--- a/include/freetype/internal/sfnt.h
+++ b/include/freetype/internal/sfnt.h
@@ -20,6 +20,7 @@
 #define SFNT_H
 
 #include <freetype/freetype.h>
+#include <freetype/internal/ftdriver.h>
 #include <freetype/internal/tttypes.h>
 
 
--- a/src/base/ftextend.c
+++ b/src/base/ftextend.c
@@ -26,6 +26,7 @@
 
 
 #include <freetype/internal/ftextend.h>
+#include <freetype/internal/ftdebug.h>
 
 
   /*************************************************************************/
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -192,9 +192,7 @@
     FT_TRACE7(( " Freeing block 0x%08p, ref 0x%08p\n",
                 P, P ? *P : (void*)0 ));
 
-    FT_Assert( P != 0 );
-
-    if ( *P )
+    if ( P && *P )
     {
       memory->free( memory, *P );
       *P = 0;
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -13,40 +13,32 @@
 # fully.
 
 
-# It sets the following variables, which are used by the master Makefile
+# It sets the following variables which are used by the master Makefile
 # after the call:
 #
-#    BASE_H:       The list of base layer header files on which the rest
-#                  of the library (i.e. drivers) rely.
+#   BASE_OBJ_S:   The single-object base layer.
+#   BASE_OBJ_M:   A list of all objects for a multiple-objects build.
+#   BASE_EXT_OBJ: A list of base layer extensions, i.e., components found
+#                 in `freetype/src/base' which are not compiled within the
+#                 base layer proper.
 #
-#    BASE_OBJ_S:   The single-object base layer.
-#    BASE_OBJ_M:   A list of all objects for a multiple-objects build.
-#    BASE_EXT_OBJ: A list of base layer extensions, i.e., components found
-#                  in `freetype/lib/base' which are not compiled within the
-#                  base layer proper.
+# BASE_H is defined in freetype.mk to simplify the dependency rules.
 
+
 BASE_COMPILE := $(FT_COMPILE) $I$(SRC_)base
 
+
 # Base layer sources
 #
-BASE_SRC := $(BASE_)ftcalc.c    \
-            $(BASE_)ftextend.c  \
-            $(BASE_)ftlist.c    \
-            $(BASE_)ftobjs.c    \
-            $(BASE_)ftstream.c  \
+#   ftsystem, ftinit, and ftdebug are handled by freetype.mk
+#
+BASE_SRC := $(BASE_)ftcalc.c   \
+            $(BASE_)ftextend.c \
+            $(BASE_)ftlist.c   \
+            $(BASE_)ftobjs.c   \
+            $(BASE_)ftstream.c \
             $(BASE_)ftoutln.c
 
-# Base layer headers
-#
-BASE_H := $(INTERNAL_)ftcalc.h    \
-          $(INTERNAL_)ftdebug.h   \
-          $(INTERNAL_)ftdriver.h  \
-          $(INTERNAL_)ftextend.h  \
-          $(INTERNAL_)ftlist.h    \
-          $(INTERNAL_)ftobjs.h    \
-          $(INTERNAL_)ftstream.h
-
-
 # Base layer `extensions' sources
 #
 # An extension is added to the library file (.a or .lib) as a separate
@@ -58,10 +50,6 @@
                 $(BASE_)ftmm.c     \
                 $(BASE_)ftgrays.c
 
-# Base layer extensions headers
-#
-BASE_EXT_H := $(BASE_EXT_SRC:%c=%h)
-
 # Default extensions objects
 #
 BASE_EXT_OBJ := $(BASE_EXT_SRC:$(BASE_)%.c=$(OBJ_)%.$O)
@@ -78,21 +66,20 @@
 BASE_OBJ_M := $(BASE_SRC:$(BASE_)%.c=$(OBJ_)%.$O)
 BASE_OBJ_S := $(OBJ_)ftbase.$O
 
-# Base layer root source file(s)
+# Base layer root source file for single build
 #
-BASE_SRC_M := $(BASE_SRC)
 BASE_SRC_S := $(BASE_)ftbase.c
 
 
-# Multiple objects build + extensions
+# Base layer - single object build
 #
-$(OBJ_)ft%.$O: $(BASE_)ft%.c $(PUBLIC_H) $(BASE_H)
-	$(BASE_COMPILE) $T$@ $<
+$(BASE_OBJ_S): $(BASE_SRC_S) $(BASE_SRC) $(FREETYPE_H)
+	$(BASE_COMPILE) $T$@ $(BASE_SRC_S)
 
 
-# Base layer - single object build
+# Multiple objects build + extensions
 #
-$(BASE_OBJ_S): $(PUBLIC_H) $(BASE_H) $(BASE_SRC_S) $(BASE_SRC)
-	$(BASE_COMPILE) $T$@ $(BASE_SRC_S)
+$(OBJ_)%.$O: $(BASE_)%.c $(FREETYPE_H)
+	$(BASE_COMPILE) $T$@ $<
 
 # EOF
--- a/src/cff/rules.mk
+++ b/src/cff/rules.mk
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
@@ -13,12 +13,6 @@
 # fully.
 
 
-# Include the rules defined for the SFNT driver, which is heavily used
-# by the TrueType one.
-#
-include $(SRC_)sfnt/rules.mk
-
-
 # OpenType driver directory
 #
 T2_DIR  := $(SRC_)cff
@@ -25,16 +19,10 @@
 T2_DIR_ := $(T2_DIR)$(SEP)
 
 
-# location of all extensions to the driver, if any
-#
-T2_EXT_DIR  := $(T2_DIR_)extend
-T2_EXT_DIR_ := $(T2_EXT_DIR)$(SEP)
-
 # additional include flags used when compiling the driver
 #
-T2_INCLUDE := $(SFNT_INCLUDE) $(T2_DIR) $(T2_EXT_DIR)
+T2_INCLUDE := $(T2_DIR)
 
-
 # compilation flags for the driver
 #
 T2_CFLAGS  := $(T2_INCLUDE:%=$I%)
@@ -41,7 +29,7 @@
 T2_COMPILE := $(FT_COMPILE) $(T2_CFLAGS)
 
 
-# driver sources (i.e., C files)
+# T2 driver sources (i.e., C files)
 #
 T2_DRV_SRC := $(T2_DIR_)t2objs.c   \
               $(T2_DIR_)t2load.c   \
@@ -49,58 +37,34 @@
               $(T2_DIR_)t2parse.c  \
               $(T2_DIR_)t2driver.c
 
-# driver headers
+# T2 driver headers
 #
-T2_DRV_H := $(SFNT_H)             \
-            $(T2_DRV_SRC:%.c=%.h)
+T2_DRV_H := $(T2_DRV_SRC:%.c=%.h) \
+            $(T2_DIR_)t2tokens.h
 
 
-# default extensions headers
+# T2 driver object(s)
 #
-T2_EXT_H := $(T2_EXT_SRC:.c=.h)
-
-
-# driver object(s)
+#   T2_DRV_OBJ_M is used during `multi' builds
+#   T2_DRV_OBJ_S is used during `single' builds
 #
-#   T2_DRV_OBJ_M is used during `debug' builds
-#   T2_DRV_OBJ_S is used during `release' builds
-#
 T2_DRV_OBJ_M := $(T2_DRV_SRC:$(T2_DIR_)%.c=$(OBJ_)%.$O)
 T2_DRV_OBJ_S := $(OBJ_)cff.$O
 
-
-# default extensions objects
+# T2 driver source file for single build
 #
-T2_EXT_OBJ := $(T2_EXT_SRC:$(T2_EXT_DIR_)%.c=$(OBJ_)%.$O)
-
-
-# driver source file(s)
-#
-T2_DRV_SRC_M := $(T2_DRV_SRC) $(SFNT_SRC)
 T2_DRV_SRC_S := $(T2_DIR_)cff.c
 
 
-# driver - single object
+# T2 driver - single object
 #
-#  the driver is recompiled if any of the header or source files is changed
-#  as well as any of the shared source files found in `shared/sfnt'
-#
-$(T2_DRV_OBJ_S): $(BASE_H) $(T2_DRV_H) $(T2_DRV_SRC) $(T2_DRV_SRC_S)
+$(T2_DRV_OBJ_S): $(T2_DRV_SRC_S) $(T2_DRV_SRC) $(FREETYPE_H) $(T2_DRV_H)
 	$(T2_COMPILE) $T$@ $(T2_DRV_SRC_S)
 
 
-
-# driver - multiple objects
+# T2 driver - multiple objects
 #
-#   All objects are recompiled if any of the header files is changed
-#
-$(OBJ_)t2%.$O: $(T2_DIR_)t2%.c $(BASE_H) $(T2_DRV_H)
-	$(T2_COMPILE) $T$@ $<
-
-$(OBJ_)t2x%.$O: $(T2_EXT_DIR_)t2x%.c $(BASE_H) $(SFNT_H) $(T2_EXT_H)
-	$(T2_COMPILE) $T$@ $<
-
-$(OBJ_)t2%.$O: $(SFNT_DIR_)t2%.c $(BASE_H) $(SFNT_H)
+$(OBJ_)%.$O: $(T2_DIR_)%.c $(FREETYPE_H) $(T2_DRV_H)
 	$(T2_COMPILE) $T$@ $<
 
 
--- a/src/cff/t2gload.c
+++ b/src/cff/t2gload.c
@@ -25,6 +25,7 @@
 #undef  FT_COMPONENT
 #define FT_COMPONENT  trace_t1gload
 
+#include <t2load.h>
 #include <t2gload.h>
 
   typedef enum T2_Operator_
--- a/src/cff/t2load.c
+++ b/src/cff/t2load.c
@@ -1,6 +1,6 @@
 /***************************************************************************/
 /*                                                                         */
-/*  t2load.h                                                               */
+/*  t2load.c                                                               */
 /*                                                                         */
 /*    TrueType glyph data/program tables loader (body).                    */
 /*                                                                         */
--- a/src/cff/t2load.h
+++ b/src/cff/t2load.h
@@ -46,6 +46,14 @@
   void  T2_Forget_Element( CFF_Index*  index,
                            FT_Byte*   *pbytes );
 
+  LOCAL_FUNC
+  FT_Error  T2_Load_CFF_Font( FT_Stream  stream,
+                              FT_Int     face_index,
+                              CFF_Font*  font );
+
+  LOCAL_FUNC
+  void  T2_Done_CFF_Font( CFF_Font*  font );
+
 
 #ifdef __cplusplus
   }
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -15,6 +15,8 @@
  *
  ******************************************************************/
 
+
+#include <cidload.h>
 #include <cidgload.h>
 #include <freetype/internal/ftdebug.h>
 #include <freetype/internal/ftstream.h>
--- a/src/cid/cidload.c
+++ b/src/cid/cidload.c
@@ -477,7 +477,7 @@
   }
 
   LOCAL_FUNC
-  FT_Error  T1_Open_Face( CID_Face  face )
+  FT_Error  CID_Open_Face( CID_Face  face )
   {
     CID_Loader  loader;
     CID_Parser* parser;
--- a/src/cid/cidload.h
+++ b/src/cid/cidload.h
@@ -42,7 +42,7 @@
                      FT_UShort  seed );
 
   LOCAL_DEF
-  FT_Error  T1_Open_Face( CID_Face  face );
+  FT_Error  CID_Open_Face( CID_Face  face );
 
 #ifdef __cplusplus
   }
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -228,7 +228,7 @@
     if ( FILE_Seek(0) )
       goto Exit;
       
-    error = T1_Open_Face( face );
+    error = CID_Open_Face( face );
     if (error) goto Exit;
 
     /* if we just wanted to check the format, leave successfully now */
--- a/src/cid/rules.mk
+++ b/src/cid/rules.mk
@@ -1,5 +1,5 @@
 #
-# FreeType 2 driver configuration rules
+# FreeType 2 CID driver configuration rules
 #
 
 
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
@@ -13,20 +13,7 @@
 # fully.
 
 
-#****************************************************************************
-#*                                                                          *
-#*  The "Type1z" driver is an experimental replacement for the current      *
-#*  Type 1 driver.  It features a very different loading mechanism that     *
-#*  is much faster than the one used by the `normal' driver, and also       *
-#*  deals nicely with nearly broken Type 1 font files. It is also           *
-#*  much smaller...                                                         *
-#*                                                                          *
-#*  Note that it may become a permanent replacement of the current          *
-#*  "src/type1" driver in the future..                                      *
-#*                                                                          *
-#****************************************************************************
-
-# Type1z driver directory
+# CID driver directory
 #
 CID_DIR  := $(SRC_)cid
 CID_DIR_ := $(CID_DIR)$(SEP)
@@ -34,57 +21,51 @@
 
 # additional include flags used when compiling the driver
 #
-CID_INCLUDE := $(SHARED) $(CID_DIR)
-CID_COMPILE := $(FT_COMPILE) $(CID_INCLUDE:%=$I%)
+CID_INCLUDE := $(CID_DIR)
 
+# compilation flags for the driver
+#
+CID_CFLAGS  := $(CID_INCLUDE:%=$I%)
+CID_COMPILE := $(FT_COMPILE) $(CID_CFLAGS)
 
-# Type1 driver sources (i.e., C files)
+
+# CID driver sources (i.e., C files)
 #
 CID_DRV_SRC := $(CID_DIR_)cidparse.c  \
                $(CID_DIR_)cidload.c   \
                $(CID_DIR_)cidriver.c  \
                $(CID_DIR_)cidgload.c  \
-               $(CID_DIR_)cidafm.c
+               $(CID_DIR_)cidafm.c    \
+               $(CID_DIR_)cidobjs.c
 
-# Type1 driver headers
+# CID driver headers
 #
-CID_DRV_H := $(CID_DIR_)cidtokens.h  \
-             $(T1SHARED_H)          \
-             $(CID_DRV_SRC:%.c=%.h)
+CID_DRV_H := $(CID_DRV_SRC:%.c=%.h) \
+             $(CID_DIR_)cidtokens.h
 
 
-# driver object(s)
+# CID driver object(s)
 #
-#   CID_DRV_OBJ_M is used during `debug' builds
-#   CID_DRV_OBJ_S is used during `release' builds
+#   CID_DRV_OBJ_M is used during `multi' builds
+#   CID_DRV_OBJ_S is used during `single' builds
 #
-CID_DRV_OBJ_M := $(CID_DRV_SRC:$(CID_DIR_)%.c=$(OBJ_)%.$O) \
-                 $(T1SHARED:$(T1SHARED_DIR_)%.c=$(OBJ_)%.$O)
+CID_DRV_OBJ_M := $(CID_DRV_SRC:$(CID_DIR_)%.c=$(OBJ_)%.$O)
 CID_DRV_OBJ_S := $(OBJ_)type1cid.$O
 
-
-# driver source file(s)
+# CID driver source file for single build
 #
-CID_DRV_SRC_M := $(CID_DRV_SRC) $(T1SHARED_SRC)
 CID_DRV_SRC_S := $(CID_DIR_)type1cid.c
 
 
-# driver - single object
+# CID driver - single object
 #
-#  the driver is recompiled if any of the header or source files is changed
-#
-$(CID_DRV_OBJ_S): $(BASE_H) $(CID_DRV_H) $(CID_DRV_SRC) $(CID_DRV_SRC_S)
+$(CID_DRV_OBJ_S): $(CID_DRV_SRC_S) $(CID_DRV_SRC) $(FREETYPE_H) $(CID_DRV_H)
 	$(CID_COMPILE) $T$@ $(CID_DRV_SRC_S)
 
 
-# driver - multiple objects
+# CID driver - multiple objects
 #
-#   All objects are recompiled if any of the header files is changed
-#
-$(OBJ_)t1%.$O: $(CID_DIR_)t1%.c $(BASE_H) $(CID_DRV_H)
-	$(CID_COMPILE) $T$@ $<
-
-$(OBJ_)t1%.$O: $(T1SHARED_DIR_)t1%.c $(BASE_H) $(T1SHARED_H)
+$(OBJ_)%.$O: $(CID_DIR_)%.c $(FREETYPE_H) $(CID_DRV_H)
 	$(CID_COMPILE) $T$@ $<
 
 
--- a/src/psnames/rules.mk
+++ b/src/psnames/rules.mk
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
@@ -13,74 +13,63 @@
 # fully.
 
 
-ifndef PSNAMES_INCLUDE
-  # PSNAMES driver directory
-  #
-  PSNAMES_DIR  := $(SRC_)psnames
-  PSNAMES_DIR_ := $(PSNAMES_DIR)$(SEP)
+# PSNames driver directory
+#
+PSNAMES_DIR  := $(SRC_)psnames
+PSNAMES_DIR_ := $(PSNAMES_DIR)$(SEP)
 
-  # additional include flags used when compiling the driver
-  #
-  PSNAMES_INCLUDE := $(SHARED) $(PSNAMES_DIR)
+# additional include flags used when compiling the driver
+#
+PSNAMES_INCLUDE := $(PSNAMES_DIR)
 
 
-  # compilation flags for the driver
-  #
-  PSNAMES_CFLAGS  := $(PSNAMES_INCLUDE:%=$I%)
-  PSNAMES_COMPILE := $(FT_COMPILE) $(PSNAMES_CFLAGS)
+# compilation flags for the driver
+#
+PSNAMES_CFLAGS  := $(PSNAMES_INCLUDE:%=$I%)
+PSNAMES_COMPILE := $(FT_COMPILE) $(PSNAMES_CFLAGS)
 
 
-  # driver sources (i.e., C files)
-  #
-  PSNAMES_DRV_SRC := $(PSNAMES_DIR_)psdriver.c
+# PSNames driver sources (i.e., C files)
+#
+PSNAMES_DRV_SRC := $(PSNAMES_DIR_)psdriver.c
 
 
-  # driver headers
-  #
-  PSNAMES_DRV_H := $(BASE_H)                 \
-                   $(PSNAMES_DIR_)psdriver.h \
-                   $(PSNAMES_DIR_)pstables.h
+# PSNames driver headers
+#
+PSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \
+                 $(PSNAMES_DIR_)pstables.h
 
 
-  # driver object(s)
-  #
-  #   PSNAMES_DRV_OBJ_M is used during `debug' builds
-  #   PSNAMES_DRV_OBJ_S is used during `release' builds
-  #
-  PSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR_)%.c=$(OBJ_)%.$O)
-  PSNAMES_DRV_OBJ_S := $(OBJ_)psnames.$O
+# PSNames driver object(s)
+#
+#   PSNAMES_DRV_OBJ_M is used during `multi' builds
+#   PSNAMES_DRV_OBJ_S is used during `single' builds
+#
+PSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR_)%.c=$(OBJ_)%.$O)
+PSNAMES_DRV_OBJ_S := $(OBJ_)psnames.$O
 
+# PSNames driver source file for single build
+#
+PSNAMES_DRV_SRC_S := $(PSNAMES_DIR_)psdriver.c
 
-  # driver source file(s)
-  #
-  PSNAMES_DRV_SRC_M := $(PSNAMES_DRV_SRC)
-  PSNAMES_DRV_SRC_S := $(PSNAMES_DIR_)psdriver.c
 
+# PSNames driver - single object
+#
+$(PSNAMES_DRV_OBJ_S): $(PSNAMES_DRV_SRC_S) $(PSNAMES_DRV_SRC) \
+                      $(FREETYPE_H) $(PSNAMES_DRV_H)
+	$(PSNAMES_COMPILE) $T$@ $(PSNAMES_DRV_SRC_S)
 
-  # driver - single object
-  #
-  #  the driver is recompiled if any of the header or source files is
-  #  changed as well as any of the shared source files found in
-  #  `shared'
-  #
-  $(PSNAMES_DRV_OBJ_S): $(BASE_H) $(SHARED_H) $(PSNAMES_DRV_H) \
-                        $(PSNAMES_DRV_SRC) $(PSNAMES_DRV_SRC_S)
-	  $(PSNAMES_COMPILE) $T$@ $(PSNAMES_DRV_SRC_S)
 
+# PSNames driver - multiple objects
+#
+$(OBJ_)%.$O: $(PSNAMES_DIR_)%.c $(FREETYPE_H) $(PSNAMES_DRV_H)
+	$(PSNAMES_COMPILE) $T$@ $<
 
-  # driver - multiple objects
-  #
-  #   All objects are recompiled if any of the header files is changed.
-  #
-  $(OBJ_)ps%.$O: $(PSNAMES_DIR_)ps%.c $(BASE_H) $(SHARED_H) $(PSNAMES_DRV_H)
-	  $(PSNAMES_COMPILE) $T$@ $<
 
+# update main driver object lists
+#
+DRV_OBJS_S += $(PSNAMES_DRV_OBJ_S)
+DRV_OBJS_M += $(PSNAMES_DRV_OBJ_M)
 
-  # update main driver object lists
-  #
-  DRV_OBJS_S += $(PSNAMES_DRV_OBJ_S)
-  DRV_OBJS_M += $(PSNAMES_DRV_OBJ_M)
-
-endif
 
 # EOF
--- a/src/sfnt/rules.mk
+++ b/src/sfnt/rules.mk
@@ -13,84 +13,66 @@
 # fully.
 
 
-ifndef SFNT_INCLUDE
-  # SFNT driver directory
-  #
-  SFNT_DIR  := $(SRC_)sfnt
-  SFNT_DIR_ := $(SFNT_DIR)$(SEP)
+# SFNT driver directory
+#
+SFNT_DIR  := $(SRC_)sfnt
+SFNT_DIR_ := $(SFNT_DIR)$(SEP)
 
 
-  # additional include flags used when compiling the driver
-  #
-  SFNT_INCLUDE := $(SHARED) $(SFNT_DIR)
+# additional include flags used when compiling the driver
+#
+SFNT_INCLUDE := $(SFNT_DIR)
 
-  # compilation flags for the driver
-  #
-  SFNT_CFLAGS  := $(SFNT_INCLUDE:%=$I%)
-  SFNT_COMPILE := $(FT_COMPILE) $(SFNT_CFLAGS)
+# compilation flags for the driver
+#
+SFNT_CFLAGS  := $(SFNT_INCLUDE:%=$I%)
+SFNT_COMPILE := $(FT_COMPILE) $(SFNT_CFLAGS)
 
 
-  # driver sources (i.e., C files)
-  #
-  SFNT_DRV_SRC := $(SFNT_DIR_)ttload.c   \
-                  $(SFNT_DIR_)ttcmap.c   \
-                  $(SFNT_DIR_)ttsbit.c   \
-                  $(SFNT_DIR_)ttpost.c   \
-                  $(SFNT_DIR_)sfobjs.c   \
-                  $(SFNT_DIR_)sfdriver.c
+# SFNT driver sources (i.e., C files)
+#
+SFNT_DRV_SRC := $(SFNT_DIR_)ttload.c   \
+                $(SFNT_DIR_)ttcmap.c   \
+                $(SFNT_DIR_)ttsbit.c   \
+                $(SFNT_DIR_)ttpost.c   \
+                $(SFNT_DIR_)sfobjs.c   \
+                $(SFNT_DIR_)sfdriver.c
 
-  # driver headers
-  #
-  SFNT_DRV_H := $(BASE_H)              \
-                $(SFNT_DIR_)sfobjs.h   \
-                $(SFNT_DIR_)ttload.h   \
-                $(SFNT_DIR_)ttsbit.h   \
-                $(SFNT_DIR_)ttcmap.h   \
-                $(SFNT_DIR_)ttpost.h
+# SFNT driver headers
+#
+SFNT_DRV_H := $(SFNT_DRV_SRC:%c=%h)
 
 
-  # driver object(s)
-  #
-  #   SFNT_DRV_OBJ_M is used during `debug' builds
-  #   SFNT_DRV_OBJ_S is used during `release' builds
-  #
-  SFNT_DRV_OBJ_M := $(SFNT_DRV_SRC:$(SFNT_DIR_)%.c=$(OBJ_)%.$O)
-  SFNT_DRV_OBJ_S := $(OBJ_)sfnt.$O
+# SFNT driver object(s)
+#
+#   SFNT_DRV_OBJ_M is used during `multi' builds.
+#   SFNT_DRV_OBJ_S is used during `single' builds.
+#
+SFNT_DRV_OBJ_M := $(SFNT_DRV_SRC:$(SFNT_DIR_)%.c=$(OBJ_)%.$O)
+SFNT_DRV_OBJ_S := $(OBJ_)sfnt.$O
 
+# SFNT driver source file for single build
+#
+SFNT_DRV_SRC_S := $(SFNT_DIR_)sfnt.c
 
-  # driver source file(s)
-  #
-  SFNT_DRV_SRC_M := $(SFNT_DRV_SRC)
-  SFNT_DRV_SRC_S := $(SFNT_DIR_)sfnt.c
 
+# SFNT driver - single object
+#
+$(SFNT_DRV_OBJ_S): $(SFNT_DRV_SRC_S) $(SFNT_DRV_SRC) \
+                   $(FREETYPE_H) $(SFNT_DRV_H)
+	$(SFNT_COMPILE) $T$@ $(SFNT_DRV_SRC_S)
 
-  # driver - single object
-  #
-  #  the driver is recompiled if any of the header or source files is
-  #  changed as well as any of the shared source files found in
-  #  `shared'
-  #
-  $(SFNT_DRV_OBJ_S): $(BASE_H) $(SHARED_H) $(SFNT_DRV_H) \
-                     $(SFNT_DRV_SRC) $(SFNT_DRV_SRC_S)
-	  $(SFNT_COMPILE) $T$@ $(SFNT_DRV_SRC_S)
 
+# SFNT driver - multiple objects
+#
+$(OBJ_)%.$O: $(SFNT_DIR_)%.c $(FREETYPE_H) $(SFNT_DRV_H)
+	$(SFNT_COMPILE) $T$@ $<
 
-  # driver - multiple objects
-  #
-  #   All objects are recompiled if any of the header files is changed
-  #
-  $(OBJ_)tt%.$O: $(SFNT_DIR_)tt%.c $(BASE_H) $(SHARED_H) $(SFNT_DRV_H)
-	  $(SFNT_COMPILE) $T$@ $<
 
-  $(OBJ_)sf%.$O: $(SFNT_DIR_)sf%.c $(BASE_H) $(SHARED_H) $(SFNT_DRV_H)
-	  $(SFNT_COMPILE) $T$@ $<
+# update main driver object lists
+#
+DRV_OBJS_S += $(SFNT_DRV_OBJ_S)
+DRV_OBJS_M += $(SFNT_DRV_OBJ_M)
 
-
-  # update main driver object lists
-  #
-  DRV_OBJS_S += $(SFNT_DRV_OBJ_S)
-  DRV_OBJS_M += $(SFNT_DRV_OBJ_M)
-
-endif
 
 # EOF
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -16,6 +16,7 @@
 /***************************************************************************/
 
 
+#include <freetype/internal/ftobjs.h>
 #include <freetype/internal/sfnt.h>
 #include <freetype/internal/psnames.h>
 #include <freetype/ttnameid.h>
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -453,16 +453,14 @@
     /* check against the last segment */
     seg4 = cmap4->last_segment;
     
-    /* the following is equivalent to performing two tests, as in :     */
-    /*                                                                  */
-    /*  if ( charCode >= seg4->startCount && charCode <= seg4->endCount */
-    /*                                                                  */
-    /* Yes, that's a bit strange, but it's faster, and the idea behind  */
-    /* the cache is to significantly speed up charcode to glyph index   */
-    /* conversion..                                                     */
-    /*                                                                  */
-    /* Sorry if it isn't clear to your eyes..                           */
-    /*                                                                  */
+    /* the following is equivalent to performing two tests, as in         */
+    /*                                                                    */
+    /*  if ( charCode >= seg4->startCount && charCode <= seg4->endCount ) */
+    /*                                                                    */
+    /* Yes, that's a bit strange, but it's faster, and the idea behind    */
+    /* the cache is to significantly speed up charcode to glyph index     */
+    /* conversion.                                                        */
+
     if ( (TT_ULong)(charCode       - seg4->startCount) <
          (TT_ULong)(seg4->endCount - seg4->startCount) )
       goto Found;
@@ -471,6 +469,7 @@
     {
       /* the ranges are sorted in increasing order.  If we are out of */
       /* the range here, the char code isn't in the charmap, so exit. */
+
       if ( charCode > seg4->endCount )
         continue;
 
--- a/src/truetype/rules.mk
+++ b/src/truetype/rules.mk
@@ -6,7 +6,7 @@
 # Copyright 1996-2000 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
-# This file is part of the FreeType project, and may only be used modified
+# This file is part of the FreeType project, and may only be used, modified,
 # and distributed under the terms of the FreeType project license,
 # LICENSE.TXT.  By continuing to use, modify, or distribute this file you
 # indicate that you have read the license and understand and accept it
@@ -13,12 +13,6 @@
 # fully.
 
 
-# Include the rules defined for the SFNT driver, which are heavily used
-# by the TrueType one.
-#
-include $(SRC_)sfnt/rules.mk
-
-
 # TrueType driver directory
 #
 TT_DIR  := $(SRC_)truetype
@@ -25,16 +19,10 @@
 TT_DIR_ := $(TT_DIR)$(SEP)
 
 
-# location of all extensions to the driver, if any
-#
-TT_EXT_DIR  := $(TT_DIR_)extend
-TT_EXT_DIR_ := $(TT_EXT_DIR)$(SEP)
-
 # additional include flags used when compiling the driver
 #
-TT_INCLUDE := $(SFNT_INCLUDE) $(TT_DIR) $(TT_EXT_DIR)
+TT_INCLUDE := $(TT_DIR)
 
-
 # compilation flags for the driver
 #
 TT_CFLAGS  := $(TT_INCLUDE:%=$I%)
@@ -41,7 +29,7 @@
 TT_COMPILE := $(FT_COMPILE) $(TT_CFLAGS)
 
 
-# driver sources (i.e., C files)
+# TrueType driver sources (i.e., C files)
 #
 TT_DRV_SRC := $(TT_DIR_)ttobjs.c   \
               $(TT_DIR_)ttpload.c  \
@@ -49,65 +37,33 @@
               $(TT_DIR_)ttinterp.c \
               $(TT_DIR_)ttdriver.c
 
-# driver headers
+# TrueType driver headers
 #
-TT_DRV_H := $(SFNT_H)             \
-            $(TT_DRV_SRC:%.c=%.h)
+TT_DRV_H := $(TT_DRV_SRC:%.c=%.h)
 
 
-# default extensions sources
+# TrueType driver object(s)
 #
-TT_EXT_SRC := $(TT_EXT_DIR_)ttxkern.c  \
-              $(TT_EXT_DIR_)ttxgasp.c  \
-              $(TT_EXT_DIR_)ttxpost.c  \
-              $(TT_EXT_DIR_)ttxcmap.c  \
-              $(TT_EXT_DIR_)ttxwidth.c
-
-# default extensions headers
+#   TT_DRV_OBJ_M is used during `multi' builds
+#   TT_DRV_OBJ_S is used during `single' builds
 #
-TT_EXT_H := $(TT_EXT_SRC:.c=.h)
-
-
-# driver object(s)
-#
-#   TT_DRV_OBJ_M is used during `debug' builds
-#   TT_DRV_OBJ_S is used during `release' builds
-#
 TT_DRV_OBJ_M := $(TT_DRV_SRC:$(TT_DIR_)%.c=$(OBJ_)%.$O)
 TT_DRV_OBJ_S := $(OBJ_)truetype.$O
 
-
-# default extensions objects
+# TrueType driver source file for single build
 #
-TT_EXT_OBJ := $(TT_EXT_SRC:$(TT_EXT_DIR_)%.c=$(OBJ_)%.$O)
-
-
-# driver source file(s)
-#
-TT_DRV_SRC_M := $(TT_DRV_SRC) $(SFNT_SRC)
 TT_DRV_SRC_S := $(TT_DIR_)truetype.c
 
 
-# driver - single object
+# TrueType driver - single object
 #
-#  the driver is recompiled if any of the header or source files is changed
-#  as well as any of the shared source files found in `shared/sfnt'
-#
-$(TT_DRV_OBJ_S): $(BASE_H) $(TT_DRV_H) $(TT_DRV_SRC) $(TT_DRV_SRC_S)
+$(TT_DRV_OBJ_S): $(TT_DRV_SRC_S) $(TT_DRV_SRC) $(FREETYPE_H) $(TT_DRV_H)
 	$(TT_COMPILE) $T$@ $(TT_DRV_SRC_S)
 
 
 # driver - multiple objects
 #
-#   All objects are recompiled if any of the header files is changed
-#
-$(OBJ_)tt%.$O: $(TT_DIR_)tt%.c $(BASE_H) $(TT_DRV_H)
-	$(TT_COMPILE) $T$@ $<
-
-$(OBJ_)ttx%.$O: $(TT_EXT_DIR_)ttx%.c $(BASE_H) $(SFNT_H) $(TT_EXT_H)
-	$(TT_COMPILE) $T$@ $<
-
-$(OBJ_)tt%.$O: $(SFNT_DIR_)tt%.c $(BASE_H) $(SFNT_H)
+$(OBJ_)%.$O: $(TT_DIR_)%.c $(FREETYPE_H) $(TT_DRV_H)
 	$(TT_COMPILE) $T$@ $<
 
 
--- a/src/type1z/t1afm.c
+++ b/src/type1z/t1afm.c
@@ -115,10 +115,10 @@
 
  /* parse an AFM file - for now, only read the kerning pairs */
   LOCAL_FUNC
-  FT_Error  T1_Read_AFM( FT_Face   t1_face,
+  T1_Error  T1_Read_AFM( FT_Face   t1_face,
                          FT_Stream stream )
   {
-    FT_Error       error;
+    T1_Error       error;
     FT_Memory      memory = stream->memory;
     FT_Byte*       start;
     FT_Byte*       limit;
--- a/src/type1z/t1afm.h
+++ b/src/type1z/t1afm.h
@@ -8,7 +8,10 @@
 #ifndef T1AFM_H
 #define T1AFM_H
 
+#include <freetype/internal/ftstream.h>
 #include <freetype/internal/ftobjs.h>
+#include <freetype/internal/t1types.h>
+#include <freetype/internal/t1errors.h>
 
 /* In this version, we only read the kerning table from the */
 /* AFM file. We may add support for ligatures a bit later.. */
@@ -15,9 +18,9 @@
 
 typedef struct T1_Kern_Pair_
 {
-  FT_UInt   glyph1;
-  FT_UInt   glyph2;
-  FT_Vector kerning;
+  T1_UInt   glyph1;
+  T1_UInt   glyph2;
+  T1_Vector kerning;
 
 } T1_Kern_Pair;
 
@@ -24,7 +27,7 @@
 
 typedef struct T1_AFM_
 {
-  FT_Int        num_pairs;
+  T1_Int        num_pairs;
   T1_Kern_Pair* kern_pairs;
 
 } T1_AFM;
@@ -31,17 +34,17 @@
 
 
 LOCAL_DEF
-FT_Error  T1_Read_AFM( FT_Face   face,
-                       FT_Stream stream );
+T1_Error  T1_Read_AFM( FT_Face    face,
+                       FT_Stream  stream );
 
 LOCAL_DEF
-void      T1_Done_AFM( FT_Memory  memory,
-                       T1_AFM*    afm );
+void  T1_Done_AFM( FT_Memory  memory,
+                   T1_AFM*    afm );
 
 LOCAL_DEF
 void  T1_Get_Kerning( T1_AFM*     afm,
-                      FT_UInt     glyph1,
-                      FT_UInt     glyph2,
-                      FT_Vector*  kerning );
+                      T1_UInt     glyph1,
+                      T1_UInt     glyph2,
+                      T1_Vector*  kerning );
 
 #endif /* T1AFM_H */
--- a/src/type1z/t1driver.c
+++ b/src/type1z/t1driver.c
@@ -17,6 +17,7 @@
 
 #include <t1driver.h>
 #include <t1gload.h>
+#include <t1load.h>
 #include <t1afm.h>
 
 #include <freetype/internal/ftdebug.h>
@@ -435,7 +436,7 @@
 
   EXPORT_FUNC(FT_DriverInterface*)  getDriverInterface( void )
   {
-    return &t1_driver_interface;
+    return &t1z_driver_interface;
   }
 
 #endif /* FT_CONFIG_OPTION_DYNAMIC_DRIVERS */
--- a/src/type1z/t1load.c
+++ b/src/type1z/t1load.c
@@ -148,14 +148,14 @@
    goto Exit;
  }                                  
 
- LOCAL_FUNC  FT_Error  T1_Get_Multi_Master( T1_Face          face,
+ LOCAL_FUNC  T1_Error  T1_Get_Multi_Master( T1_Face          face,
                                             FT_Multi_Master* master )
  {
    T1_Blend*  blend = face->blend;
    T1_UInt    n;
-   FT_Error   error;
+   T1_Error   error;
    
-   error = FT_Err_Invalid_Argument;
+   error = T1_Err_Invalid_Argument;
    if (blend)
    {
      master->num_axis    = blend->num_axis;
@@ -175,15 +175,15 @@
  }                                            
 
 
- LOCAL_FUNC  FT_Error  T1_Set_MM_Blend( T1_Face    face,
+ LOCAL_FUNC  T1_Error  T1_Set_MM_Blend( T1_Face    face,
                                         T1_UInt    num_coords,
                                         T1_Fixed*  coords )
  {
    T1_Blend*  blend = face->blend;
-   FT_Error   error;
+   T1_Error   error;
    T1_UInt    n, m;
    
-   error = FT_Err_Invalid_Argument;
+   error = T1_Err_Invalid_Argument;
    if (blend && blend->num_axis == num_coords)
    {
      /* recompute the weight vector from the blend coordinates */
@@ -213,15 +213,15 @@
  }
  
 
- LOCAL_FUNC  FT_Error  T1_Set_MM_Design( T1_Face   face,
+ LOCAL_FUNC  T1_Error  T1_Set_MM_Design( T1_Face   face,
                                          T1_UInt   num_coords,
                                          T1_Long*  coords )
  {
    T1_Blend*  blend = face->blend;
-   FT_Error   error;
+   T1_Error   error;
    T1_UInt    n, p;
    
-   error = FT_Err_Invalid_Argument;
+   error = T1_Err_Invalid_Argument;
    if (blend && blend->num_axis == num_coords)
    {
      /* compute the blend coordinates through the blend design map */
@@ -328,7 +328,7 @@
  {
    T1_Token_Rec  axis_tokens[ T1_MAX_MM_AXIS ];
    T1_Int        n, num_axis;
-   FT_Error      error = 0;
+   T1_Error      error = 0;
    T1_Blend*     blend;
    FT_Memory     memory;
 
@@ -338,7 +338,7 @@
    {
      FT_ERROR(( "T1.parse_blend_axis_types: incorrect number of axis: %d\n",
                 num_axis ));
-     error = FT_Err_Invalid_File_Format;
+     error = T1_Err_Invalid_File_Format;
      goto Exit;
    }
    
@@ -363,7 +363,7 @@
      len = token->limit - token->start;
      if (len <= 0)
      {
-       error = FT_Err_Invalid_File_Format;
+       error = T1_Err_Invalid_File_Format;
        goto Exit;
      }
        
@@ -387,7 +387,7 @@
    T1_Int        num_axis;
    T1_Parser*    parser = &loader->parser;
    
-   FT_Error      error = 0;
+   T1_Error      error = 0;
    T1_Blend*     blend;
 
    /* get the array of design tokens - compute number of designs */   
@@ -396,7 +396,7 @@
    {
      FT_ERROR(( "T1.design positions: incorrect number of designs: %d\n",
                 num_designs ));
-     error = FT_Err_Invalid_File_Format;
+     error = T1_Err_Invalid_File_Format;
      goto Exit;
    }
    
@@ -428,7 +428,7 @@
        else if (n_axis != num_axis)
        {
          FT_ERROR(( "T1.design_positions: incorrect table\n" ));
-         error = FT_Err_Invalid_File_Format;
+         error = T1_Err_Invalid_File_Format;
          goto Exit;
        }
        
@@ -452,7 +452,7 @@
 
  static void  parse_blend_design_map( T1_Face  face, T1_Loader*  loader )
  {
-   FT_Error      error  = 0;
+   T1_Error      error  = 0;
    T1_Parser*    parser = &loader->parser;
    T1_Blend*     blend;
    T1_Token_Rec  axis_tokens[ T1_MAX_MM_AXIS ];
@@ -466,7 +466,7 @@
    {
      FT_ERROR(( "T1.design map: incorrect number of axis: %d\n",
                 num_axis ));
-     error = FT_Err_Invalid_File_Format;
+     error = T1_Err_Invalid_File_Format;
      goto Exit;
    }
    old_cursor = parser->cursor;
@@ -500,7 +500,7 @@
      if (num_points <= 0 || num_points > T1_MAX_MM_MAP_POINTS)
      {
        FT_ERROR(( "T1.design map: incorrect table\n" ));
-       error = FT_Err_Invalid_File_Format;
+       error = T1_Err_Invalid_File_Format;
        goto Exit;
      }
      
@@ -525,7 +525,7 @@
 
  static void parse_weight_vector( T1_Face   face, T1_Loader*  loader )
  {
-   FT_Error      error  = 0;
+   T1_Error      error  = 0;
    T1_Parser*    parser = &loader->parser;
    T1_Blend*     blend  = face->blend;
    T1_Token_Rec  master;
@@ -536,7 +536,7 @@
    if (!blend || blend->num_designs == 0)
    {
      FT_ERROR(( "t1.weight_vector: too early !!\n" ));
-     error = FT_Err_Invalid_File_Format;
+     error = T1_Err_Invalid_File_Format;
      goto Exit;
    }
    
@@ -544,7 +544,7 @@
    if (master.type != t1_token_array)
    {
      FT_ERROR(( "t1.weight_vector: incorrect format !!\n" ));
-     error = FT_Err_Invalid_File_Format;
+     error = T1_Err_Invalid_File_Format;
      goto Exit;
    }
    
@@ -839,7 +839,7 @@
     }
 
     FT_ERROR(( "type1.read_binary_data: invalid size field\n" ));
-    parser->error = FT_Err_Invalid_File_Format;
+    parser->error = T1_Err_Invalid_File_Format;
     return 0;
   }
 
@@ -852,7 +852,7 @@
   void  parse_font_name( T1_Face  face, T1_Loader*  loader )
   {
     T1_Parser*  parser = &loader->parser;
-    FT_Error    error;
+    T1_Error    error;
     FT_Memory   memory = parser->memory;
     T1_Int      len;
     T1_Byte*    cur;
@@ -926,7 +926,7 @@
       if (cur >= limit)
       {
         FT_ERROR(( "type1.parse_encoding: out of bounds !!\n" ));
-        parser->error = FT_Err_Invalid_File_Format;
+        parser->error = T1_Err_Invalid_File_Format;
         return;
       }
     }
@@ -939,7 +939,7 @@
       T1_Int        count, n;
       T1_Table*     char_table = &loader->encoding_table;
       FT_Memory     memory     = parser->memory;
-      FT_Error      error;
+      T1_Error      error;
 
       /* read the number of entries in the encoding, should be 256 */
       count = T1_ToInt( parser );
@@ -1042,7 +1042,7 @@
       else
       {
         FT_ERROR(( "type1.parse_encoding: invalid token !!\n" ));
-        parser->error = FT_Err_Invalid_File_Format;
+        parser->error = T1_Err_Invalid_File_Format;
       }
     }
   }
@@ -1054,7 +1054,7 @@
     T1_Parser*  parser = &loader->parser;
     T1_Table*   table  = &loader->subrs;
     FT_Memory   memory = parser->memory;
-    FT_Error    error;
+    T1_Error    error;
     T1_Int      n;
 
     loader->num_subrs = T1_ToInt( parser );
@@ -1100,7 +1100,7 @@
     T1_Table*   code_table = &loader->charstrings;
     T1_Table*   name_table = &loader->glyph_names;
     FT_Memory   memory     = parser->memory;
-    FT_Error    error;
+    T1_Error    error;
 
     T1_Byte*    cur;
     T1_Byte*    limit = parser->limit;
@@ -1352,7 +1352,7 @@
     T1_Loader  loader;
     T1_Parser* parser;
     T1_Font*   type1 = &face->type1;
-    FT_Error   error;
+    T1_Error   error;
 
     t1_init_loader( &loader, face );
 
@@ -1379,13 +1379,13 @@
     if ( !loader.subrs.init )
     {
       FT_ERROR(( "T1.Open_Face: no subrs array in face !!\n" ));
-      error = FT_Err_Invalid_File_Format;
+      error = T1_Err_Invalid_File_Format;
     }
 
     if ( !loader.charstrings.init )
     {
       FT_ERROR(( "T1.Open_Face: no charstrings array in face !!\n" ));
-      error = FT_Err_Invalid_File_Format;
+      error = T1_Err_Invalid_File_Format;
     }
 
     loader.subrs.init  = 0;
--- a/src/type1z/t1load.h
+++ b/src/type1z/t1load.h
@@ -19,6 +19,8 @@
 #define T1LOAD_H
 
 #include <freetype/internal/ftstream.h>
+#include <freetype/internal/t1types.h>
+#include <freetype/ftmm.h>
 #include <t1parse.h>
 
 #ifdef __cplusplus
@@ -48,19 +50,21 @@
 
 #ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
   LOCAL_DEF
-  FT_Error  T1_Get_Multi_Master( T1_Face          face,
-                                 FT_Multi_Master* master );
+  T1_Error  T1_Get_Multi_Master( T1_Face           face,
+                                 FT_Multi_Master*  master );
 
-  LOCAL_DEF  FT_Error  T1_Set_MM_Blend( T1_Face    face,
-                                        T1_UInt    num_coords,
-                                        T1_Fixed*  coords );
+  LOCAL_DEF
+  T1_Error  T1_Set_MM_Blend( T1_Face    face,
+                             T1_UInt    num_coords,
+                             T1_Fixed*  coords );
 
-  LOCAL_DEF  FT_Error  T1_Set_MM_Design( T1_Face   face,
-                                         T1_UInt   num_coords,
-                                         T1_Long*  coords );
+  LOCAL_DEF
+  T1_Error  T1_Set_MM_Design( T1_Face   face,
+                              T1_UInt   num_coords,
+                              T1_Long*  coords );
 
   LOCAL_DEF
-  void T1_Done_Blend( T1_Face  face );
+  void  T1_Done_Blend( T1_Face  face );
 #endif
 
 #ifdef __cplusplus
--- a/src/type1z/t1objs.c
+++ b/src/type1z/t1objs.c
@@ -106,7 +106,7 @@
     FT_Size_Metrics*  metrics = &size->root.metrics;
 
     if ( metrics->x_ppem < 1 || metrics->y_ppem < 1 )
-      return FT_Err_Invalid_Argument;
+      return T1_Err_Invalid_Argument;
 
     /* Compute root ascender, descender, test height, and max_advance */
     metrics->ascender = ( FT_MulFix( face->root.ascender,
--- a/src/type1z/t1parse.c
+++ b/src/type1z/t1parse.c
@@ -629,7 +629,7 @@
     T1_Int      len = 0;
     T1_Int      count;
     T1_String*  result;
-    FT_Error    error;
+    T1_Error    error;
 
     /* XXX : some stupid fonts have a "Notice" or "Copyright" string     */
     /*       that simply doesn't begin with an opening parenthesis, even */
@@ -913,9 +913,9 @@
 
 
   static
-  FT_Error  read_pfb_tag( FT_Stream  stream, T1_UShort *tag, T1_Long*  size )
+  T1_Error  read_pfb_tag( FT_Stream  stream, T1_UShort *tag, T1_Long*  size )
   {
-    FT_Error  error;
+    T1_Error  error;
 
     if (READ_UShort(*tag)) goto Exit;
     if (*tag == 0x8001 || *tag == 0x8002)
@@ -942,7 +942,7 @@
                            FT_Stream   stream,
                            FT_Memory   memory )
   {
-    FT_Error  error;
+    T1_Error  error;
     T1_UShort tag;
     T1_Long   size;
 
@@ -1095,7 +1095,7 @@
   {
     FT_Stream  stream = parser->stream;
     FT_Memory  memory = parser->memory;
-    FT_Error   error  = 0;
+    T1_Error   error  = 0;
     T1_Long    size;
 
     if (parser->in_pfb)
@@ -1182,7 +1182,7 @@
         if (cur >= limit)
         {
           FT_ERROR(("T1.Open_Private: could not find 'eexec' keyword\n"));
-          error = FT_Err_Invalid_File_Format;
+          error = T1_Err_Invalid_File_Format;
           goto Exit;
         }
       }
--- a/src/type1z/t1parse.h
+++ b/src/type1z/t1parse.h
@@ -300,6 +300,12 @@
   void      T1_ToToken( T1_Parser*    parser,
                         T1_Token_Rec* token );
 
+  LOCAL_FUNC
+  void  T1_ToTokenArray( T1_Parser*     parser,
+                         T1_Token_Rec*  tokens,
+                         T1_UInt        max_tokens,
+                         T1_Int*        pnum_tokens );
+
   LOCAL_DEF
   T1_Error  T1_Load_Field( T1_Parser*           parser,
                            const T1_Field_Rec*  field,