Makefile revision 2362
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# This code is free software; you can redistribute it and/or modify it
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# under the terms of the GNU General Public License version 2 only, as
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# published by the Free Software Foundation. Oracle designates this
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# particular file as subject to the "Classpath" exception as provided
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# by Oracle in the LICENSE file that accompanied this code.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# This code is distributed in the hope that it will be useful, but WITHOUT
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# version 2 for more details (a copy is included in the LICENSE file that
5dbfd19ad5fcc2b779f40f80fa05c1bd28fd0b4eTheo Schlossnagle# accompanied this code).
2d08521bd15501c8370ba2153b9cca4f094979d0Garrett D'Amore#
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# You should have received a copy of the GNU General Public License version
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# 2 along with this work; if not, write to the Free Software Foundation,
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# or visit www.oracle.com if you need additional information or have any
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# questions.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Makefile for building all of font tools
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweBUILDDIR = ../..
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweMODULE = font
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LowePACKAGE = sun.font
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweLIBRARY = fontmanager
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LowePRODUCT = sun
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Indicate we want the C++ compiler to do the linking.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCPLUSPLUSLIBRARY=true
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Use higher optimization level
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweOPTIMIZATION_LEVEL = HIGHER
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinclude $(BUILDDIR)/common/Defs.gmk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Created without -z defs on linux
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweifeq ($(PLATFORM), linux)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe LDFLAGS_DEFS_OPTION =
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweendif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Files
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinclude FILES_c.gmk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweAUTO_FILES_JAVA_DIRS = sun/font
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweFILES_java += java/awt/Font.java java/text/Bidi.java
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweFILES_export = \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/font/SunLayoutEngine.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe java/awt/Font.java \
89b9271284be1a4e3e3053d7bc12f9bbf8145b06Robert Mustacchi java/text/Bidi.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/font/FileFont.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/font/FileFontStrike.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/font/FontManager.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/font/GlyphList.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/font/NativeFont.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/font/StrikeCache.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/font/NullFontScaler.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/font/FreetypeFontScaler.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/java2d/loops/DrawGlyphList.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/java2d/loops/DrawGlyphListAA.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/java2d/loops/DrawGlyphListLCD.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/java2d/loops/GraphicsPrimitive.java
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweifeq ($(PLATFORM), windows)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe LDLIBS += user32.lib gdi32.lib $(OBJDIR)/../../../sun.awt/awt/$(OBJDIRNAME)/awt.lib
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe OTHER_CFLAGS += -DCC_NOEX
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe OTHER_CXXFLAGS += -DCC_NOEX
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweelse # PLATFORM unix
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe FILES_export += \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/font/NativeStrike.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/font/NativeStrikeDisposer.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/font/X11TextRenderer.java \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe sun/awt/X11GraphicsEnvironment.java
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweendif # PLATFORM
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#In the non-OpenJDK mode we need to build T2K
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweifndef OPENJDK
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowet2k:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(ECHO) "lib=" $(ACTUAL_LIBRARY)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) -C t2k
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweall build: t2k
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowet2k: library
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweclean clobber::
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(MAKE) -C t2k clean
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweelse
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweFILES_m=mapfile-vers.openjdk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#make sure freetype dll will be available at runtime as well as link time
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#NB: Default freetype build system uses -h linker option and
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# result .so contains hardcoded library name that is later
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# used for adding dependencies to other objects
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# (e.g. libfontmanager.so).
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# It is not obvious how to extract that hardcoded name (libfreetype.so.6)
ce83b99835cc4643ab0fefd88dea62427d9ced5eRobert Mustacchi# without overcomplicating logic here.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# To workaround this we hardcode .6 suffix for now.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Note that .so.6 library will not be found by System.loadLibrary()
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# but fortunately we need to load FreeType library explicitly
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# on windows only
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#TODO: rework this to avoid hardcoding library name in the makefile
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweifeq ($(PLATFORM), windows)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe FREETYPE_LIB = $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe OTHER_LDLIBS += $(FREETYPE_LIB_PATH)/freetype.lib
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweelse
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ifeq ($(USING_SYSTEM_FT_LIB), false)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe FREETYPE_LIB = $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX).6
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe endif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe OTHER_LDLIBS += -L$(FREETYPE_LIB_PATH) -lfreetype
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweendif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowelibrary:: $(FREETYPE_LIB)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe$(FREETYPE_LIB):
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe $(install-module-file)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweendif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#ifeq ($(PLATFORM), solaris)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# FILES_reorder += reorder-$(ARCH)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#endif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinclude $(BUILDDIR)/common/Mapfile-vers.gmk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweinclude $(BUILDDIR)/common/Library.gmk
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe.PHONY: t2k build all clean clobber
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Add to the ambient vpath to pick up files in subdirectories
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowevpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowevpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)/layout
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowevpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Fontmanager is headless (independent of X/Motif)
296749875bd503e7a14e25b4c57d3142cb496df1Joshua M. Clulow#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCFLAGS += -DHEADLESS
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCXXFLAGS += -DHEADLESS
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweifndef OPENJDK
d2b9ba291ef0d1dc8807b6d46996674c723924d0Robert Mustacchi CPPFLAGS += -I$(CLOSED_SRC)/share/native/$(PKGDIR)/t2k
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweelse
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe CPPFLAGS += -I$(FREETYPE_HEADERS_PATH) -I$(FREETYPE_HEADERS_PATH)/freetype2
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweendif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweifeq ($(PLATFORM), windows)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowevpath %.cpp $(PLATFORM_SRC)/native/sun/windows
b65dd972486b1f5913d705d2a0cb9c3fb189a9e0Robert Mustacchielse # PLATFORM
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Libraries to link, and other C flags.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweifeq ($(PLATFORM), solaris)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe # Note that on Solaris, fontmanager is built against the headless library.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe LDFLAGS += -L$(LIBDIR)/$(LIBARCH)/headless
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe OTHER_LDLIBS += -lawt -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt -lc $(LIBM) $(LIBCXX)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweelse # PLATFORM is linux
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe OTHER_LDLIBS += -lawt $(LIBM) $(LIBCXX)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe ifeq ("$(CC_VER_MAJOR)", "3")
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe OTHER_LDLIBS += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe endif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweendif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweendif # PLATFORM
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# set up compile flags..
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR) \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe -I$(SHARE_SRC)/native/$(PKGDIR)/layout \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe -I$(SHARE_SRC)/native/sun/awt/image/cvutils \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe -I$(PLATFORM_SRC)/native/sun/awt \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe -I$(SHARE_SRC)/native/sun/awt/debug \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe -I$(SHARE_SRC)/native/sun/java2d/loops \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe -I$(SHARE_SRC)/native/sun/java2d/pipe \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe -I$(PLATFORM_SRC)/native/sun/java2d \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe -I$(SHARE_SRC)/native/sun/java2d \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe -I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweifeq ($(PLATFORM), windows)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCPPFLAGS += -I$(PLATFORM_SRC)/native/sun/windows
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweendif
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Make the Layout Engine build standalone
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCPPFLAGS += -DLE_STANDALONE
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe