mgh: fix for default HDD DMA mode, that wasn't correctly set
[open-ps2-loader.git] / thirdparty / freetype-2.3.12 / builds / freetype.mk
blob7a89c8e3d019e88d0e4099e8461b1961b2ee2211
2 # FreeType 2 library sub-Makefile
6 # Copyright 1996-2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 by
7 # David Turner, Robert Wilhelm, and Werner Lemberg.
9 # This file is part of the FreeType project, and may only be used, modified,
10 # and distributed under the terms of the FreeType project license,
11 # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 # indicate that you have read the license and understand and accept it
13 # fully.
16 # DO NOT INVOKE THIS MAKEFILE DIRECTLY! IT IS MEANT TO BE INCLUDED BY
17 # OTHER MAKEFILES.
20 # The following variables (set by other Makefile components, in the
21 # environment, or on the command line) are used:
23 # BUILD_DIR The architecture dependent directory,
24 # e.g. `$(TOP_DIR)/builds/unix'. Added to INCLUDES also.
26 # OBJ_DIR The directory in which object files are created.
28 # LIB_DIR The directory in which the library is created.
30 # DOC_DIR The directory in which the API reference is created.
32 # INCLUDES A list of directories to be included additionally.
34 # DEVEL_DIR Development directory which is added to the INCLUDES
35 # variable before the standard include directories.
37 # CFLAGS Compilation flags. This overrides the default settings
38 # in the platform-specific configuration files.
40 # FTSYS_SRC If set, its value is used as the name of a replacement
41 # file for `src/base/ftsystem.c'.
43 # FTDEBUG_SRC If set, its value is used as the name of a replacement
44 # file for `src/base/ftdebug.c'. [For a normal build, this
45 # file does nothing.]
47 # FTMODULE_H The file which contains the list of module classes for
48 # the current build. Usually, this is automatically
49 # created by `modules.mk'.
51 # BASE_OBJ_S
52 # BASE_OBJ_M A list of base objects (for single object and multiple
53 # object builds, respectively). Set up in
54 # `src/base/rules.mk'.
56 # BASE_EXT_OBJ A list of base extension objects. Set up in
57 # `src/base/rules.mk'.
59 # DRV_OBJ_S
60 # DRV_OBJ_M A list of driver objects (for single object and multiple
61 # object builds, respectively). Set up cumulatively in
62 # `src/<driver>/rules.mk'.
64 # CLEAN
65 # DISTCLEAN The sub-makefiles can append additional stuff to these two
66 # variables which is to be removed for the `clean' resp.
67 # `distclean' target.
69 # TOP_DIR, SEP,
70 # COMPILER_SEP,
71 # LIBRARY, CC,
72 # A, I, O, T Check `config.mk' for details.
75 # The targets `objects' and `library' are defined at the end of this
76 # Makefile after all other rules have been included.
78 .PHONY: single multi objects library refdoc
80 # default target -- build single objects and library
82 single: objects library
84 # `multi' target -- build multiple objects and library
86 multi: objects library
89 # The FreeType source directory, usually `./src'.
91 SRC_DIR := $(TOP_DIR)/src
93 # The directory where the base layer components are placed, usually
94 # `./src/base'.
96 BASE_DIR := $(SRC_DIR)/base
98 # Other derived directories.
100 PUBLIC_DIR := $(TOP_DIR)/include/freetype
101 INTERNAL_DIR := $(PUBLIC_DIR)/internal
102 SERVICES_DIR := $(INTERNAL_DIR)/services
103 CONFIG_DIR := $(PUBLIC_DIR)/config
105 # The documentation directory.
107 DOC_DIR ?= $(TOP_DIR)/docs/reference
109 # The final name of the library file.
111 PROJECT_LIBRARY := $(LIB_DIR)/$(LIBRARY).$A
114 # include paths
116 # IMPORTANT NOTE: The architecture-dependent directory must ALWAYS be placed
117 # before the standard include list. Porters are then able to
118 # put their own version of some of the FreeType components
119 # in the `freetype/builds/<system>' directory, as these
120 # files will override the default sources.
122 INCLUDES := $(subst /,$(COMPILER_SEP),$(OBJ_DIR) \
123 $(DEVEL_DIR) \
124 $(BUILD_DIR) \
125 $(TOP_DIR)/include)
127 INCLUDE_FLAGS := $(INCLUDES:%=$I%)
130 # C flags used for the compilation of an object file. This must include at
131 # least the paths for the `base' and `builds/<system>' directories;
132 # debug/optimization/warning flags + ansi compliance if needed.
134 # $(INCLUDE_FLAGS) should come before $(CFLAGS) to avoid problems with
135 # old FreeType versions.
137 # Note what we also define the macro FT2_BUILD_LIBRARY when building
138 # FreeType. This is required to let our sources include the internal
139 # headers (something forbidden by clients).
141 # Finally, we define FT_CONFIG_MODULES_H so that the compiler uses the
142 # generated version of `ftmodule.h' in $(OBJ_DIR). If there is an
143 # `ftoption.h' files in $(OBJ_DIR), define FT_CONFIG_OPTIONS_H too.
145 ifneq ($(wildcard $(OBJ_DIR)/ftoption.h),)
146 FTOPTION_H := $(OBJ_DIR)/ftoption.h
147 FTOPTION_FLAG := $DFT_CONFIG_OPTIONS_H="<ftoption.h>"
148 endif
150 FT_CFLAGS = $(CPPFLAGS) \
151 $(INCLUDE_FLAGS) \
152 $(CFLAGS) \
153 $DFT2_BUILD_LIBRARY \
154 $DFT_CONFIG_MODULES_H="<ftmodule.h>" \
155 $(FTOPTION_FLAG)
156 FT_CC = $(CC) $(FT_CFLAGS)
157 FT_COMPILE = $(CC) $(ANSIFLAGS) $(FT_CFLAGS)
160 # Include the `exports' rules file.
162 include $(TOP_DIR)/builds/exports.mk
165 # Initialize the list of objects.
167 OBJECTS_LIST :=
170 # Define $(PUBLIC_H) as the list of all public header files located in
171 # `$(TOP_DIR)/include/freetype'. $(INTERNAL_H), and $(CONFIG_H) are defined
172 # similarly.
174 # This is used to simplify the dependency rules -- if one of these files
175 # changes, the whole library is recompiled.
177 PUBLIC_H := $(wildcard $(PUBLIC_DIR)/*.h)
178 INTERNAL_H := $(wildcard $(INTERNAL_DIR)/*.h) \
179 $(wildcard $(SERVICES_DIR)/*.h)
180 CONFIG_H := $(wildcard $(CONFIG_DIR)/*.h) \
181 $(wildcard $(BUILD_DIR)/freetype/config/*.h) \
182 $(FTMODULE_H) \
183 $(FTOPTION_H)
184 DEVEL_H := $(wildcard $(TOP_DIR)/devel/*.h)
186 FREETYPE_H := $(PUBLIC_H) $(INTERNAL_H) $(CONFIG_H) $(DEVEL_H)
189 # ftsystem component
191 FTSYS_SRC ?= $(BASE_DIR)/ftsystem.c
193 FTSYS_OBJ := $(OBJ_DIR)/ftsystem.$O
195 OBJECTS_LIST += $(FTSYS_OBJ)
197 $(FTSYS_OBJ): $(FTSYS_SRC) $(FREETYPE_H)
198 $(FT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
201 # ftdebug component
203 FTDEBUG_SRC ?= $(BASE_DIR)/ftdebug.c
205 FTDEBUG_OBJ := $(OBJ_DIR)/ftdebug.$O
207 OBJECTS_LIST += $(FTDEBUG_OBJ)
209 $(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(FREETYPE_H)
210 $(FT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
213 # Include all rule files from FreeType components.
215 include $(SRC_DIR)/base/rules.mk
216 include $(patsubst %,$(SRC_DIR)/%/rules.mk,$(MODULES))
219 # ftinit component
221 # The C source `ftinit.c' contains the FreeType initialization routines.
222 # It is able to automatically register one or more drivers when the API
223 # function FT_Init_FreeType() is called.
225 # The set of initial drivers is determined by the driver Makefiles
226 # includes above. Each driver Makefile updates the FTINIT_xxx lists
227 # which contain additional include paths and macros used to compile the
228 # single `ftinit.c' source.
230 FTINIT_SRC := $(BASE_DIR)/ftinit.c
231 FTINIT_OBJ := $(OBJ_DIR)/ftinit.$O
233 OBJECTS_LIST += $(FTINIT_OBJ)
235 $(FTINIT_OBJ): $(FTINIT_SRC) $(FREETYPE_H)
236 $(FT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
239 # All FreeType library objects.
241 OBJ_M := $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M)
242 OBJ_S := $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S)
245 # The target `multi' on the Make command line indicates that we want to
246 # compile each source file independently.
248 # Otherwise, each module/driver is compiled in a single object file through
249 # source file inclusion (see `src/base/ftbase.c' or
250 # `src/truetype/truetype.c' for examples).
252 BASE_OBJECTS := $(OBJECTS_LIST)
254 ifneq ($(findstring multi,$(MAKECMDGOALS)),)
255 OBJECTS_LIST += $(OBJ_M)
256 else
257 OBJECTS_LIST += $(OBJ_S)
258 endif
260 objects: $(OBJECTS_LIST)
262 library: $(PROJECT_LIBRARY)
264 dll: $(PROJECT_LIBRARY) exported_symbols
266 .c.$O:
267 $(FT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
270 ifneq ($(findstring refdoc,$(MAKECMDGOALS)),)
271 # poor man's `sed' emulation with make's built-in string functions
272 work := $(strip $(shell $(CAT) $(PUBLIC_DIR)/freetype.h))
273 work := $(subst |,x,$(work))
274 work := $(subst $(space),|,$(work))
275 work := $(subst \#define|FREETYPE_MAJOR|,$(space),$(work))
276 work := $(word 2,$(work))
277 major := $(subst |,$(space),$(work))
278 major := $(firstword $(major))
280 work := $(subst \#define|FREETYPE_MINOR|,$(space),$(work))
281 work := $(word 2,$(work))
282 minor := $(subst |,$(space),$(work))
283 minor := $(firstword $(minor))
285 work := $(subst \#define|FREETYPE_PATCH|,$(space),$(work))
286 work := $(word 2,$(work))
287 patch := $(subst |,$(space),$(work))
288 patch := $(firstword $(patch))
290 version := $(major).$(minor).$(patch)
291 endif
293 # We write-protect the docmaker directory to suppress generation
294 # of .pyc files.
296 refdoc:
297 -chmod -w $(SRC_DIR)/tools/docmaker
298 python $(SRC_DIR)/tools/docmaker/docmaker.py \
299 --prefix=ft2 \
300 --title=FreeType-$(version) \
301 --output=$(DOC_DIR) \
302 $(PUBLIC_DIR)/*.h \
303 $(PUBLIC_DIR)/config/*.h \
304 $(PUBLIC_DIR)/cache/*.h
305 -chmod +w $(SRC_DIR)/tools/docmaker
308 .PHONY: clean_project_std distclean_project_std
310 # Standard cleaning and distclean rules. These are not accepted
311 # on all systems though.
313 clean_project_std:
314 -$(DELETE) $(BASE_OBJECTS) $(OBJ_M) $(OBJ_S) $(CLEAN)
316 distclean_project_std: clean_project_std
317 -$(DELETE) $(PROJECT_LIBRARY)
318 -$(DELETE) *.orig *~ core *.core $(DISTCLEAN)
321 .PHONY: clean_project_dos distclean_project_dos
323 # The Dos command shell does not support very long list of arguments, so
324 # we are stuck with wildcards.
326 # Don't break the command lines with \; this prevents the "del" command from
327 # working correctly on Win9x.
329 clean_project_dos:
330 -$(DELETE) $(subst /,$(SEP),$(OBJ_DIR)/*.$O $(CLEAN) $(NO_OUTPUT))
332 distclean_project_dos: clean_project_dos
333 -$(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY) $(DISTCLEAN) $(NO_OUTPUT))
336 .PHONY: remove_config_mk remove_ftmodule_h
338 # Remove configuration file (used for distclean).
340 remove_config_mk:
341 -$(DELETE) $(subst /,$(SEP),$(CONFIG_MK) $(NO_OUTPUT))
343 # Remove module list (used for distclean).
345 remove_ftmodule_h:
346 -$(DELETE) $(subst /,$(SEP),$(FTMODULE_H) $(NO_OUTPUT))
349 .PHONY: clean distclean
351 # The `config.mk' file must define `clean_freetype' and
352 # `distclean_freetype'. Implementations may use to relay these to either
353 # the `std' or `dos' versions from above, or simply provide their own
354 # implementation.
356 clean: clean_project
357 distclean: distclean_project remove_config_mk remove_ftmodule_h
358 -$(DELETE) $(subst /,$(SEP),$(DOC_DIR)/*.html $(NO_OUTPUT))
361 # EOF