Makefile revision 1772
486N/A#
486N/A# Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
486N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
486N/A#
486N/A# This code is free software; you can redistribute it and/or modify it
486N/A# under the terms of the GNU General Public License version 2 only, as
486N/A# published by the Free Software Foundation. Sun designates this
486N/A# particular file as subject to the "Classpath" exception as provided
486N/A# by Sun in the LICENSE file that accompanied this code.
486N/A#
486N/A# This code is distributed in the hope that it will be useful, but WITHOUT
486N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
486N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
486N/A# version 2 for more details (a copy is included in the LICENSE file that
486N/A# accompanied this code).
486N/A#
486N/A# You should have received a copy of the GNU General Public License version
486N/A# 2 along with this work; if not, write to the Free Software Foundation,
486N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
873N/A#
486N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
486N/A# CA 95054 USA or visit www.sun.com if you need additional information or
486N/A# have any questions.
486N/A#
486N/A
830N/A#
486N/A# Imports files exported by a hotspot build or provided from an external
486N/A# location into the OUTPUTDIR, and also primes the OUTPUTDIR with files
619N/A# that are provided inside this workspace.
619N/A#
619N/A# IMPORT_LIST contains the list of destination files that are copied
619N/A# from external places (outside this workspace).
619N/A#
619N/A# INTERNAL_IMPORT_LIST is the list of destination files from BUILDDIR.
619N/A#
619N/A
619N/ABUILDDIR = ../..
619N/APRODUCT = java
619N/Ainclude $(BUILDDIR)/common/Defs.gmk
619N/A
619N/ASERVER_LOCATION = server
619N/ACLIENT_LOCATION = client
619N/A
2650N/ADB_SUFFIX = _db
2650N/A
2650N/Aifeq ($(PLATFORM), windows)
486N/A LIB_LOCATION = $(BINDIR)
2650N/Aelse
486N/A LIB_LOCATION = $(LIBDIR)/$(LIBARCH)
1194N/Aendif
486N/A
1194N/AJVM_NAME = $(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX)
2650N/AJVMLIB_NAME = $(LIB_PREFIX)jvm.$(LIB_SUFFIX)
2650N/AJVMMAP_NAME = $(LIB_PREFIX)jvm.map
486N/AJVMPDB_NAME = $(LIB_PREFIX)jvm.pdb
2650N/ALIBJSIG_NAME = $(LIB_PREFIX)jsig.$(LIBRARY_SUFFIX)
619N/AJVMDB_NAME = $(LIB_PREFIX)jvm$(DB_SUFFIX).$(LIBRARY_SUFFIX)
2650N/A
2650N/ACLASSSHARINGDATA_DIR = $(BUILDDIR)/tools/sharing
2650N/A
2650N/A# Needed to do file copy
2650N/AABS_BUILDDIR :=$(call FullPath,$(BUILDDIR))
2650N/A
2650N/Aall: build
2650N/A
2650N/A# List of files created here or coming from BUILDDIR area (this workspace)
2650N/AINTERNAL_IMPORT_LIST = $(LIBDIR)/classlist
2650N/A
2650N/A# List of files coming from outside this workspace
2650N/AIMPORT_LIST = $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME) \
2650N/A $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt
619N/A
2650N/A# INCLUDE_SA is false on platforms where SA is not supported.
2650N/A# On platforms where it is supported, we want to allow it to
619N/A# not be present, at least temporarily. So,
486N/A# if the SA files (well, just sa-jdi.jar) do not exist
486N/A# in the HOTSPOT_IMPORT_PATH, then we won't build SA.
2650N/ASA_EXISTS := $(shell if [ -r $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar ] ; then \
2650N/A $(ECHO) true; \
486N/A else \
486N/A $(ECHO) false; \
486N/A fi)
486N/A
486N/Aifeq ($(SA_EXISTS), false)
486N/A INCLUDE_SA := false
486N/Aendif
486N/A
486N/Aifeq ($(INCLUDE_SA), true)
486N/A IMPORT_LIST += $(LIBDIR)/sa-jdi.jar \
486N/A $(LIB_LOCATION)/$(SALIB_NAME)
486N/A ifeq ($(PLATFORM), windows)
486N/A IMPORT_LIST += $(LIB_LOCATION)/$(SAMAP_NAME) \
486N/A $(LIB_LOCATION)/$(SAPDB_NAME)
486N/A endif
486N/Aendif # INCLUDE_SA
486N/A
486N/A# Hotspot client is only available on 32-bit non-Zero builds
486N/Aifneq ($(ZERO_BUILD), true)
486N/Aifeq ($(ARCH_DATA_MODEL), 32)
486N/A IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME) \
486N/A $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt
486N/Aendif
486N/Aendif
486N/A
486N/Aifeq ($(PLATFORM), windows)
486N/A# Windows vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Windows
486N/A
486N/AIMPORT_LIST += $(MS_RUNTIME_LIBRARIES:%=$(BINDIR)/%)
486N/A
486N/A# NOTE: These might actually come from BUILDDIR, depends on the settings.
486N/A$(BINDIR)/msvcrt.dll: $(MSVCRT_DLL_PATH)/msvcrt.dll
486N/A $(install-import-file)
486N/A $(CHMOD) a+x $@
536N/A$(BINDIR)/$(MSVCRNN_DLL): $(MSVCRNN_DLL_PATH)/$(MSVCRNN_DLL)
536N/A $(install-import-file)
536N/A $(CHMOD) a+x $@
536N/A
1181N/A# Get the hotspot .map and .pdb files for client and server
1181N/AIMPORT_LIST += \
1181N/A $(LIBDIR)/$(JVMLIB_NAME) \
2650N/A $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME) \
1181N/A $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME)
1181N/A
1603N/A# Add .map and .pdb files to the import path for client and kernel VMs.
2650N/A# These are only available on 32-bit windows builds.
1603N/Aifeq ($(ARCH_DATA_MODEL), 32)
1181N/A IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME) \
1181N/A $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME)
1181N/A ifeq ($(DO_KERNEL), true)
2650N/A IMPORT_LIST += $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME) \
1181N/A $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME)
1181N/A endif
1603N/Aendif
2650N/A
2650N/A$(LIBDIR)/$(JVMLIB_NAME): $(HOTSPOT_LIB_PATH)/$(JVMLIB_NAME)
1603N/A $(install-import-file)
1603N/A
1181N/A# it is OK for the .map and .pdb files to not exist, so do not force a
1181N/A# dependency on them from the bootstrap location, and allow the copy to fail.
1181N/A$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME):
536N/A @$(prep-target)
830N/A -$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMMAP_NAME) $@
830N/A
830N/A$(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME):
830N/A @$(prep-target)
830N/A -$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMMAP_NAME) $@
830N/A
2650N/A$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME):
830N/A @$(prep-target)
830N/A -$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@
830N/A
2296N/A$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME):
830N/A @$(prep-target)
961N/A -$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMPDB_NAME) $@
961N/A
961N/A$(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME):
486N/A @$(prep-target)
2650N/A -$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMPDB_NAME) $@
486N/A
486N/A$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME):
486N/A @$(prep-target)
486N/A -$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@
2296N/A
2296N/A# Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Windows
2650N/Aelse # PLATFORM
2296N/A# NOT Windows vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv NOT Windows
2296N/A
2650N/AIMPORT_LIST += \
2296N/A $(LIB_LOCATION)/$(LIBJSIG_NAME) \
2296N/A $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME)
2402N/A
2402N/Aifeq ($(PLATFORM), solaris)
2402N/A IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME)
2402N/Aendif
2650N/A
2402N/Aifneq ($(ZERO_BUILD), true)
2422N/Aifeq ($(ARCH_DATA_MODEL), 32)
2402N/A
2402N/AIMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME)
2402N/A
2402N/Aifeq ($(PLATFORM), solaris)
2402N/A# solaris vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv solaris
2402N/A
2402N/Aifeq ($(ARCH), sparc)
2402N/A IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME)
2402N/Aendif
486N/A
961N/AIMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME)
961N/A
961N/Aifeq ($(ARCH), sparc)
961N/A IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME)
961N/Aendif
961N/A
961N/A# For backwards compatability, make a link of the 32-bit client JVM to $(LIBDIR)
1024N/AIMPORT_LIST += $(LIB_LOCATION)/$(JVM_NAME)
2650N/A
961N/A# create a link from lib/libjvm.so to client/libjvm.so
961N/A$(LIB_LOCATION)/$(JVM_NAME): $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME)
961N/A @$(prep-target)
961N/A $(LN) -s $(CLIENT_LOCATION)/$(JVM_NAME) $@
961N/A
961N/A# solaris ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ solaris
961N/Aendif # 32bit solaris
961N/A
961N/Aendif # 32bit
961N/A
486N/Aendif # ZERO_BUILD
# NOT Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NOT Windows
endif # PLATFORM
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_NAME)
$(install-import-file)
$(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVM_NAME): $(HOTSPOT_KERNEL_PATH)/$(JVM_NAME)
$(install-file)
$(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_SERVER_PATH)/$(LIBJSIG_NAME)
$(install-import-file)
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME) \
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME):
@$(prep-target)
$(LN) -s ../$(LIBJSIG_NAME) $@
$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_NAME)
$(install-import-file)
$(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDB_NAME)
$(install-import-file)
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME)
$(install-import-file)
$(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)
$(install-import-file)
$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_NAME)
$(install-import-file)
$(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt : $(HOTSPOT_SERVER_PATH)/Xusage.txt
$(install-import-file)
$(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt : $(HOTSPOT_CLIENT_PATH)/Xusage.txt
$(install-import-file)
$(LIB_LOCATION)/$(KERNEL_LOCATION)/Xusage.txt : $(HOTSPOT_KERNEL_PATH)/Xusage.txt
$(install-file)
ifeq ($(INCLUDE_SA), true)
# The Serviceability Agent is built in the Hotspot workspace.
# It contains two files:
# - sa-jdi.jar: This goes into the same dir as tools.jar.
# - a shared library: sawindbg.dll on windows / libproc.sa on unix
# This goes into the same dir as the other
# shared libs, eg. libjdwp.so.
$(LIBDIR)/sa-jdi.jar: $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar
$(install-import-file)
$(LIB_LOCATION)/$(SALIB_NAME): $(HOTSPOT_SALIB_PATH)/$(SALIB_NAME)
$(install-import-file)
ifeq ($(PLATFORM), windows)
$(LIB_LOCATION)/$(SAPDB_NAME): $(HOTSPOT_SALIB_PATH)/$(SAPDB_NAME)
$(install-import-file)
$(LIB_LOCATION)/$(SAMAP_NAME): $(HOTSPOT_SALIB_PATH)/$(SAMAP_NAME)
$(install-import-file)
endif # windows
endif # INCLUDE_SA
#
# Specific to OpenJDK building
#
ifdef OPENJDK
ifeq ($(IMPORT_BINARY_PLUGS),true)
include $(BUILDDIR)/common/internal/BinaryPlugs.gmk
build: import-binary-plugs
endif
else # !OPENJDK
INTERNAL_IMPORT_LIST += \
$(LIBDIR)/security/US_export_policy.jar \
$(LIBDIR)/security/local_policy.jar \
$(LIBDIR)/jce.jar
$(LIBDIR)/jce.jar: \
$(BUILDDIR)/closed/tools/crypto/jce/jce.jar
$(install-file)
$(LIBDIR)/security/US_export_policy.jar: \
$(BUILDDIR)/closed/tools/crypto/jce/US_export_policy.jar
$(install-file)
$(LIBDIR)/security/local_policy.jar: \
$(BUILDDIR)/closed/tools/crypto/jce/local_policy.jar
$(install-file)
endif # OPENJDK
ADDJSUM_JARFILE = $(BUILDTOOLJARDIR)/addjsum.jar
# Construct classlist file
$(LIBDIR)/classlist: \
$(CLASSSHARINGDATA_DIR)/classlist.$(PLATFORM) \
$(ADDJSUM_JARFILE)
@$(prep-target)
@$(RM) -f $@.temp
$(BOOT_JAVA_CMD) -jar $(ADDJSUM_JARFILE) \
$(CLASSSHARINGDATA_DIR)/classlist.$(PLATFORM) $@.temp
$(MV) $@.temp $@
ifndef OPENJDK
# Lucida font files are not included in the OpenJDK distribution.
# Get names of font files
include FILES.gmk
# Copy font files into OUTPUTDIR area
FONTFILES = $(SHARED_FONTFILES)
FONTSDIR = $(LIBDIR)/fonts
FONTSDIRFILE = $(FONTSDIR)/fonts.dir
INTERNAL_IMPORT_LIST += $(FONTFILES)
ifneq ($(PLATFORM), windows)
INTERNAL_IMPORT_LIST += $(FONTSDIRFILE)
endif
$(LIBDIR)/fonts/%.ttf: $(CLOSED_SRC)/share/lib/fonts/%.ttf
$(install-file)
$(FONTSDIRFILE): $(PLATFORM_SRC)/classes/sun/awt/motif/java.fonts.dir
$(install-file)
ifeq ($(PLATFORM), linux)
# The oblique fonts are only needed/wanted on Linux.
OBLFONTSDIR = $(LIBDIR)/oblique-fonts
OBLFONTSDIRFILE = $(OBLFONTSDIR)/fonts.dir
INTERNAL_IMPORT_LIST += $(OBLIQUE_FONTFILES) $(OBLFONTSDIRFILE)
$(LIBDIR)/oblique-fonts/%.ttf: $(CLOSED_SRC)/share/lib/fonts/oblique/%.ttf
$(install-file)
$(OBLFONTSDIRFILE): $(PLATFORM_SRC)/classes/sun/awt/motif/java.oblique-fonts.dir
$(install-file)
endif # linux
endif # !OPENJDK
# Import internal files (ones that are stashed in this source tree)
import_internal_files : $(INTERNAL_IMPORT_LIST)
# Import files from the JDK that we are not building
import_files: $(IMPORT_LIST)
# Get component information variables and rules
include $(BUILDDIR)/common/internal/ImportComponents.gmk
# Security files we need to import
SEC_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/sec-bin.zip
SEC_FILES_WIN_ZIP=$(ABS_BUILDDIR)/tools/crypto/sec-windows-bin.zip
JGSS_WIN32_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/jgss-windows-i586-bin.zip
JGSS_WIN64_FILES_ZIP=$(ABS_BUILDDIR)/tools/crypto/jgss-windows-x64-bin.zip
# Unzip zip file $2 into directory $1 (if $2 exists)
# Warning: $2 must be absolute path not relative
define SecUnzipper
if [ -f $2 ] ; then \
$(MKDIR) -p $1; \
$(ECHO) "( $(CD) $1 && $(UNZIP) -o $2 )"; \
( $(CD) $1 && $(UNZIP) -o $2 ); \
fi
endef
# If sec-bin exists, unpack it into the build directory
# Also, the library recompile build indirectly depends on two SSL classes,
# so copy those as well FIXUP
# if sec-windows-bin exists, unpack it into the build directory
# if JGSS files exists, unpack it into the build directory
$(TEMPDIR)/security_imported:
@$(prep-target)
@$(call SecUnzipper,$(OUTPUTDIR),$(SEC_FILES_ZIP))
ifeq ($(PLATFORM), windows)
@$(call SecUnzipper,$(OUTPUTDIR),$(SEC_FILES_WIN_ZIP))
endif
ifeq ($(PLATFORM), windows)
ifeq ($(ARCH_DATA_MODEL), 32)
@$(call SecUnzipper,$(OUTPUTDIR),$(JGSS_WIN32_FILES_ZIP))
else
@$(call SecUnzipper,$(OUTPUTDIR),$(JGSS_WIN64_FILES_ZIP))
endif
endif
@$(ECHO) "Imported on `$(DATE)`" > $@
# Import all files from other components
$(TEMPDIR)/components_imported:
@$(prep-target)
$(call import-component-binaries,$(ABS_OUTPUTDIR))
$(call import-component-sources,$(IMPORTSRCDIR))
$(call import-component-docs,$(IMPORTDOCDIR))
$(call import-component-classes,$(CLASSDESTDIR))
@$(ECHO) "Imported on `$(DATE)`" > $@
# Do pretty much everything
build : import_files \
import_internal_files \
$(TEMPDIR)/components_imported \
$(TEMPDIR)/security_imported
# Clean up what we imported (except for component files)
clean clobber::
$(RM) $(IMPORT_LIST)
$(RM) $(INTERNAL_IMPORT_LIST)
$(call import-component-sources-clean,$(IMPORTSRCDIR))
$(call import-component-docs-clean,$(IMPORTDOCDIR))
$(call import-component-classes-clean,$(CLASSDESTDIR))
$(RM) $(TEMPDIR)/components_imported
$(RM) $(TEMPDIR)/security_imported
.PHONY: import_files import_internal_files