Makefile revision 3876
0N/A#
0N/A# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation. Oracle designates this
0N/A# particular file as subject to the "Classpath" exception as provided
0N/A# by Oracle in the LICENSE file that accompanied this code.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
0N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0N/A# or visit www.oracle.com if you need additional information or have any
0N/A# questions.
0N/A#
0N/A
0N/ABUILDDIR = ../..
0N/APACKAGE = sun.awt.X11
0N/ALIBRARY = mawt
0N/ALIBRARY_OUTPUT = xawt
0N/ALIB_LOCATION = $(LIBDIR)/$(LIBARCH)/xawt
0N/APRODUCT = sun
0N/A
0N/Ainclude $(BUILDDIR)/common/Defs.gmk
0N/A
0N/AGEN_DIR=$(GENSRCDIR)/sun/awt/X11
0N/A
0N/ACLASSES_INIT += $(TEMPDIR)/.gen.wrappers $(TEMPDIR)/.gen_icons touch.wrappers
0N/A
0N/A.PHONY: generated.clean
0N/A
0N/A#
0N/A# Files
0N/A#
0N/Ainclude FILES_c_unix.gmk
0N/Ainclude FILES_export_unix.gmk
0N/AAUTO_FILES_JAVA_DIRS = sun/awt/X11
0N/AAUTO_JAVA_PRUNE = WrapperGenerator.java
0N/A
0N/ALDFLAGS += -L$(OPENWIN_LIB)
0N/A
0N/A# For Xrender extension.
0N/Aifeq ($(PLATFORM), solaris)
0N/ALDFLAGS += -L/usr/openwin/sfw/lib$(ISA_DIR) -R/usr/openwin/sfw/lib$(ISA_DIR)
0N/Aendif
0N/A
0N/Aifeq ($(PLATFORM), linux)
0N/ALDFLAGS += -lpthread
0N/Adummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
0N/Aendif
0N/A
0N/A# Since this library will be living in a subdirectory below the other libraries
0N/A# we need to add an extra runpath so that libraries in the upper directory
0N/A# are found at runtime.
0N/ALD_RUNPATH_EXTRAS = ..
0N/A
0N/A#
0N/A# Rules.
0N/A#
0N/Ainclude $(BUILDDIR)/common/Mapfile-vers.gmk
0N/Ainclude $(BUILDDIR)/common/Library.gmk
0N/A
0N/A#
0N/A# Add to the ambient vpath to pick up files in subdirectories
0N/A#
0N/Avpath %.c $(SHARE_SRC)/native/sunawt/alphacomposite
0N/Avpath %.c $(PLATFORM_SRC)/native/sun/xawt
0N/Avpath %.c $(PLATFORM_SRC)/native/sun/awt
0N/Avpath %.c $(SHARE_SRC)/native/sun/awt/debug
0N/Avpath %.c $(SHARE_SRC)/native/sun/awt/image
0N/Avpath %.c $(SHARE_SRC)/native/sun/awt/image/gif
0N/Avpath %.c $(SHARE_SRC)/native/sun/awt/image/cvutils
0N/Avpath %.c $(SHARE_SRC)/native/sun/awt/shell
0N/Avpath %.c $(SHARE_SRC)/native/sun/java2d
0N/Avpath %.c $(SHARE_SRC)/native/sun/java2d/loops
0N/Avpath %.c $(SHARE_SRC)/native/sun/java2d/pipe
0N/Avpath %.c $(SHARE_SRC)/native/sun/awt/medialib
0N/Avpath %.c $(SHARE_SRC)/native/sun/awt/utility
0N/Avpath %.cpp $(SHARE_SRC)/native/sun/image
0N/Avpath %.c $(SHARE_SRC)/native/sun/font
0N/Avpath %.c $(PLATFORM_SRC)/native/sun/awt/robot_child
0N/Avpath %.c $(SHARE_SRC)/native/sun/java2d/opengl
0N/Avpath %.c $(PLATFORM_SRC)/native/sun/java2d/opengl
0N/Avpath %.c $(PLATFORM_SRC)/native/sun/java2d/x11
0N/A
0N/AOTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -lXrender -ldl \
0N/A $(LDFLAGS_COMMON) $(AWT_RUNPATH) $(OTHER_LDFLAGS) -lXtst -lXi
0N/A
0N/Aifeq ($(PLATFORM), solaris)
0N/ACPPFLAGS += -DFUNCPROTO=15
0N/Adummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
0N/Aendif
0N/A
0N/ACPPFLAGS += -I$(CUPS_HEADERS_PATH)
0N/A
0N/ACPPFLAGS += -DXAWT -DXAWT_HACK \
0N/A -I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders \
0N/A -I$(PLATFORM_SRC)/native/sun/awt \
0N/A -I$(PLATFORM_SRC)/native/sun/xawt \
0N/A -I$(PLATFORM_SRC)/native/sun/jdga \
-I$(SHARE_SRC)/native/sun/awt/debug \
-I$(SHARE_SRC)/native/sun/awt/image/cvutils \
-I$(SHARE_SRC)/native/sun/java2d \
-I$(SHARE_SRC)/native/sun/java2d/loops \
-I$(SHARE_SRC)/native/sun/awt/image/cvutils \
-I$(SHARE_SRC)/native/sun/awt/image \
-I$(SHARE_SRC)/native/sun/font \
-I$(PLATFORM_SRC)/native/sun/java2d \
-I$(SHARE_SRC)/native/sun/java2d/pipe \
-I$(SHARE_SRC)/native/sun/java2d/opengl \
-I$(PLATFORM_SRC)/native/sun/java2d/opengl \
-I$(PLATFORM_SRC)/native/sun/java2d/x11 \
-I$(SHARE_SRC)/native/sun/dc/path \
-I$(SHARE_SRC)/native/sun/dc/doe \
-I$(SHARE_SRC)/native/sun/awt/alphacomposite \
-I$(SHARE_SRC)/native/sun/awt/medialib \
-I$(PLATFORM_SRC)/native/sun/awt/medialib \
-I$(PLATFORM_SRC)/native/sun/font \
-I$(SHARE_SRC)/native/sun/awt \
-I$(PLATFORM_SRC)/native/sun/awt
ifeq ($(PLATFORM), linux)
ifndef CROSS_COMPILE_ARCH
# Allows for builds on Debian GNU Linux, X11 is in a different place
# This should really be handled at a higher-level so we don't have to
# work-around this when cross-compiling
CPPFLAGS += -I/usr/X11R6/include/X11/extensions \
-I/usr/include/X11/extensions \
-I$(OPENWIN_HOME)/include
else
CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \
-I$(OPENWIN_HOME)/include
endif
endif
# We have some odd logic here because some Solaris 10 updates
# have a render.h file that suggests gradients are supported, but
# the Xrender.h doesn't have the corresponding type definitions.
# Earlier updates have neither. We'd like to know if there's a mismatch.
# Whilst in the C preprocessor we can tell if the render.h define's are set
# we can't tell anything about C declarations.
# A grep of Xrender.h is the only way to know this. If they are absent
# we will set a flag indicating this mismatch and the JDK source file
# will interpret it to resolve the problem.
ifeq ($(PLATFORM), solaris)
CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions
OS_VERSION := $(shell uname -r)
XRENDER_H := $(OPENWIN_HOME)/share/include/X11/extensions/Xrender.h
ifeq ($(OS_VERSION),5.10)
LINEARGRADIENT_CNT := $(shell $(EGREP) -c XLinearGradient $(XRENDER_H))
ifeq ($(LINEARGRADIENT_CNT),0)
CFLAGS+= -DSOLARIS10_NO_XRENDER_STRUCTS
endif
endif
endif
ifeq ($(MILESTONE), internal)
CPPFLAGS += -DINTERNAL_BUILD
endif
#
# Generation of wrappers
#
SIZER_DIR=$(GEN_DIR)/generator
SIZER = $(SIZER_DIR)/sizer
SIZER_32_C = $(SIZER).32.c
SIZER_64_C = $(SIZER).64.c
CFLAGS_32=$(CFLAGS)
CFLAGS_64=$(CFLAGS)
ifeq ($(PLATFORM), solaris)
isalist:=$(shell $(ISAINFO))
ifneq (,$(findstring sparcv9, $(isalist)))
# On sparcv9 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
# On sparcv9 CFLAGS already contain $(XARCH_OPTION/64), so to generate 32-bit sizer we need to change this option.
CFLAGS_32=$(subst $(XARCH_OPTION/64),$(XARCH_OPTION/32),$(CFLAGS))
SIZERS = $(SIZER).32 $(SIZER).64
SIZERS_C = $(SIZER_32_C) $(SIZER_64_C)
SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64
CFLAGS_64=$(CFLAGS) $(XARCH_OPTION/64)
else
ifneq (,$(findstring amd64, $(isalist)))
# On amd64 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
# On amd64 CFLAGS already contain $(XARCH_OPTION/64), so to generate 32-bit sizer we need to change this option.
CFLAGS_32=$(subst $(XARCH_OPTION/64),$(XARCH_OPTION/32),$(CFLAGS))
SIZERS = $(SIZER).32 $(SIZER).64
SIZERS_C = $(SIZER_32_C) $(SIZER_64_C)
SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64
CFLAGS_64=$(CFLAGS) $(XARCH_OPTION/64)
else # !sparcv9 : includes (32-bit) sparc, i586
SIZERS = $(SIZER).32
SIZERS_C = $(SIZER_32_C)
SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32
endif # amd64
endif # sparcv9
else # !solaris
ifeq ($(ARCH_DATA_MODEL), 32)
SIZERS = $(SIZER).32
SIZERS_C = $(SIZER_32_C)
SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32
else # !32
SIZERS = $(SIZER).64
SIZERS_C = $(SIZER_64_C)
SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.64
endif # 32
endif # solaris
# XXX Hack for 6185483 - use hard-coded sizes.
# Add the 64-bit platforms that need to be included into 32-bit build
# and have sizes.64-$(PLATFORM)-$(LIBARCH) hardcoded in the workspace
ifeq ($(PLATFORM)-$(LIBARCH), solaris-i386)
# If you define DOHACK=true for some combination of $(PLATFORM)-$(LIBARCH),
# make sure you have sizes.64-$(PLATFORM)-$(LIBARCH) pre-generated in
# $(PLATFORM_SRC)/classes/sun/awt/X11/generator/
DOHACK=true
endif # Hack
ifeq ($(DOHACK), true)
PREDEFINED_SIZES_TMPL=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/sizes.64-$(PLATFORM)-$(LIBARCH)
PREDEFINED_SIZES=$(WRAPPER_GENERATOR_DIR)/sizes.64
SIZES += $(WRAPPER_GENERATOR_DIR)/sizes.64
endif
ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
DOCOMPARE=true
endif
# 64 bit sizers are generated on platform-libarch (left) for use
# on platform-libarch (right) and stored under the latter name.
# Do compare manually stored and automatically generated pair(s)
# if DOCOMPARE=true, just after the generation.
STORED_SIZES_TMPL_solaris_amd64=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/sizes.64-solaris-i386
WRAPPER_GENERATOR_JAVA=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/WrapperGenerator.java
WRAPPER_GENERATOR_DIR=$(GENSRCDIR)/sun/awt/X11/generator
WRAPPER_GENERATOR_TEMPDIR=$(TEMPDIR)/sun/awt/X11/generator
WRAPPER_GENERATOR_CLASS=$(WRAPPER_GENERATOR_TEMPDIR)/WrapperGenerator.class
XLIBTYPES=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/xlibtypes.txt
$(SIZERS): $(SIZERS_C)
$(prep-target)
ifndef CROSS_COMPILE_ARCH
$(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c
else
$(HOST_CC) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c
endif
$(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA)
$(prep-target)
$(BOOT_JAVAC_CMD) -d $(WRAPPER_GENERATOR_TEMPDIR) $(WRAPPER_GENERATOR_JAVA)
$(SIZERS_C): $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES)
$(prep-target)
$(MKDIR) -p $(WRAPPER_GENERATOR_TEMPDIR)
$(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \
$(SIZER_DIR) $(XLIBTYPES) "sizer" $(subst .,,$(suffix $(basename $@)))
$(SIZES): $(SIZERS)
@if [ "$(DOHACK)$@" = "true$(PREDEFINED_SIZES)" ]; then \
$(ECHO) COPYING $(PREDEFINED_SIZES_TMPL) into $@; \
$(CP) $(PREDEFINED_SIZES_TMPL) $@; \
$(CHMOD) +w $@;\
else \
$(ECHO) GENERATING $@; \
$(WRAPPER_GENERATOR_DIR)/sizer$(suffix $@) > $@; \
fi
@if [ "$(DOCOMPARE)$(suffix $@)" = "true.64" ]; then \
$(ECHO) COMPARING $@ and $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
$(DIFF) $@ $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
fi
$(TEMPDIR)/.gen.wrappers: $(SIZES) $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES)
$(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \
$(GEN_DIR) $(XLIBTYPES) "gen" $(WRAPPER_GENERATOR_DIR)/sizes
touch.wrappers: $(TEMPDIR)/.gen.wrappers
$(MKDIR) -p $(TEMPDIR)
$(TOUCH) $(TEMPDIR)/.gen.wrappers
generated.clean:
$(RM) -r $(WRAPPER_GENERATOR_TEMPDIR)
$(RM) -r $(WRAPPER_GENERATOR_DIR)
$(RM) -r $(GEN_DIR)/*.java
$(RM) -r $(TEMPDIR)/.gen_icons
ifdef OPENJDK
ICONS_PATH_PREFIX=$(PLATFORM_SRC)
else
ICONS_PATH_PREFIX=$(CLOSED_SRC)/solaris
endif
ICONS = \
$(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \
$(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \
$(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \
$(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
ICONPATH=$(PLATFORM_SRC)/classes/sun/awt/X11
ICONS += \
$(ICONPATH)/security-icon-bw16.png \
$(ICONPATH)/security-icon-interim16.png \
$(ICONPATH)/security-icon-yellow16.png \
$(ICONPATH)/security-icon-bw24.png \
$(ICONPATH)/security-icon-interim24.png \
$(ICONPATH)/security-icon-yellow24.png \
$(ICONPATH)/security-icon-bw32.png \
$(ICONPATH)/security-icon-interim32.png \
$(ICONPATH)/security-icon-yellow32.png \
$(ICONPATH)/security-icon-bw48.png \
$(ICONPATH)/security-icon-interim48.png \
$(ICONPATH)/security-icon-yellow48.png
TEMPDIR_CLASSES = $(TEMPDIR)/classes
$(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class: ToBin.java
@$(prep-target)
$(BOOT_JAVAC_CMD) -d $(TEMPDIR_CLASSES) $<
$(TEMPDIR)/.gen_icons: $(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class $(ICONS)
$(prep-target)
for i in $(ICONS); do \
filename=`basename $$i`; \
name=`$(ECHO) $$filename | $(TR) '\-.' '__'`; \
classname=$(GEN_DIR)/XAWTIcon32_$$name.java; \
$(RM) $$classname; \
$(ECHO) "package sun.awt.X11;" >> $$classname ; \
$(ECHO) "public class XAWTIcon32_$$name {" >> $$classname; \
$(ECHO) "public static int[] $$name = { " >> $$classname; \
$(CAT) $$i | \
$(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \
-Djava.awt.headless=true \
sun.awt.X11.ToBin >> $$classname; \
$(ECHO) "}; }" >> $$classname; \
classname=$(GEN_DIR)/XAWTIcon64_$$name.java; \
$(RM) $$classname; \
$(ECHO) "package sun.awt.X11;" >> $$classname ; \
$(ECHO) "public class XAWTIcon64_$$name {" >> $$classname; \
$(ECHO) "public static long[] $$name = { " >> $$classname; \
$(CAT) $$i | \
$(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \
-Djava.awt.headless=true \
sun.awt.X11.ToBin >> $$classname; \
$(ECHO) "}; }" >> $$classname; \
done
$(TOUCH) $@
clean clobber:: generated.clean
.PHONY: generated.clean robot_child