1999-12-16 23:11:37 +00:00
|
|
|
#****************************************************************************
|
|
|
|
#* *
|
|
|
|
#* FreeType library sub-Makefile *
|
|
|
|
#* *
|
|
|
|
#* Copyright 1996-1999 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. *
|
|
|
|
#* *
|
|
|
|
#* *
|
|
|
|
#* *
|
|
|
|
#* DO NOT INVOKE THIS MAKEFILE DIRECTLY. IT IS MEANT TO BE INCLUDED BY *
|
|
|
|
#* OTHER MAKEFILES. *
|
|
|
|
#* *
|
|
|
|
#****************************************************************************
|
|
|
|
|
|
|
|
|
1999-12-29 00:19:37 +00:00
|
|
|
# include the 'modules' rules file
|
|
|
|
#
|
|
|
|
include $(TOP)/config/modules.mk
|
|
|
|
|
2000-02-29 16:56:18 +00:00
|
|
|
# The targets `objects', `library' are defined at the end of
|
|
|
|
# this Makefile when all rules have been included..
|
1999-12-16 23:11:37 +00:00
|
|
|
#
|
|
|
|
.PHONY: build_freetype objects library
|
|
|
|
|
|
|
|
# default target - build objects and library
|
|
|
|
#
|
|
|
|
build_freetype: objects library
|
|
|
|
|
|
|
|
# `multi' target - build multiple objects and library
|
|
|
|
#
|
|
|
|
multi: objects library
|
|
|
|
|
|
|
|
|
|
|
|
# The FreeType sources directory.
|
|
|
|
#
|
|
|
|
SRC := $(TOP)$(SEP)src
|
|
|
|
|
|
|
|
|
|
|
|
# The directory where the base layer components are placed.
|
|
|
|
# By default, this is 'freetype/src/base'
|
|
|
|
#
|
|
|
|
BASE_DIR := $(SRC)$(SEP)base
|
|
|
|
|
|
|
|
|
|
|
|
# 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)
|
|
|
|
#
|
|
|
|
#
|
|
|
|
SRC_ := $(SRC)$(SEP)
|
|
|
|
BASE_ := $(BASE_DIR)$(SEP)
|
|
|
|
OBJ_ := $(OBJ_DIR)$(SEP)
|
|
|
|
LIB_ := $(LIB_DIR)$(SEP)
|
|
|
|
PUBLIC_ := $(TOP)$(SEP)include$(SEP)
|
2000-02-29 16:56:18 +00:00
|
|
|
CONFIG_ := $(TOP)$(SEP)config$(SEP)
|
1999-12-16 23:11:37 +00:00
|
|
|
|
|
|
|
# The name of the final library file.
|
|
|
|
#
|
2000-02-29 16:56:18 +00:00
|
|
|
FT_LIBRARY := $(LIB_)$(LIBRARY).$A
|
1999-12-16 23:11:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
# include paths
|
|
|
|
#
|
|
|
|
# IMPORTANT NOTE: The architecture-dependent directory must ALWAYS be placed
|
|
|
|
# in front of the include list. Porters are then able to put
|
|
|
|
# their own version of some of the FreeType components in
|
2000-02-29 16:56:18 +00:00
|
|
|
# the 'freetype/config/<system>' directory, as these files
|
1999-12-16 23:11:37 +00:00
|
|
|
# will override the default sources.
|
|
|
|
#
|
2000-02-29 16:56:18 +00:00
|
|
|
INCLUDES := $(BUILD) $(TOP)$(SEP)config $(TOP)$(SEP)include $(INCLUDES)
|
1999-12-16 23:11:37 +00:00
|
|
|
|
|
|
|
INCLUDE_FLAGS = $(INCLUDES:%=$I%)
|
|
|
|
|
|
|
|
|
|
|
|
# C flags used for the compilation of an object file. This must include at
|
|
|
|
# least the paths for the 'base' and 'config/<system>' directories,
|
|
|
|
# debug/optimization/warning flags + ansi compliance if needed.
|
|
|
|
#
|
|
|
|
FT_CFLAGS = $(CFLAGS) $(INCLUDE_FLAGS)
|
|
|
|
FT_CC = $(CC) $(FT_CFLAGS)
|
2000-01-17 11:20:26 +00:00
|
|
|
FT_COMPILE = $(CC) $(ANSI_FLAGS) $(FT_CFLAGS)
|
1999-12-16 23:11:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Free the lists of driver objects
|
|
|
|
#
|
|
|
|
COMPONENTS_LIST :=
|
|
|
|
DRIVERS_LIST :=
|
|
|
|
OBJECTS_LIST :=
|
|
|
|
|
|
|
|
# System-specific component - this must be defined in this Makefile
|
2000-02-29 16:56:18 +00:00
|
|
|
# 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'
|
1999-12-16 23:11:37 +00:00
|
|
|
#
|
|
|
|
# BASE_H is defined in src/base/rules.mk and contains the list of all
|
|
|
|
# base layer header files.
|
|
|
|
#
|
2000-02-29 16:56:18 +00:00
|
|
|
ifndef FTSYS_SRC
|
|
|
|
FTSYS_SRC = $(BASE_)ftsystem.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
FTSYS_OBJ = $(OBJ_)ftsystem.$O
|
1999-12-16 23:11:37 +00:00
|
|
|
|
|
|
|
OBJECTS_LIST += $(FTSYS_OBJ)
|
|
|
|
|
|
|
|
$(FTSYS_OBJ): $(FTSYS_SRC) $(BASE_H)
|
|
|
|
$(FT_COMPILE) $T$@ $<
|
|
|
|
|
|
|
|
|
|
|
|
# ftdebug component
|
|
|
|
#
|
2000-02-29 16:56:18 +00:00
|
|
|
# FTDebug contains code used to print traces and errors. It is
|
|
|
|
# normally empty for a release build (see ftoption.h)
|
1999-12-16 23:11:37 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
FTDEBUG_SRC = $(BASE_)ftdebug.c
|
|
|
|
FTDEBUG_OBJ = $(OBJ_)ftdebug.$O
|
|
|
|
|
|
|
|
OBJECTS_LIST += $(FTDEBUG_OBJ)
|
|
|
|
|
|
|
|
$(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(BASE_H)
|
|
|
|
$(FT_COMPILE) $T$@ $<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Define PUBLIC_H as the list of all public header files located in
|
|
|
|
# `$(TOP)/include'
|
|
|
|
#
|
|
|
|
PUBLIC_H := $(wildcard $(PUBLIC_)*.h)
|
|
|
|
|
|
|
|
|
|
|
|
# Include all rule files from FreeType components
|
|
|
|
#
|
|
|
|
#
|
|
|
|
include $(wildcard $(SRC)/*/rules.mk)
|
|
|
|
|
|
|
|
# FTInit file:
|
|
|
|
#
|
|
|
|
# The C source 'ftinit.c' contains the FreeType initialisation routines.
|
|
|
|
# It is able to automatically register one or more drivers when the API
|
|
|
|
# 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
|
|
|
|
# which contain additional include paths and macros used to compile the
|
2000-02-29 16:56:18 +00:00
|
|
|
# single 'ftinit.c' source.
|
1999-12-16 23:11:37 +00:00
|
|
|
#
|
2000-02-29 16:56:18 +00:00
|
|
|
FTINIT_SRC := $(BASE_)ftinit.c
|
1999-12-16 23:11:37 +00:00
|
|
|
FTINIT_OBJ := $(OBJ_)ftinit.$O
|
|
|
|
|
2000-02-29 16:56:18 +00:00
|
|
|
OBJECTS_LIST += $(FTINIT_OBJ)
|
|
|
|
|
|
|
|
$(FTINIT_OBJ): $(FTINIT_SRC) $(BASE_H) $(FT_MODULE_LIST)
|
|
|
|
$(FT_COMPILE) $T$@ $<
|
1999-12-16 23:11:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
# All FreeType library objects
|
|
|
|
#
|
|
|
|
# By default, we include the base layer extensions. These could be
|
|
|
|
# ommitted on builds which do not want them.
|
|
|
|
#
|
2000-02-29 16:56:18 +00:00
|
|
|
OBJ_M = $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M)
|
1999-12-16 23:11:37 +00:00
|
|
|
|
2000-02-29 16:56:18 +00:00
|
|
|
OBJ_S = $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S)
|
|
|
|
|
|
|
|
# the target 'multi' on the Make command line indicates that we want
|
|
|
|
# to compile each source file independently..
|
|
|
|
#
|
|
|
|
# Otherwise, each module/driver is compiled in a single object file
|
|
|
|
# through source file inclusion (see 'src/base/ftbase.c' or
|
|
|
|
# 'src/truetype/truetype.c' for examples)
|
|
|
|
#
|
|
|
|
|
|
|
|
BASE_OBJECTS := $(OBJECTS_LIST)
|
1999-12-16 23:11:37 +00:00
|
|
|
|
|
|
|
ifneq ($(findstring multi,$(MAKECMDGOALS)),)
|
|
|
|
OBJECTS_LIST += $(OBJ_M)
|
|
|
|
else
|
|
|
|
OBJECTS_LIST += $(OBJ_S)
|
|
|
|
endif
|
|
|
|
|
|
|
|
objects: $(OBJECTS_LIST)
|
|
|
|
|
|
|
|
library: $(FT_LIBRARY)
|
|
|
|
|
|
|
|
.c.$O:
|
|
|
|
$(FT_COMPILE) $T$@ $<
|
|
|
|
|
|
|
|
|
2000-01-17 11:20:26 +00:00
|
|
|
# Standard cleaning and distclean rules. These are not accepted
|
|
|
|
# on all systems though..
|
|
|
|
#
|
|
|
|
clean_freetype_std:
|
2000-02-29 16:56:18 +00:00
|
|
|
-$(DELETE) $(BASE_OBJECTS) $(OBJS_M) $(OBJS_S)
|
1999-12-16 23:11:37 +00:00
|
|
|
|
2000-01-17 11:20:26 +00:00
|
|
|
distclean_freetype_std: clean_freetype_std
|
2000-01-18 09:52:08 +00:00
|
|
|
-$(DELETE) $(FT_LIBRARY)
|
1999-12-16 23:11:37 +00:00
|
|
|
-$(DELETE) *.orig *~ core *.core
|
|
|
|
|
2000-01-17 11:20:26 +00:00
|
|
|
# The Dos command shell does not support very long list of arguments
|
|
|
|
# so we're stuck with wildcards
|
|
|
|
#
|
|
|
|
|
|
|
|
clean_freetype_dos:
|
|
|
|
-del $(subst $(SEP),$(HOSTSEP),$(OBJ_))*.$O 2> nul
|
|
|
|
|
|
|
|
distclean_freetype_dos: clean_freetype_dos
|
|
|
|
-del $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul
|
|
|
|
|
2000-02-29 16:56:18 +00:00
|
|
|
# remove configuration file (used for distclean)
|
|
|
|
#
|
1999-12-16 23:11:37 +00:00
|
|
|
remove_config_mk:
|
2000-01-18 09:52:08 +00:00
|
|
|
-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(CONFIG_MK))
|
1999-12-16 23:11:37 +00:00
|
|
|
|
2000-01-17 11:20:26 +00:00
|
|
|
# the "config.mk" 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..
|
|
|
|
#
|
1999-12-16 23:11:37 +00:00
|
|
|
clean: clean_freetype
|
|
|
|
distclean: distclean_freetype remove_config_mk
|
|
|
|
|
|
|
|
# END
|