Makefile revision 3261
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# This code is free software; you can redistribute it and/or modify it
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# under the terms of the GNU General Public License version 2 only, as
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# published by the Free Software Foundation. Oracle designates this
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# particular file as subject to the "Classpath" exception as provided
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# by Oracle in the LICENSE file that accompanied this code.
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# This code is distributed in the hope that it will be useful, but WITHOUT
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# version 2 for more details (a copy is included in the LICENSE file that
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# accompanied this code).
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# You should have received a copy of the GNU General Public License version
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# 2 along with this work; if not, write to the Free Software Foundation,
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# or visit www.oracle.com if you need additional information or have any
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonCLASSES_INIT += $(TEMPDIR)/.gen.wrappers $(TEMPDIR)/.gen_icons touch.wrappers
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# For Xrender extension.
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonLDFLAGS += -L/usr/openwin/sfw/lib$(ISA_DIR) -R/usr/openwin/sfw/lib$(ISA_DIR)
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssondummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# Since this library will be living in a subdirectory below the other libraries
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# we need to add an extra runpath so that libraries in the upper directory
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# are found at runtime.
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssoninclude $(BUILDDIR)/common/Mapfile-vers.gmk
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# Add to the ambient vpath to pick up files in subdirectories
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonvpath %.c $(SHARE_SRC)/native/sunawt/alphacomposite
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonvpath %.c $(SHARE_SRC)/native/sun/awt/debug
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonvpath %.c $(SHARE_SRC)/native/sun/awt/image
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonvpath %.c $(SHARE_SRC)/native/sun/awt/image/gif
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonvpath %.c $(SHARE_SRC)/native/sun/awt/image/cvutils
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonvpath %.c $(SHARE_SRC)/native/sun/awt/shell
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonvpath %.c $(SHARE_SRC)/native/sun/java2d/loops
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonvpath %.c $(SHARE_SRC)/native/sun/java2d/pipe
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonvpath %.c $(SHARE_SRC)/native/sun/awt/medialib
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonvpath %.c $(SHARE_SRC)/native/sun/awt/utility
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonvpath %.c $(PLATFORM_SRC)/native/sun/awt/robot_child
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonvpath %.c $(SHARE_SRC)/native/sun/java2d/opengl
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonvpath %.c $(PLATFORM_SRC)/native/sun/java2d/opengl
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonvpath %.c $(PLATFORM_SRC)/native/sun/java2d/x11
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonOTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -lXrender -ldl \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(LDFLAGS_COMMON) $(AWT_RUNPATH) $(OTHER_LDFLAGS) -lXtst -lXi
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssondummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson -I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson -I$(SHARE_SRC)/native/sun/awt/image/cvutils \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson -I$(SHARE_SRC)/native/sun/awt/image/cvutils \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson -I$(SHARE_SRC)/native/sun/java2d/opengl \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson -I$(PLATFORM_SRC)/native/sun/java2d/opengl \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson -I$(PLATFORM_SRC)/native/sun/java2d/x11 \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson -I$(SHARE_SRC)/native/sun/awt/alphacomposite \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson -I$(PLATFORM_SRC)/native/sun/awt/medialib \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# Allows for builds on Debian GNU Linux, X11 is in a different place
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson CPPFLAGS += -I/usr/X11R6/include/X11/extensions \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# Generation of wrappers
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonifneq (,$(findstring sparcv9, $(isalist)))
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# On sparcv9 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# On sparcv9 CFLAGS already contain $(XARCH_OPTION/64), so to generate 32-bit sizer we need to change this option.
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonCFLAGS_32=$(subst $(XARCH_OPTION/64),$(XARCH_OPTION/32),$(CFLAGS))
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonSIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# On amd64 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# On amd64 CFLAGS already contain $(XARCH_OPTION/64), so to generate 32-bit sizer we need to change this option.
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonCFLAGS_32=$(subst $(XARCH_OPTION/64),$(XARCH_OPTION/32),$(CFLAGS))
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonSIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonelse # !sparcv9 : includes (32-bit) sparc, i586
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonelse # !solaris
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# XXX Hack for 6185483 - use hard-coded sizes.
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# Add the 64-bit platforms that need to be included into 32-bit build
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# and have sizes.64-$(PLATFORM)-$(LIBARCH) hardcoded in the workspace
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonifeq ($(PLATFORM)-$(LIBARCH), solaris-i386)
41a0c85888807051d146da9449580bbf0fe150b0Andreas Gustafsson# If you define DOHACK=true for some combination of $(PLATFORM)-$(LIBARCH),
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# make sure you have sizes.64-$(PLATFORM)-$(LIBARCH) pre-generated in
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# $(PLATFORM_SRC)/classes/sun/awt/X11/generator/
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonPREDEFINED_SIZES_TMPL=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/sizes.64-$(PLATFORM)-$(LIBARCH)
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonPREDEFINED_SIZES=$(WRAPPER_GENERATOR_DIR)/sizes.64
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonSIZES += $(WRAPPER_GENERATOR_DIR)/sizes.64
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafssonifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# 64 bit sizers are generated on platform-libarch (left) for use
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# on platform-libarch (right) and stored under the latter name.
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# Do compare manually stored and automatically generated pair(s)
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# if DOCOMPARE=true, just after the generation.
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonSTORED_SIZES_TMPL_solaris_amd64=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/sizes.64-solaris-i386
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonWRAPPER_GENERATOR_JAVA=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/WrapperGenerator.java
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonWRAPPER_GENERATOR_DIR=$(GENSRCDIR)/sun/awt/X11/generator
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonWRAPPER_GENERATOR_TEMPDIR=$(TEMPDIR)/sun/awt/X11/generator
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonWRAPPER_GENERATOR_CLASS=$(WRAPPER_GENERATOR_TEMPDIR)/WrapperGenerator.class
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonXLIBTYPES=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/xlibtypes.txt
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson$(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA)
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(BOOT_JAVAC_CMD) -d $(WRAPPER_GENERATOR_TEMPDIR) $(WRAPPER_GENERATOR_JAVA)
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson$(SIZERS_C): $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES)
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(SIZER_DIR) $(XLIBTYPES) "sizer" $(subst .,,$(suffix $(basename $@)))
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson @if [ "$(DOHACK)$@" = "true$(PREDEFINED_SIZES)" ]; then \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ECHO) COPYING $(PREDEFINED_SIZES_TMPL) into $@; \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(WRAPPER_GENERATOR_DIR)/sizer$(suffix $@) > $@; \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson @if [ "$(DOCOMPARE)$(suffix $@)" = "true.64" ]; then \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ECHO) COMPARING $@ and $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(DIFF) $@ $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson$(TEMPDIR)/.gen.wrappers: $(SIZES) $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES)
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(GEN_DIR) $(XLIBTYPES) "gen" $(WRAPPER_GENERATOR_DIR)/sizes
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
fb84f9014321c5f33c4682de5661b579fcde318fAndreas GustafssonICONPATH=$(PLATFORM_SRC)/classes/sun/awt/X11
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ICONPATH)/security-icon-interim16.png \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ICONPATH)/security-icon-interim24.png \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ICONPATH)/security-icon-interim32.png \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ICONPATH)/security-icon-interim48.png \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson$(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class: ToBin.java
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(BOOT_JAVAC_CMD) -d $(TEMPDIR_CLASSES) $<
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson$(TEMPDIR)/.gen_icons: $(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class $(ICONS)
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson name=`$(ECHO) $$filename | $(TR) '\-.' '__'`; \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson classname=$(GEN_DIR)/XAWTIcon32_$$name.java; \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ECHO) "package sun.awt.X11;" >> $$classname ; \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ECHO) "public class XAWTIcon32_$$name {" >> $$classname; \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ECHO) "public static int[] $$name = { " >> $$classname; \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson classname=$(GEN_DIR)/XAWTIcon64_$$name.java; \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ECHO) "package sun.awt.X11;" >> $$classname ; \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ECHO) "public class XAWTIcon64_$$name {" >> $$classname; \
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson $(ECHO) "public static long[] $$name = { " >> $$classname; \