This commit was manufactured by cvs2svn to create branch 'captive'.
[reactos.git] / subsys / win32k / freetype / builds / freetype.mk
1 #
2 # FreeType 2 library sub-Makefile
3 #
4
5
6 # Copyright 1996-2000 by
7 # David Turner, Robert Wilhelm, and Werner Lemberg.
8 #
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.
14
15
16 # DO NOT INVOKE THIS MAKEFILE DIRECTLY!  IT IS MEANT TO BE INCLUDED BY
17 # OTHER MAKEFILES.
18
19
20 # The following variables (set by other Makefile components, in the
21 # environment, or on the command line) are used:
22 #
23 #   BUILD          The architecture dependent directory,
24 #                  e.g. `$(TOP)/builds/unix'.
25 #
26 #   OBJ_DIR        The directory in which object files are created.
27 #
28 #   LIB_DIR        The directory in which the library is created.
29 #
30 #   INCLUDES       A list of directories to be included additionally.
31 #                  Usually empty.
32 #
33 #   CFLAGS         Compilation flags.  This overrides the default settings
34 #                  in the platform-specific configuration files.
35 #
36 #   FTSYS_SRC      If set, its value is used as the name of a replacement
37 #                  file for `src/base/ftsystem.c'.
38 #
39 #   FTDEBUG_SRC    If set, its value is used as the name of a replacement
40 #                  file for `src/base/ftdebug.c'.  [For a normal build, this
41 #                  file does nothing.]
42 #
43 #   FT_MODULE_LIST The file which contains the list of modules for the
44 #                  current build.  Usually, this is automatically created by
45 #                  `modules.mk'.
46 #
47 #   BASE_OBJ_S
48 #   BASE_OBJ_M     A list of base objects (for single object and multiple
49 #                  object builds, respectively).  Set up in
50 #                  `src/base/rules.mk'.
51 #
52 #   BASE_EXT_OBJ   A list of base extension objects.  Set up in
53 #                  `src/base/rules.mk'.
54 #
55 #   DRV_OBJ_S
56 #   DRV_OBJ_M      A list of driver objects (for single object and multiple
57 #                  object builds, respectively).  Set up cumulatively in
58 #                  `src/<driver>/rules.mk'.
59 #
60 #   CLEAN
61 #   DISTCLEAN      The sub-makefiles can append additional stuff to these two
62 #                  variables which is to be removed for the `clean' resp.
63 #                  `distclean' target.
64 #
65 #   TOP, SEP,
66 #   LIBRARY, CC,
67 #   A, I, O, T     Check `config.mk' for details.
68
69
70 # The targets `objects' and `library' are defined at the end of this
71 # Makefile after all other rules have been included.
72 #
73 .PHONY: single objects library
74
75 # default target -- build single objects and library
76 #
77 single: objects library
78
79 # `multi' target -- build multiple objects and library
80 #
81 multi: objects library
82
83
84 # The FreeType source directory, usually `./src'.
85 #
86 SRC := $(TOP)$(SEP)src
87
88
89 # The directory where the base layer components are placed, usually
90 # `./src/base'.
91 #
92 BASE_DIR := $(SRC)$(SEP)base
93
94
95 # A few short-cuts in order to avoid typing $(SEP) all the time for the
96 # directory separator.
97 #
98 # For example: $(SRC_) equals to `./src/' where `.' is $(TOP).
99 #
100 #
101 SRC_      := $(SRC)$(SEP)
102 BASE_     := $(BASE_DIR)$(SEP)
103 OBJ_      := $(OBJ_DIR)$(SEP)
104 LIB_      := $(LIB_DIR)$(SEP)
105 PUBLIC_   := $(TOP)$(SEP)include$(SEP)freetype$(SEP)
106 INTERNAL_ := $(PUBLIC_)internal$(SEP)
107 CONFIG_   := $(PUBLIC_)config$(SEP)
108
109
110 # The final name of the library file.
111 #
112 FT_LIBRARY := $(LIB_)$(LIBRARY).$A
113
114
115 # include paths
116 #
117 # IMPORTANT NOTE: The architecture-dependent directory must ALWAYS be placed
118 #                 in front of the include list.  Porters are then able to
119 #                 put their own version of some of the FreeType components
120 #                 in the `freetype/builds/<system>' directory, as these
121 #                 files will override the default sources.
122 #
123 INCLUDES := $(BUILD) $(TOP)$(SEP)include $(SRC)
124
125 INCLUDE_FLAGS = $(INCLUDES:%=$I%)
126
127
128 # C flags used for the compilation of an object file.  This must include at
129 # least the paths for the `base' and `builds/<system>' directories;
130 # debug/optimization/warning flags + ansi compliance if needed.
131 #
132 FT_CFLAGS  = $(CFLAGS) $(INCLUDE_FLAGS)
133 FT_CC      = $(CC) $(FT_CFLAGS)
134 FT_COMPILE = $(CC) $(ANSIFLAGS) $(FT_CFLAGS)
135
136
137 # Include the `modules' rules file.
138 #
139 include $(TOP)/builds/modules.mk
140
141
142 # Initialize the list of objects.
143 #
144 OBJECTS_LIST :=
145
146
147 # Define $(PUBLIC_H) as the list of all public header files located in
148 # `$(TOP)/include/freetype'.  $(BASE_H) and $(CONFIG_H) are defined
149 # similarly.
150 #
151 # This is used to simplify the dependency rules -- if one of these files
152 # changes, the whole library is recompiled.
153 #
154 PUBLIC_H   := $(wildcard $(PUBLIC_)*.h)
155 BASE_H     := $(wildcard $(INTERNAL_)*.h)
156 CONFIG_H   := $(wildcard $(CONFIG_)*.h)
157
158 FREETYPE_H := $(PUBLIC_H) $(BASE_H) $(CONFIG_H)
159
160
161 # ftsystem component
162 #
163 ifndef FTSYS_SRC
164   FTSYS_SRC = $(BASE_)ftsystem.c
165 endif
166
167 FTSYS_OBJ = $(OBJ_)ftsystem.$O
168
169 OBJECTS_LIST += $(FTSYS_OBJ)
170
171 $(FTSYS_OBJ): $(FTSYS_SRC) $(FREETYPE_H)
172         $(FT_COMPILE) $T$@ $<
173
174
175 # ftdebug component
176 #
177 ifndef FTDEBUG_SRC
178   FTDEBUG_SRC = $(BASE_)ftdebug.c
179 endif
180
181 FTDEBUG_OBJ = $(OBJ_)ftdebug.$O
182
183 OBJECTS_LIST += $(FTDEBUG_OBJ)
184
185 $(FTDEBUG_OBJ): $(FTDEBUG_SRC) $(FREETYPE_H)
186         $(FT_COMPILE) $T$@ $<
187
188
189 # Include all rule files from FreeType components.
190 #
191 include $(wildcard $(SRC)/*/rules.mk)
192
193
194 # ftinit component
195 #
196 #   The C source `ftinit.c' contains the FreeType initialization routines.
197 #   It is able to automatically register one or more drivers when the API
198 #   function FT_Init_FreeType() is called.
199 #
200 #   The set of initial drivers is determined by the driver Makefiles
201 #   includes above.  Each driver Makefile updates the FTINIT_xxx lists
202 #   which contain additional include paths and macros used to compile the
203 #   single `ftinit.c' source.
204 #
205 FTINIT_SRC := $(BASE_)ftinit.c
206 FTINIT_OBJ := $(OBJ_)ftinit.$O
207
208 OBJECTS_LIST += $(FTINIT_OBJ)
209
210 $(FTINIT_OBJ): $(FTINIT_SRC) $(FREETYPE_H) $(FT_MODULE_LIST)
211         $(FT_COMPILE) $T$@ $<
212
213
214 # All FreeType library objects
215 #
216 #   By default, we include the base layer extensions.  These could be
217 #   omitted on builds which do not want them.
218 #
219 OBJ_M = $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M)
220 OBJ_S = $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S)
221
222
223 # The target `multi' on the Make command line indicates that we want to
224 # compile each source file independently.
225 #
226 # Otherwise, each module/driver is compiled in a single object file through
227 # source file inclusion (see `src/base/ftbase.c' or
228 # `src/truetype/truetype.c' for examples).
229 #
230 BASE_OBJECTS := $(OBJECTS_LIST)
231
232 ifneq ($(findstring multi,$(MAKECMDGOALS)),)
233   OBJECTS_LIST += $(OBJ_M)
234 else
235   OBJECTS_LIST += $(OBJ_S)
236 endif
237
238 objects: $(OBJECTS_LIST)
239
240 library: $(FT_LIBRARY)
241
242 .c.$O:
243         $(FT_COMPILE) $T$@ $<
244
245
246 # Standard cleaning and distclean rules.  These are not accepted
247 # on all systems though.
248 #
249 clean_freetype_std:
250         -$(DELETE) $(BASE_OBJECTS) $(OBJ_M) $(OBJ_S) $(CLEAN)
251
252 distclean_freetype_std: clean_freetype_std
253         -$(DELETE) $(FT_LIBRARY)
254         -$(DELETE) *.orig *~ core *.core $(DISTCLEAN)
255
256 # The Dos command shell does not support very long list of arguments, so
257 # we are stuck with wildcards.
258 #
259 clean_freetype_dos:
260         -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(OBJ_))*.$O $(CLEAN) 2> nul
261
262 distclean_freetype_dos: clean_freetype_dos
263         -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) $(DISTCLEAN) 2> nul
264
265 # Remove configuration file (used for distclean).
266 #
267 remove_config_mk:
268         -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(CONFIG_MK))
269
270
271 # The `config.mk' file must define `clean_freetype' and
272 # `distclean_freetype'.  Implementations may use to relay these to either
273 # the `std' or `dos' versions from above, or simply provide their own
274 # implementation.
275 #
276 clean: clean_freetype
277 distclean: distclean_freetype remove_config_mk
278
279 # EOF