Makefile revision 2370
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved.
a908d41cb4b0658c958383375c5a8f0bcaaf843dFrancis Dupont# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This code is free software; you can redistribute it and/or modify it
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# under the terms of the GNU General Public License version 2 only, as
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# published by the Free Software Foundation. Sun designates this
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# particular file as subject to the "Classpath" exception as provided
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# by Sun in the LICENSE file that accompanied this code.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# This code is distributed in the hope that it will be useful, but WITHOUT
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# version 2 for more details (a copy is included in the LICENSE file that
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# accompanied this code).
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt# You should have received a copy of the GNU General Public License version
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# 2 along with this work; if not, write to the Free Software Foundation,
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# CA 95054 USA or visit www.sun.com if you need additional information or
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# have any questions.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark AndrewsCLASSES_INIT += $(TEMPDIR)/.gen.wrappers $(TEMPDIR)/.gen_icons touch.wrappers
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# For Xrender extension.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark AndrewsLDFLAGS += -L/usr/openwin/sfw/lib$(ISA_DIR) -R/usr/openwin/sfw/lib$(ISA_DIR)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# Since this library will be living in a subdirectory below the other libraries
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# we need to add an extra runpath so that libraries in the upper directory
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# are found at runtime.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# Add to the ambient vpath to pick up files in subdirectories
9f5443280fcfd625a06f63a1b457ed2335840278Mark Andrewsvpath %.c $(SHARE_SRC)/native/sunawt/alphacomposite
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewsvpath %.c $(SHARE_SRC)/native/sun/awt/image/cvutils
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewsvpath %.c $(PLATFORM_SRC)/native/sun/awt/robot_child
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewsvpath %.c $(PLATFORM_SRC)/native/sun/java2d/opengl
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark AndrewsOTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -lXrender -ldl \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(LDFLAGS_COMMON) $(AWT_RUNPATH) $(OTHER_LDFLAGS) -lXtst -lXi
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# Allows for builds on Debian GNU Linux, X11 is in a different place
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews CPPFLAGS += -I/usr/X11R6/include/X11/extensions \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# Generation of wrappers
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# On sparcv9 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# On sparcv9 CFLAGS already contain $(XARCH_OPTION/64), so to generate 32-bit sizer we need to change this option.
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan HuntCFLAGS_32=$(subst $(XARCH_OPTION/64),$(XARCH_OPTION/32),$(CFLAGS))
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan HuntSIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt# On amd64 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt# On amd64 CFLAGS already contain $(XARCH_OPTION/64), so to generate 32-bit sizer we need to change this option.
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan HuntCFLAGS_32=$(subst $(XARCH_OPTION/64),$(XARCH_OPTION/32),$(CFLAGS))
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark AndrewsSIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewselse # !sparcv9 : includes (32-bit) sparc, i586
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrewselse # !solaris
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# XXX Hack for 6185483 - use hard-coded sizes.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# Add the 64-bit platforms that need to be included into 32-bit build
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# and have sizes.64-$(PLATFORM)-$(LIBARCH) hardcoded in the workspace
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# If you define DOHACK=true for some combination of $(PLATFORM)-$(LIBARCH),
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# make sure you have sizes.64-$(PLATFORM)-$(LIBARCH) pre-generated in
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# $(PLATFORM_SRC)/classes/sun/awt/X11/generator/
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark AndrewsPREDEFINED_SIZES_TMPL=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/sizes.64-$(PLATFORM)-$(LIBARCH)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark AndrewsPREDEFINED_SIZES=$(WRAPPER_GENERATOR_DIR)/sizes.64
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# 64 bit sizers are generated on platform-libarch (left) for use
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# on platform-libarch (right) and stored under the latter name.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# Do compare manually stored and automatically generated pair(s)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews# if DOCOMPARE=true, just after the generation.
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark AndrewsSTORED_SIZES_TMPL_solaris_amd64=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/sizes.64-solaris-i386
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark AndrewsWRAPPER_GENERATOR_JAVA=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/WrapperGenerator.java
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark AndrewsWRAPPER_GENERATOR_DIR=$(GENSRCDIR)/sun/awt/X11/generator
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark AndrewsWRAPPER_GENERATOR_TEMPDIR=$(TEMPDIR)/sun/awt/X11/generator
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark AndrewsWRAPPER_GENERATOR_CLASS=$(WRAPPER_GENERATOR_TEMPDIR)/WrapperGenerator.class
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark AndrewsXLIBTYPES=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/xlibtypes.txt
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews$(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA)
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt $(BOOT_JAVAC_CMD) -d $(WRAPPER_GENERATOR_TEMPDIR) $(WRAPPER_GENERATOR_JAVA)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews$(SIZERS_C): $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(SIZER_DIR) $(XLIBTYPES) "sizer" $(subst .,,$(suffix $(basename $@)))
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews @if [ "$(DOHACK)$@" = "true$(PREDEFINED_SIZES)" ]; then \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(ECHO) COPYING $(PREDEFINED_SIZES_TMPL) into $@; \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(WRAPPER_GENERATOR_DIR)/sizer$(suffix $@) > $@; \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews @if [ "$(DOCOMPARE)$(suffix $@)" = "true.64" ]; then \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(ECHO) COMPARING $@ and $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(DIFF) $@ $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews$(TEMPDIR)/.gen.wrappers: $(SIZES) $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(GEN_DIR) $(XLIBTYPES) "gen" $(WRAPPER_GENERATOR_DIR)/sizes
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews$(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class: ToBin.java
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews$(TEMPDIR)/.gen_icons: $(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class $(ICONS)
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews name=`$(ECHO) $$filename | $(TR) '\-.' '__'`; \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(ECHO) "public class XAWTIcon32_$$name {" >> $$classname; \
c3c8823fed039b3a2b8e5ca8bc2f3301d1dd840eMark Andrews $(ECHO) "public static int[] $$name = { " >> $$classname; \
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt $(ECHO) "public class XAWTIcon64_$$name {" >> $$classname; \
98922b2b2b024dcca25be7c220cf3b16b1e6c4b5Evan Hunt $(ECHO) "public static long[] $$name = { " >> $$classname; \