2
|
1 |
#
|
|
2 |
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
#
|
|
5 |
# This code is free software; you can redistribute it and/or modify it
|
|
6 |
# under the terms of the GNU General Public License version 2 only, as
|
|
7 |
# published by the Free Software Foundation. Sun designates this
|
|
8 |
# particular file as subject to the "Classpath" exception as provided
|
|
9 |
# by Sun in the LICENSE file that accompanied this code.
|
|
10 |
#
|
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that
|
|
15 |
# accompanied this code).
|
|
16 |
#
|
|
17 |
# You should have received a copy of the GNU General Public License version
|
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
20 |
#
|
|
21 |
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
|
22 |
# CA 95054 USA or visit www.sun.com if you need additional information or
|
|
23 |
# have any questions.
|
|
24 |
|
|
25 |
# Builds test program for freetype sanity check.
|
|
26 |
#
|
|
27 |
# Makefile should be called with following input parameters
|
|
28 |
# FT_TEST - full name of test program
|
|
29 |
# FT_HEADERS - path to freetype headers
|
|
30 |
# FT_LIB - location of directory with library
|
|
31 |
# XARCH - xarch option if required
|
|
32 |
|
|
33 |
BUILDDIR = ../..
|
|
34 |
include $(BUILDDIR)/common/Defs.gmk
|
|
35 |
|
|
36 |
#test program is expected in the TEMPDIR
|
|
37 |
FT_TEST_PATH = $(TEMPDIR)/$(FT_TEST)
|
|
38 |
|
|
39 |
all: $(FT_TEST_PATH)
|
|
40 |
|
|
41 |
FT_OPTIONS = -I$(FT_HEADERS) -I$(FT_HEADERS)/freetype2
|
|
42 |
FT_OPTIONS += $(XARCH)
|
|
43 |
|
|
44 |
#add runtime library search path
|
|
45 |
ifeq ($(PLATFORM), windows)
|
|
46 |
FREETYPE_LIB=$(FT_LIB)/freetype.lib
|
|
47 |
FREETYPE_DLL=$(FT_LIB)/freetype.dll
|
|
48 |
DFLAG=/D
|
|
49 |
else
|
|
50 |
FT_OPTIONS += -L$(FT_LIB)
|
|
51 |
DFLAG = -D
|
|
52 |
|
|
53 |
#add runtime lib search path to ensure test will be runnable
|
|
54 |
ifeq ($(PLATFORM), solaris)
|
|
55 |
FT_OPTIONS += -R $(FT_LIB) -lfreetype
|
|
56 |
else #linux
|
|
57 |
FT_OPTIONS += -Wl,-rpath -Wl,$(FT_LIB) -lfreetype
|
|
58 |
endif
|
|
59 |
endif
|
|
60 |
|
|
61 |
FT_OPTIONS += $(DFLAG)REQUIRED_FREETYPE_VERSION=$(REQUIRED_FREETYPE_VERSION)
|
|
62 |
|
|
63 |
# On windows we need to copy dll to test dir
|
|
64 |
# ti ensure it will be found in runtime
|
|
65 |
$(FT_TEST_PATH): freetypecheck.c
|
|
66 |
@$(CC) $(FT_OPTIONS) $(CC_PROGRAM_OUTPUT_FLAG)$@ $< $(FREETYPE_LIB) $(LFLAGS_$(COMPILER_VERSION))
|
|
67 |
ifeq ($(PLATFORM), windows)
|
|
68 |
@$(CP) $(FREETYPE_DLL) `dirname $@`
|
|
69 |
endif
|