1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/modules/freetype2/builds/toplevel.mk Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,258 @@ 1.4 +# 1.5 +# FreeType build system -- top-level sub-Makefile 1.6 +# 1.7 + 1.8 + 1.9 +# Copyright 1996-2001, 2003, 2006, 2008-2010, 2012-2014 by 1.10 +# David Turner, Robert Wilhelm, and Werner Lemberg. 1.11 +# 1.12 +# This file is part of the FreeType project, and may only be used, modified, 1.13 +# and distributed under the terms of the FreeType project license, 1.14 +# LICENSE.TXT. By continuing to use, modify, or distribute this file you 1.15 +# indicate that you have read the license and understand and accept it 1.16 +# fully. 1.17 + 1.18 + 1.19 +# This file is designed for GNU Make, do not use it with another Make tool! 1.20 +# 1.21 +# It works as follows: 1.22 +# 1.23 +# - When invoked for the first time, this Makefile includes the rules found 1.24 +# in `PROJECT/builds/detect.mk'. They are in charge of detecting the 1.25 +# current platform. 1.26 +# 1.27 +# A summary of the detection is displayed, and the file `config.mk' is 1.28 +# created in the current directory. 1.29 +# 1.30 +# - When invoked later, this Makefile includes the rules found in 1.31 +# `config.mk'. This sub-Makefile defines some system-specific variables 1.32 +# (like compiler, compilation flags, object suffix, etc.), then includes 1.33 +# the rules found in `PROJECT/builds/PROJECT.mk', used to build the 1.34 +# library. 1.35 +# 1.36 +# See the comments in `builds/detect.mk' and `builds/PROJECT.mk' for more 1.37 +# details on host platform detection and library builds. 1.38 + 1.39 + 1.40 +# First of all, check whether we have `$(value ...)'. We do this by testing 1.41 +# for `$(eval ...)' which has been introduced in the same GNU make version. 1.42 + 1.43 +eval_available := 1.44 +$(eval eval_available := T) 1.45 +ifneq ($(eval_available),T) 1.46 + $(error FreeType's build system needs a Make program which supports $$(value)) 1.47 +endif 1.48 + 1.49 + 1.50 +.PHONY: all dist distclean modules setup 1.51 + 1.52 + 1.53 +# The `space' variable is used to avoid trailing spaces in defining the 1.54 +# `T' variable later. 1.55 +# 1.56 +empty := 1.57 +space := $(empty) $(empty) 1.58 + 1.59 + 1.60 +# The main configuration file, defining the `XXX_MODULES' variables. We 1.61 +# prefer a `modules.cfg' file in OBJ_DIR over TOP_DIR. 1.62 +# 1.63 +ifndef MODULES_CFG 1.64 + MODULES_CFG := $(TOP_DIR)/modules.cfg 1.65 + ifneq ($(wildcard $(OBJ_DIR)/modules.cfg),) 1.66 + MODULES_CFG := $(OBJ_DIR)/modules.cfg 1.67 + endif 1.68 +endif 1.69 + 1.70 + 1.71 +# FTMODULE_H, as its name suggests, indicates where the FreeType module 1.72 +# class file resides. 1.73 +# 1.74 +FTMODULE_H ?= $(OBJ_DIR)/ftmodule.h 1.75 + 1.76 + 1.77 +include $(MODULES_CFG) 1.78 + 1.79 + 1.80 +# The list of modules we are using. 1.81 +# 1.82 +MODULES := $(FONT_MODULES) \ 1.83 + $(HINTING_MODULES) \ 1.84 + $(RASTER_MODULES) \ 1.85 + $(AUX_MODULES) 1.86 + 1.87 + 1.88 +CONFIG_MK ?= config.mk 1.89 + 1.90 +# If no configuration sub-makefile is present, or if `setup' is the target 1.91 +# to be built, run the auto-detection rules to figure out which 1.92 +# configuration rules file to use. 1.93 +# 1.94 +# Note that the configuration file is put in the current directory, which is 1.95 +# not necessarily $(TOP_DIR). 1.96 + 1.97 +# If `config.mk' is not present, set `check_platform'. 1.98 +# 1.99 +ifeq ($(wildcard $(CONFIG_MK)),) 1.100 + check_platform := 1 1.101 +endif 1.102 + 1.103 +# If `setup' is one of the targets requested, set `check_platform'. 1.104 +# 1.105 +ifneq ($(findstring setup,$(MAKECMDGOALS)),) 1.106 + check_platform := 1 1.107 +endif 1.108 + 1.109 +# Include the automatic host platform detection rules when we need to 1.110 +# check the platform. 1.111 +# 1.112 +ifdef check_platform 1.113 + 1.114 + all modules: setup 1.115 + 1.116 + include $(TOP_DIR)/builds/detect.mk 1.117 + 1.118 + # This rule makes sense for Unix only to remove files created by a run of 1.119 + # the configure script which hasn't been successful (so that no 1.120 + # `config.mk' has been created). It uses the built-in $(RM) command of 1.121 + # GNU make. Similarly, `nul' is created if e.g. `make setup windows' has 1.122 + # been erroneously used. 1.123 + # 1.124 + # Note: This test is duplicated in `builds/unix/detect.mk'. 1.125 + # 1.126 + is_unix := $(strip $(wildcard /sbin/init) \ 1.127 + $(wildcard /usr/sbin/init) \ 1.128 + $(wildcard /dev/null) \ 1.129 + $(wildcard /hurd/auth)) 1.130 + ifneq ($(is_unix),) 1.131 + 1.132 + distclean: 1.133 + $(RM) builds/unix/config.cache 1.134 + $(RM) builds/unix/config.log 1.135 + $(RM) builds/unix/config.status 1.136 + $(RM) builds/unix/unix-def.mk 1.137 + $(RM) builds/unix/unix-cc.mk 1.138 + $(RM) builds/unix/freetype2.pc 1.139 + $(RM) nul 1.140 + 1.141 + endif # test is_unix 1.142 + 1.143 + # IMPORTANT: 1.144 + # 1.145 + # `setup' must be defined by the host platform detection rules to create 1.146 + # the `config.mk' file in the current directory. 1.147 + 1.148 +else 1.149 + 1.150 + # A configuration sub-Makefile is present -- simply run it. 1.151 + # 1.152 + all: single 1.153 + 1.154 + BUILD_PROJECT := yes 1.155 + include $(CONFIG_MK) 1.156 + 1.157 +endif # test check_platform 1.158 + 1.159 + 1.160 +# We always need the list of modules in ftmodule.h. 1.161 +# 1.162 +all setup: $(FTMODULE_H) 1.163 + 1.164 + 1.165 +# The `modules' target unconditionally rebuilds the module list. 1.166 +# 1.167 +modules: 1.168 + $(FTMODULE_H_INIT) 1.169 + $(FTMODULE_H_CREATE) 1.170 + $(FTMODULE_H_DONE) 1.171 + 1.172 +include $(TOP_DIR)/builds/modules.mk 1.173 + 1.174 + 1.175 +# This target builds the tarballs. 1.176 +# 1.177 +# Not to be run by a normal user -- there are no attempts to make it 1.178 +# generic. 1.179 + 1.180 +# we check for `dist', not `distclean' 1.181 +ifneq ($(findstring distx,$(MAKECMDGOALS)x),) 1.182 + FT_H := include/freetype.h 1.183 + 1.184 + major := $(shell sed -n 's/.*FREETYPE_MAJOR[^0-9]*\([0-9]\+\)/\1/p' < $(FT_H)) 1.185 + minor := $(shell sed -n 's/.*FREETYPE_MINOR[^0-9]*\([0-9]\+\)/\1/p' < $(FT_H)) 1.186 + patch := $(shell sed -n 's/.*FREETYPE_PATCH[^0-9]*\([0-9]\+\)/\1/p' < $(FT_H)) 1.187 + 1.188 + version := $(major).$(minor).$(patch) 1.189 + winversion := $(major)$(minor)$(patch) 1.190 +endif 1.191 + 1.192 +dist: 1.193 + -rm -rf tmp 1.194 + rm -f freetype-$(version).tar.gz 1.195 + rm -f freetype-$(version).tar.bz2 1.196 + rm -f ft$(winversion).zip 1.197 + 1.198 + for d in `find . -wholename '*/.git' -prune \ 1.199 + -o -type f \ 1.200 + -o -print` ; do \ 1.201 + mkdir -p tmp/$$d ; \ 1.202 + done ; 1.203 + 1.204 + currdir=`pwd` ; \ 1.205 + for f in `find . -wholename '*/.git' -prune \ 1.206 + -o -name .gitignore \ 1.207 + -o -name .mailmap \ 1.208 + -o -type d \ 1.209 + -o -print` ; do \ 1.210 + ln -s $$currdir/$$f tmp/$$f ; \ 1.211 + done 1.212 + 1.213 + @# Prevent generation of .pyc files. Python follows (soft) links if 1.214 + @# the link's directory is write protected, so we have temporarily 1.215 + @# disable write access here too. 1.216 + chmod -w src/tools/docmaker 1.217 + 1.218 + cd tmp ; \ 1.219 + $(MAKE) devel ; \ 1.220 + $(MAKE) do-dist 1.221 + 1.222 + chmod +w src/tools/docmaker 1.223 + 1.224 + mv tmp freetype-$(version) 1.225 + 1.226 + tar cfh - freetype-$(version) \ 1.227 + | gzip -9 -c > freetype-$(version).tar.gz 1.228 + tar cfh - freetype-$(version) \ 1.229 + | bzip2 -c > freetype-$(version).tar.bz2 1.230 + 1.231 + @# Use CR/LF for zip files. 1.232 + zip -lr9 ft$(winversion).zip freetype-$(version) 1.233 + 1.234 + rm -fr freetype-$(version) 1.235 + 1.236 + 1.237 +# The locations of the latest `config.guess' and `config.sub' versions (from 1.238 +# GNU `config' git repository), relative to the `tmp' directory used during 1.239 +# `make dist'. 1.240 +# 1.241 +CONFIG_GUESS = ~/git/config/config.guess 1.242 +CONFIG_SUB = ~/git/config/config.sub 1.243 + 1.244 + 1.245 +# Don't say `make do-dist'. Always use `make dist' instead. 1.246 +# 1.247 +.PHONY: do-dist 1.248 + 1.249 +do-dist: distclean refdoc 1.250 + @# Without removing the files, `autoconf' and friends follow links. 1.251 + rm -f builds/unix/aclocal.m4 1.252 + rm -f builds/unix/configure.ac 1.253 + rm -f builds/unix/configure 1.254 + 1.255 + sh autogen.sh 1.256 + rm -rf builds/unix/autom4te.cache 1.257 + 1.258 + cp $(CONFIG_GUESS) builds/unix 1.259 + cp $(CONFIG_SUB) builds/unix 1.260 + 1.261 +# EOF