Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | # |
michael@0 | 2 | # FreeType build system -- top-level sub-Makefile |
michael@0 | 3 | # |
michael@0 | 4 | |
michael@0 | 5 | |
michael@0 | 6 | # Copyright 1996-2001, 2003, 2006, 2008-2010, 2012-2014 by |
michael@0 | 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. |
michael@0 | 8 | # |
michael@0 | 9 | # This file is part of the FreeType project, and may only be used, modified, |
michael@0 | 10 | # and distributed under the terms of the FreeType project license, |
michael@0 | 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you |
michael@0 | 12 | # indicate that you have read the license and understand and accept it |
michael@0 | 13 | # fully. |
michael@0 | 14 | |
michael@0 | 15 | |
michael@0 | 16 | # This file is designed for GNU Make, do not use it with another Make tool! |
michael@0 | 17 | # |
michael@0 | 18 | # It works as follows: |
michael@0 | 19 | # |
michael@0 | 20 | # - When invoked for the first time, this Makefile includes the rules found |
michael@0 | 21 | # in `PROJECT/builds/detect.mk'. They are in charge of detecting the |
michael@0 | 22 | # current platform. |
michael@0 | 23 | # |
michael@0 | 24 | # A summary of the detection is displayed, and the file `config.mk' is |
michael@0 | 25 | # created in the current directory. |
michael@0 | 26 | # |
michael@0 | 27 | # - When invoked later, this Makefile includes the rules found in |
michael@0 | 28 | # `config.mk'. This sub-Makefile defines some system-specific variables |
michael@0 | 29 | # (like compiler, compilation flags, object suffix, etc.), then includes |
michael@0 | 30 | # the rules found in `PROJECT/builds/PROJECT.mk', used to build the |
michael@0 | 31 | # library. |
michael@0 | 32 | # |
michael@0 | 33 | # See the comments in `builds/detect.mk' and `builds/PROJECT.mk' for more |
michael@0 | 34 | # details on host platform detection and library builds. |
michael@0 | 35 | |
michael@0 | 36 | |
michael@0 | 37 | # First of all, check whether we have `$(value ...)'. We do this by testing |
michael@0 | 38 | # for `$(eval ...)' which has been introduced in the same GNU make version. |
michael@0 | 39 | |
michael@0 | 40 | eval_available := |
michael@0 | 41 | $(eval eval_available := T) |
michael@0 | 42 | ifneq ($(eval_available),T) |
michael@0 | 43 | $(error FreeType's build system needs a Make program which supports $$(value)) |
michael@0 | 44 | endif |
michael@0 | 45 | |
michael@0 | 46 | |
michael@0 | 47 | .PHONY: all dist distclean modules setup |
michael@0 | 48 | |
michael@0 | 49 | |
michael@0 | 50 | # The `space' variable is used to avoid trailing spaces in defining the |
michael@0 | 51 | # `T' variable later. |
michael@0 | 52 | # |
michael@0 | 53 | empty := |
michael@0 | 54 | space := $(empty) $(empty) |
michael@0 | 55 | |
michael@0 | 56 | |
michael@0 | 57 | # The main configuration file, defining the `XXX_MODULES' variables. We |
michael@0 | 58 | # prefer a `modules.cfg' file in OBJ_DIR over TOP_DIR. |
michael@0 | 59 | # |
michael@0 | 60 | ifndef MODULES_CFG |
michael@0 | 61 | MODULES_CFG := $(TOP_DIR)/modules.cfg |
michael@0 | 62 | ifneq ($(wildcard $(OBJ_DIR)/modules.cfg),) |
michael@0 | 63 | MODULES_CFG := $(OBJ_DIR)/modules.cfg |
michael@0 | 64 | endif |
michael@0 | 65 | endif |
michael@0 | 66 | |
michael@0 | 67 | |
michael@0 | 68 | # FTMODULE_H, as its name suggests, indicates where the FreeType module |
michael@0 | 69 | # class file resides. |
michael@0 | 70 | # |
michael@0 | 71 | FTMODULE_H ?= $(OBJ_DIR)/ftmodule.h |
michael@0 | 72 | |
michael@0 | 73 | |
michael@0 | 74 | include $(MODULES_CFG) |
michael@0 | 75 | |
michael@0 | 76 | |
michael@0 | 77 | # The list of modules we are using. |
michael@0 | 78 | # |
michael@0 | 79 | MODULES := $(FONT_MODULES) \ |
michael@0 | 80 | $(HINTING_MODULES) \ |
michael@0 | 81 | $(RASTER_MODULES) \ |
michael@0 | 82 | $(AUX_MODULES) |
michael@0 | 83 | |
michael@0 | 84 | |
michael@0 | 85 | CONFIG_MK ?= config.mk |
michael@0 | 86 | |
michael@0 | 87 | # If no configuration sub-makefile is present, or if `setup' is the target |
michael@0 | 88 | # to be built, run the auto-detection rules to figure out which |
michael@0 | 89 | # configuration rules file to use. |
michael@0 | 90 | # |
michael@0 | 91 | # Note that the configuration file is put in the current directory, which is |
michael@0 | 92 | # not necessarily $(TOP_DIR). |
michael@0 | 93 | |
michael@0 | 94 | # If `config.mk' is not present, set `check_platform'. |
michael@0 | 95 | # |
michael@0 | 96 | ifeq ($(wildcard $(CONFIG_MK)),) |
michael@0 | 97 | check_platform := 1 |
michael@0 | 98 | endif |
michael@0 | 99 | |
michael@0 | 100 | # If `setup' is one of the targets requested, set `check_platform'. |
michael@0 | 101 | # |
michael@0 | 102 | ifneq ($(findstring setup,$(MAKECMDGOALS)),) |
michael@0 | 103 | check_platform := 1 |
michael@0 | 104 | endif |
michael@0 | 105 | |
michael@0 | 106 | # Include the automatic host platform detection rules when we need to |
michael@0 | 107 | # check the platform. |
michael@0 | 108 | # |
michael@0 | 109 | ifdef check_platform |
michael@0 | 110 | |
michael@0 | 111 | all modules: setup |
michael@0 | 112 | |
michael@0 | 113 | include $(TOP_DIR)/builds/detect.mk |
michael@0 | 114 | |
michael@0 | 115 | # This rule makes sense for Unix only to remove files created by a run of |
michael@0 | 116 | # the configure script which hasn't been successful (so that no |
michael@0 | 117 | # `config.mk' has been created). It uses the built-in $(RM) command of |
michael@0 | 118 | # GNU make. Similarly, `nul' is created if e.g. `make setup windows' has |
michael@0 | 119 | # been erroneously used. |
michael@0 | 120 | # |
michael@0 | 121 | # Note: This test is duplicated in `builds/unix/detect.mk'. |
michael@0 | 122 | # |
michael@0 | 123 | is_unix := $(strip $(wildcard /sbin/init) \ |
michael@0 | 124 | $(wildcard /usr/sbin/init) \ |
michael@0 | 125 | $(wildcard /dev/null) \ |
michael@0 | 126 | $(wildcard /hurd/auth)) |
michael@0 | 127 | ifneq ($(is_unix),) |
michael@0 | 128 | |
michael@0 | 129 | distclean: |
michael@0 | 130 | $(RM) builds/unix/config.cache |
michael@0 | 131 | $(RM) builds/unix/config.log |
michael@0 | 132 | $(RM) builds/unix/config.status |
michael@0 | 133 | $(RM) builds/unix/unix-def.mk |
michael@0 | 134 | $(RM) builds/unix/unix-cc.mk |
michael@0 | 135 | $(RM) builds/unix/freetype2.pc |
michael@0 | 136 | $(RM) nul |
michael@0 | 137 | |
michael@0 | 138 | endif # test is_unix |
michael@0 | 139 | |
michael@0 | 140 | # IMPORTANT: |
michael@0 | 141 | # |
michael@0 | 142 | # `setup' must be defined by the host platform detection rules to create |
michael@0 | 143 | # the `config.mk' file in the current directory. |
michael@0 | 144 | |
michael@0 | 145 | else |
michael@0 | 146 | |
michael@0 | 147 | # A configuration sub-Makefile is present -- simply run it. |
michael@0 | 148 | # |
michael@0 | 149 | all: single |
michael@0 | 150 | |
michael@0 | 151 | BUILD_PROJECT := yes |
michael@0 | 152 | include $(CONFIG_MK) |
michael@0 | 153 | |
michael@0 | 154 | endif # test check_platform |
michael@0 | 155 | |
michael@0 | 156 | |
michael@0 | 157 | # We always need the list of modules in ftmodule.h. |
michael@0 | 158 | # |
michael@0 | 159 | all setup: $(FTMODULE_H) |
michael@0 | 160 | |
michael@0 | 161 | |
michael@0 | 162 | # The `modules' target unconditionally rebuilds the module list. |
michael@0 | 163 | # |
michael@0 | 164 | modules: |
michael@0 | 165 | $(FTMODULE_H_INIT) |
michael@0 | 166 | $(FTMODULE_H_CREATE) |
michael@0 | 167 | $(FTMODULE_H_DONE) |
michael@0 | 168 | |
michael@0 | 169 | include $(TOP_DIR)/builds/modules.mk |
michael@0 | 170 | |
michael@0 | 171 | |
michael@0 | 172 | # This target builds the tarballs. |
michael@0 | 173 | # |
michael@0 | 174 | # Not to be run by a normal user -- there are no attempts to make it |
michael@0 | 175 | # generic. |
michael@0 | 176 | |
michael@0 | 177 | # we check for `dist', not `distclean' |
michael@0 | 178 | ifneq ($(findstring distx,$(MAKECMDGOALS)x),) |
michael@0 | 179 | FT_H := include/freetype.h |
michael@0 | 180 | |
michael@0 | 181 | major := $(shell sed -n 's/.*FREETYPE_MAJOR[^0-9]*\([0-9]\+\)/\1/p' < $(FT_H)) |
michael@0 | 182 | minor := $(shell sed -n 's/.*FREETYPE_MINOR[^0-9]*\([0-9]\+\)/\1/p' < $(FT_H)) |
michael@0 | 183 | patch := $(shell sed -n 's/.*FREETYPE_PATCH[^0-9]*\([0-9]\+\)/\1/p' < $(FT_H)) |
michael@0 | 184 | |
michael@0 | 185 | version := $(major).$(minor).$(patch) |
michael@0 | 186 | winversion := $(major)$(minor)$(patch) |
michael@0 | 187 | endif |
michael@0 | 188 | |
michael@0 | 189 | dist: |
michael@0 | 190 | -rm -rf tmp |
michael@0 | 191 | rm -f freetype-$(version).tar.gz |
michael@0 | 192 | rm -f freetype-$(version).tar.bz2 |
michael@0 | 193 | rm -f ft$(winversion).zip |
michael@0 | 194 | |
michael@0 | 195 | for d in `find . -wholename '*/.git' -prune \ |
michael@0 | 196 | -o -type f \ |
michael@0 | 197 | -o -print` ; do \ |
michael@0 | 198 | mkdir -p tmp/$$d ; \ |
michael@0 | 199 | done ; |
michael@0 | 200 | |
michael@0 | 201 | currdir=`pwd` ; \ |
michael@0 | 202 | for f in `find . -wholename '*/.git' -prune \ |
michael@0 | 203 | -o -name .gitignore \ |
michael@0 | 204 | -o -name .mailmap \ |
michael@0 | 205 | -o -type d \ |
michael@0 | 206 | -o -print` ; do \ |
michael@0 | 207 | ln -s $$currdir/$$f tmp/$$f ; \ |
michael@0 | 208 | done |
michael@0 | 209 | |
michael@0 | 210 | @# Prevent generation of .pyc files. Python follows (soft) links if |
michael@0 | 211 | @# the link's directory is write protected, so we have temporarily |
michael@0 | 212 | @# disable write access here too. |
michael@0 | 213 | chmod -w src/tools/docmaker |
michael@0 | 214 | |
michael@0 | 215 | cd tmp ; \ |
michael@0 | 216 | $(MAKE) devel ; \ |
michael@0 | 217 | $(MAKE) do-dist |
michael@0 | 218 | |
michael@0 | 219 | chmod +w src/tools/docmaker |
michael@0 | 220 | |
michael@0 | 221 | mv tmp freetype-$(version) |
michael@0 | 222 | |
michael@0 | 223 | tar cfh - freetype-$(version) \ |
michael@0 | 224 | | gzip -9 -c > freetype-$(version).tar.gz |
michael@0 | 225 | tar cfh - freetype-$(version) \ |
michael@0 | 226 | | bzip2 -c > freetype-$(version).tar.bz2 |
michael@0 | 227 | |
michael@0 | 228 | @# Use CR/LF for zip files. |
michael@0 | 229 | zip -lr9 ft$(winversion).zip freetype-$(version) |
michael@0 | 230 | |
michael@0 | 231 | rm -fr freetype-$(version) |
michael@0 | 232 | |
michael@0 | 233 | |
michael@0 | 234 | # The locations of the latest `config.guess' and `config.sub' versions (from |
michael@0 | 235 | # GNU `config' git repository), relative to the `tmp' directory used during |
michael@0 | 236 | # `make dist'. |
michael@0 | 237 | # |
michael@0 | 238 | CONFIG_GUESS = ~/git/config/config.guess |
michael@0 | 239 | CONFIG_SUB = ~/git/config/config.sub |
michael@0 | 240 | |
michael@0 | 241 | |
michael@0 | 242 | # Don't say `make do-dist'. Always use `make dist' instead. |
michael@0 | 243 | # |
michael@0 | 244 | .PHONY: do-dist |
michael@0 | 245 | |
michael@0 | 246 | do-dist: distclean refdoc |
michael@0 | 247 | @# Without removing the files, `autoconf' and friends follow links. |
michael@0 | 248 | rm -f builds/unix/aclocal.m4 |
michael@0 | 249 | rm -f builds/unix/configure.ac |
michael@0 | 250 | rm -f builds/unix/configure |
michael@0 | 251 | |
michael@0 | 252 | sh autogen.sh |
michael@0 | 253 | rm -rf builds/unix/autom4te.cache |
michael@0 | 254 | |
michael@0 | 255 | cp $(CONFIG_GUESS) builds/unix |
michael@0 | 256 | cp $(CONFIG_SUB) builds/unix |
michael@0 | 257 | |
michael@0 | 258 | # EOF |