Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / modules / freetype2 / builds / toplevel.mk
blob57b5ca56cde1694c106a0e53435879cba141a19a
2 # FreeType build system -- top-level sub-Makefile
6 # Copyright 1996-2000, 2001, 2003, 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 # This file is designed for GNU Make, do not use it with another Make tool!
18 # It works as follows:
20 # - When invoked for the first time, this Makefile includes the rules found
21 # in `PROJECT/builds/detect.mk'. They are in charge of detecting the
22 # current platform.
24 # A summary of the detection is displayed, and the file `config.mk' is
25 # created in the current directory.
27 # - When invoked later, this Makefile includes the rules found in
28 # `config.mk'. This sub-Makefile defines some system-specific variables
29 # (like compiler, compilation flags, object suffix, etc.), then includes
30 # the rules found in `PROJECT/builds/PROJECT.mk', used to build the
31 # library.
33 # See the comments in `builds/detect.mk' and `builds/PROJECT.mk' for more
34 # details on host platform detection and library builds.
37 .PHONY: all dist distclean modules setup
40 # The `space' variable is used to avoid trailing spaces in defining the
41 # `T' variable later.
43 empty :=
44 space := $(empty) $(empty)
47 # The main configuration file, defining the `XXX_MODULES' variables. We
48 # prefer a `modules.cfg' file in OBJ_DIR over TOP_DIR.
50 ifndef MODULES_CFG
51 MODULES_CFG := $(TOP_DIR)/modules.cfg
52 ifneq ($(wildcard $(OBJ_DIR)/modules.cfg),)
53 MODULES_CFG := $(OBJ_DIR)/modules.cfg
54 endif
55 endif
58 # FTMODULE_H, as its name suggests, indicates where the FreeType module
59 # class file resides.
61 FTMODULE_H ?= $(OBJ_DIR)/ftmodule.h
64 include $(MODULES_CFG)
67 # The list of modules we are using.
69 MODULES := $(FONT_MODULES) \
70 $(HINTING_MODULES) \
71 $(RASTER_MODULES) \
72 $(AUX_MODULES)
75 CONFIG_MK ?= config.mk
77 # If no configuration sub-makefile is present, or if `setup' is the target
78 # to be built, run the auto-detection rules to figure out which
79 # configuration rules file to use.
81 # Note that the configuration file is put in the current directory, which is
82 # not necessarily $(TOP_DIR).
84 # If `config.mk' is not present, set `check_platform'.
86 ifeq ($(wildcard $(CONFIG_MK)),)
87 check_platform := 1
88 endif
90 # If `setup' is one of the targets requested, set `check_platform'.
92 ifneq ($(findstring setup,$(MAKECMDGOALS)),)
93 check_platform := 1
94 endif
96 # Include the automatic host platform detection rules when we need to
97 # check the platform.
99 ifdef check_platform
101 all modules: setup
103 include $(TOP_DIR)/builds/detect.mk
105 # This rule makes sense for Unix only to remove files created by a run
106 # of the configure script which hasn't been successful (so that no
107 # `config.mk' has been created). It uses the built-in $(RM) command of
108 # GNU make. Similarly, `nul' is created if e.g. `make setup win32' has
109 # been erroneously used.
111 # Note: This test is duplicated in `builds/unix/detect.mk'.
113 is_unix := $(strip $(wildcard /sbin/init) \
114 $(wildcard /usr/sbin/init) \
115 $(wildcard /hurd/auth))
116 ifneq ($(is_unix),)
118 distclean:
119 $(RM) builds/unix/config.cache
120 $(RM) builds/unix/config.log
121 $(RM) builds/unix/config.status
122 $(RM) builds/unix/unix-def.mk
123 $(RM) builds/unix/unix-cc.mk
124 $(RM) builds/unix/freetype2.pc
125 $(RM) nul
127 endif # test is_unix
129 # IMPORTANT:
131 # `setup' must be defined by the host platform detection rules to create
132 # the `config.mk' file in the current directory.
134 else
136 # A configuration sub-Makefile is present -- simply run it.
138 all: single
140 BUILD_PROJECT := yes
141 include $(CONFIG_MK)
143 endif # test check_platform
146 # We always need the list of modules in ftmodule.h.
148 all setup: $(FTMODULE_H)
151 # The `modules' target unconditionally rebuilds the module list.
153 modules:
154 $(FTMODULE_H_INIT)
155 $(FTMODULE_H_CREATE)
156 $(FTMODULE_H_DONE)
158 include $(TOP_DIR)/builds/modules.mk
161 # This target builds the tarballs.
163 # Not to be run by a normal user -- there are no attempts to make it
164 # generic.
166 # we check for `dist', not `distclean'
167 ifneq ($(findstring distx,$(MAKECMDGOALS)x),)
168 FT_H := include/freetype/freetype.h
170 major := $(shell sed -n 's/.*FREETYPE_MAJOR.*\([0-9]\+\)/\1/p' < $(FT_H))
171 minor := $(shell sed -n 's/.*FREETYPE_MINOR.*\([0-9]\+\)/\1/p' < $(FT_H))
172 patch := $(shell sed -n 's/.*FREETYPE_PATCH.*\([0-9]\+\)/\1/p' < $(FT_H))
174 version := $(major).$(minor).$(patch)
175 winversion := $(major)$(minor)$(patch)
176 endif
178 dist:
179 -rm -rf tmp
180 rm -f freetype-$(version).tar.gz
181 rm -f freetype-$(version).tar.bz2
182 rm -f ft$(winversion).zip
184 for d in `find . -wholename '*/CVS' -prune \
185 -o -type f \
186 -o -print` ; do \
187 mkdir -p tmp/$$d ; \
188 done ;
190 currdir=`pwd` ; \
191 for f in `find . -wholename '*/CVS' -prune \
192 -o -name .cvsignore \
193 -o -type d \
194 -o -print` ; do \
195 ln -s $$currdir/$$f tmp/$$f ; \
196 done
198 @# Prevent generation of .pyc files. Python follows (soft) links if
199 @# the link's directory is write protected, so we have temporarily
200 @# disable write access here too.
201 chmod -w src/tools/docmaker
203 cd tmp ; \
204 $(MAKE) devel ; \
205 $(MAKE) do-dist
207 chmod +w src/tools/docmaker
209 mv tmp freetype-$(version)
211 tar cfh - freetype-$(version) \
212 | gzip -c > freetype-$(version).tar.gz
213 tar cfh - freetype-$(version) \
214 | bzip2 -c > freetype-$(version).tar.bz2
216 @# Use CR/LF for zip files.
217 zip -lr ft$(winversion).zip freetype-$(version)
219 rm -fr freetype-$(version)
222 # The locations of the latest `config.guess' and `config.sub' versions (from
223 # GNU `config' CVS), relative to the `tmp' directory used during `make dist'.
225 CONFIG_GUESS = ~/git/config/config.guess
226 CONFIG_SUB = ~/git/config/config.sub
229 # Don't say `make do-dist'. Always use `make dist' instead.
231 .PHONY: do-dist
233 do-dist: distclean refdoc
234 @# Without removing the files, `autoconf' and friends follow links.
235 rm -f builds/unix/aclocal.m4
236 rm -f builds/unix/configure.ac
237 rm -f builds/unix/configure
239 sh autogen.sh
240 rm -rf builds/unix/autom4te.cache
242 cp $(CONFIG_GUESS) builds/unix
243 cp $(CONFIG_SUB) builds/unix
245 # EOF