0N/A#
3364N/A# Copyright (c) 1999, 2012, 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.
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#
1472N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A# or visit www.oracle.com if you need additional information or have any
1472N/A# questions.
1703N/A#
0N/A#
0N/A
0N/A# This makefile creates a build tree and lights off a build.
0N/A# You can go back into the build tree and perform rebuilds or
0N/A# incremental builds as desired. Be sure to reestablish
0N/A# environment variable settings for LD_LIBRARY_PATH and JAVA_HOME.
0N/A
0N/A# The make process now relies on java and javac. These can be
0N/A# specified either implicitly on the PATH, by setting the
0N/A# (JDK-inherited) ALT_BOOTDIR environment variable to full path to a
0N/A# JDK in which bin/java and bin/javac are present and working (e.g.,
0N/A# /usr/local/java/jdk1.3/solaris), or via the (JDK-inherited)
0N/A# default BOOTDIR path value. Note that one of ALT_BOOTDIR
0N/A# or BOOTDIR has to be set. We do *not* search javac, javah, rmic etc.
0N/A# from the PATH.
0N/A#
0N/A# One can set ALT_BOOTDIR or BOOTDIR to point to a jdk that runs on
0N/A# an architecture that differs from the target architecture, as long
0N/A# as the bootstrap jdk runs under the same flavor of OS as the target
0N/A# (i.e., if the target is linux, point to a jdk that runs on a linux
0N/A# box). In order to use such a bootstrap jdk, set the make variable
0N/A# REMOTE to the desired remote command mechanism, e.g.,
0N/A#
0N/A# make REMOTE="rsh -l me myotherlinuxbox"
0N/A
1703N/A# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
1703N/A# JDI binding on SA produces two binaries:
0N/A# 1. sa-jdi.jar - This is build before building libjvm[_g].so
0N/A# Please refer to ./makefiles/sa.make
0N/A# 2. libsa[_g].so - Native library for SA - This is built after
0N/A# libjsig[_g].so (signal interposition library)
1703N/A# Please refer to ./makefiles/vm.make
0N/A# If $(GAMMADIR)/agent dir is not present, SA components are not built.
0N/A
0N/Aifeq ($(GAMMADIR),)
0N/Ainclude ../../make/defs.make
0N/Aelse
0N/Ainclude $(GAMMADIR)/make/defs.make
0N/Aendif
91N/Ainclude $(GAMMADIR)/make/$(OSNAME)/makefiles/rules.make
0N/A
0N/Aifndef CC_INTERP
1838N/A ifndef FORCE_TIERED
1838N/A FORCE_TIERED=1
1838N/A endif
0N/Aendif
0N/A
0N/Aifdef LP64
0N/A ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
0N/A _JUNK_ := $(shell echo >&2 \
0N/A $(OSNAME) $(ARCH) "*** ERROR: this platform does not support 64-bit compilers!")
0N/A @exit 1
0N/A endif
0N/Aendif
0N/A
0N/A# we need to set up LP64 correctly to satisfy sanity checks in adlc
0N/Aifneq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
0N/A MFLAGS += " LP64=1 "
0N/Aendif
0N/A
50N/A# pass USE_SUNCC further, through MFLAGS
50N/Aifdef USE_SUNCC
50N/A MFLAGS += " USE_SUNCC=1 "
50N/Aendif
50N/A
0N/A# The following renders pathnames in generated Makefiles valid on
0N/A# machines other than the machine containing the build tree.
0N/A#
0N/A# For example, let's say my build tree lives on /files12 on
0N/A# exact.east.sun.com. This logic will cause GAMMADIR to begin with
0N/A# /net/exact/files12/...
0N/A#
0N/A# We only do this on SunOS variants, for a couple of reasons:
0N/A# * It is extremely rare that source trees exist on other systems
0N/A# * It has been claimed that the Linux automounter is flakey, so
0N/A# changing GAMMADIR in a way that exercises the automounter could
0N/A# prove to be a source of unreliability in the build process.
0N/A# Obviously, this Makefile is only relevant on SunOS boxes to begin
0N/A# with, but the SunOS conditionalization will make it easier to
0N/A# combine Makefiles in the future (assuming we ever do that).
0N/A
0N/Aifeq ($(OSNAME),solaris)
0N/A
0N/A # prepend current directory to relative pathnames.
0N/A NEW_GAMMADIR := \
0N/A $(shell echo $(GAMMADIR) | \
0N/A sed -e "s=^\([^/].*\)=$(shell pwd)/\1=" \
0N/A )
0N/A unexport NEW_GAMMADIR
0N/A
0N/A # If NEW_GAMMADIR doesn't already start with "/net/":
0N/A ifeq ($(strip $(filter /net/%,$(NEW_GAMMADIR))),)
0N/A # prepend /net/$(HOST)
0N/A # remove /net/$(HOST) if name already began with /home/
0N/A # remove /net/$(HOST) if name already began with /java/
0N/A # remove /net/$(HOST) if name already began with /lab/
0N/A NEW_GAMMADIR := \
0N/A $(shell echo $(NEW_GAMMADIR) | \
0N/A sed -e "s=^\(.*\)=/net/$(HOST)\1=" \
0N/A -e "s=^/net/$(HOST)/home/=/home/=" \
0N/A -e "s=^/net/$(HOST)/java/=/java/=" \
0N/A -e "s=^/net/$(HOST)/lab/=/lab/=" \
0N/A )
0N/A # Don't use the new value for GAMMADIR unless a file with the new
0N/A # name actually exists.
0N/A ifneq ($(wildcard $(NEW_GAMMADIR)),)
0N/A GAMMADIR := $(NEW_GAMMADIR)
0N/A endif
0N/A endif
0N/A
0N/Aendif
0N/A
1010N/A# BUILDARCH is set to "zero" for Zero builds. VARIANTARCH
1010N/A# is used to give the build directories meaningful names.
1010N/AVARIANTARCH = $(subst i386,i486,$(ZERO_LIBARCH))
0N/A
0N/A# There is a (semi-) regular correspondence between make targets and actions:
0N/A#
0N/A# Target Tree Type Build Dir
0N/A#
0N/A# debug compiler2 <os>_<arch>_compiler2/debug
0N/A# fastdebug compiler2 <os>_<arch>_compiler2/fastdebug
0N/A# jvmg compiler2 <os>_<arch>_compiler2/jvmg
0N/A# optimized compiler2 <os>_<arch>_compiler2/optimized
0N/A# profiled compiler2 <os>_<arch>_compiler2/profiled
0N/A# product compiler2 <os>_<arch>_compiler2/product
0N/A#
0N/A# debug1 compiler1 <os>_<arch>_compiler1/debug
0N/A# fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug
0N/A# jvmg1 compiler1 <os>_<arch>_compiler1/jvmg
0N/A# optimized1 compiler1 <os>_<arch>_compiler1/optimized
0N/A# profiled1 compiler1 <os>_<arch>_compiler1/profiled
0N/A# product1 compiler1 <os>_<arch>_compiler1/product
0N/A#
0N/A# debugcore core <os>_<arch>_core/debug
0N/A# fastdebugcore core <os>_<arch>_core/fastdebug
0N/A# jvmgcore core <os>_<arch>_core/jvmg
0N/A# optimizedcore core <os>_<arch>_core/optimized
0N/A# profiledcore core <os>_<arch>_core/profiled
0N/A# productcore core <os>_<arch>_core/product
0N/A#
1010N/A# debugzero zero <os>_<arch>_zero/debug
1010N/A# fastdebugzero zero <os>_<arch>_zero/fastdebug
1010N/A# jvmgzero zero <os>_<arch>_zero/jvmg
1010N/A# optimizedzero zero <os>_<arch>_zero/optimized
1010N/A# profiledzero zero <os>_<arch>_zero/profiled
1010N/A# productzero zero <os>_<arch>_zero/product
1010N/A#
1612N/A# debugshark shark <os>_<arch>_shark/debug
1612N/A# fastdebugshark shark <os>_<arch>_shark/fastdebug
1612N/A# jvmgshark shark <os>_<arch>_shark/jvmg
1612N/A# optimizedshark shark <os>_<arch>_shark/optimized
1612N/A# profiledshark shark <os>_<arch>_shark/profiled
1612N/A# productshark shark <os>_<arch>_shark/product
1612N/A#
0N/A# What you get with each target:
0N/A#
0N/A# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
0N/A# fastdebug* - optimized compile, but with asserts enabled
0N/A# jvmg* - "fat" libjvm_g - debug info linked into libjvm_g.so
0N/A# optimized* - optimized compile, no asserts
0N/A# profiled* - gprof
0N/A# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
0N/A
0N/A# This target list needs to be coordinated with the usage message
0N/A# in the build.sh script:
0N/ATARGETS = debug jvmg fastdebug optimized profiled product
0N/A
3617N/Aifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
1010N/A SUBDIR_DOCS = $(OSNAME)_$(VARIANTARCH)_docs
1010N/Aelse
1010N/A SUBDIR_DOCS = $(OSNAME)_$(BUILDARCH)_docs
1010N/Aendif
0N/ASUBDIRS_C1 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler1/,$(TARGETS))
0N/ASUBDIRS_C2 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler2/,$(TARGETS))
0N/ASUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS))
0N/ASUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
1010N/ASUBDIRS_ZERO = $(addprefix $(OSNAME)_$(VARIANTARCH)_zero/,$(TARGETS))
1612N/ASUBDIRS_SHARK = $(addprefix $(OSNAME)_$(VARIANTARCH)_shark/,$(TARGETS))
0N/A
0N/ATARGETS_C2 = $(TARGETS)
0N/ATARGETS_C1 = $(addsuffix 1,$(TARGETS))
0N/ATARGETS_TIERED = $(addsuffix tiered,$(TARGETS))
0N/ATARGETS_CORE = $(addsuffix core,$(TARGETS))
1010N/ATARGETS_ZERO = $(addsuffix zero,$(TARGETS))
1612N/ATARGETS_SHARK = $(addsuffix shark,$(TARGETS))
0N/A
91N/ABUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
2073N/ABUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
0N/ABUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
3364N/ABUILDTREE_VARS += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS) OBJCOPY=$(OBJCOPY) STRIP_POLICY=$(STRIP_POLICY) ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES) ZIPEXE=$(ZIPEXE)
0N/A
0N/ABUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
0N/A
0N/A#-------------------------------------------------------------------------------
0N/A
0N/A# Could make everything by default, but that would take a while.
0N/Aall:
0N/A @echo "Try '$(MAKE) <target> ...' where <target> is one or more of"
0N/A @echo " $(TARGETS_C2)"
0N/A @echo " $(TARGETS_C1)"
0N/A @echo " $(TARGETS_CORE)"
1010N/A @echo " $(TARGETS_ZERO)"
1612N/A @echo " $(TARGETS_SHARK)"
0N/A
0N/Achecks: check_os_version check_j2se_version
0N/A
0N/A# We do not want people accidentally building on old systems (e.g. Linux 2.2.x,
0N/A# Solaris 2.5.1, 2.6).
0N/A# Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.
0N/A
2647N/ASUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3%
0N/AOS_VERSION := $(shell uname -r)
0N/AEMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
0N/A
0N/Acheck_os_version:
0N/Aifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),)
0N/A $(QUIETLY) >&2 echo "*** This OS is not supported:" `uname -a`; exit 1;
0N/Aendif
0N/A
0N/A# jvmti.make requires XSLT (J2SE 1.4.x or newer):
0N/AXSLT_CHECK = $(REMOTE) $(RUN.JAVAP) javax.xml.transform.TransformerFactory
0N/A# If not found then fail fast.
0N/Acheck_j2se_version:
0N/A $(QUIETLY) $(XSLT_CHECK) > /dev/null 2>&1; \
0N/A if [ $$? -ne 0 ]; then \
0N/A $(REMOTE) $(RUN.JAVA) -version; \
0N/A echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \
0N/A "to bootstrap this build" 1>&2; \
0N/A exit 1; \
0N/A fi
0N/A
0N/A$(SUBDIRS_TIERED): $(BUILDTREE_MAKE)
91N/A $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
0N/A $(BUILDTREE) VARIANT=tiered
0N/A
0N/A$(SUBDIRS_C2): $(BUILDTREE_MAKE)
1838N/Aifeq ($(FORCE_TIERED),1)
91N/A $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
0N/A $(BUILDTREE) VARIANT=tiered FORCE_TIERED=1
0N/Aelse
91N/A $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
0N/A $(BUILDTREE) VARIANT=compiler2
0N/Aendif
0N/A
0N/A$(SUBDIRS_C1): $(BUILDTREE_MAKE)
91N/A $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
0N/A $(BUILDTREE) VARIANT=compiler1
0N/A
0N/A$(SUBDIRS_CORE): $(BUILDTREE_MAKE)
91N/A $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
0N/A $(BUILDTREE) VARIANT=core
0N/A
1010N/A$(SUBDIRS_ZERO): $(BUILDTREE_MAKE) platform_zero
1010N/A $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
1010N/A $(BUILDTREE) VARIANT=zero VARIANTARCH=$(VARIANTARCH)
1010N/A
1612N/A$(SUBDIRS_SHARK): $(BUILDTREE_MAKE) platform_zero
1612N/A $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
1612N/A $(BUILDTREE) VARIANT=shark VARIANTARCH=$(VARIANTARCH)
1612N/A
1010N/Aplatform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
1010N/A $(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@
1010N/A
0N/A# Define INSTALL=y at command line to automatically copy JVM into JAVA_HOME
0N/A
0N/A$(TARGETS_C2): $(SUBDIRS_C2)
0N/A cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
0N/A cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
0N/Aifdef INSTALL
0N/A cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
0N/Aendif
0N/A
0N/A$(TARGETS_TIERED): $(SUBDIRS_TIERED)
0N/A cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
0N/A cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
0N/Aifdef INSTALL
0N/A cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
0N/Aendif
0N/A
0N/A$(TARGETS_C1): $(SUBDIRS_C1)
0N/A cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
0N/A cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
0N/Aifdef INSTALL
0N/A cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
0N/Aendif
0N/A
0N/A$(TARGETS_CORE): $(SUBDIRS_CORE)
0N/A cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
0N/A cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
0N/Aifdef INSTALL
0N/A cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
0N/Aendif
0N/A
1010N/A$(TARGETS_ZERO): $(SUBDIRS_ZERO)
1010N/A cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
1010N/A cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
1010N/Aifdef INSTALL
1010N/A cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
1010N/Aendif
1010N/A
1612N/A$(TARGETS_SHARK): $(SUBDIRS_SHARK)
1612N/A cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS)
1612N/A cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && ./test_gamma
1612N/Aifdef INSTALL
1612N/A cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
1612N/Aendif
1612N/A
0N/A# Just build the tree, and nothing else:
0N/Atree: $(SUBDIRS_C2)
0N/Atree1: $(SUBDIRS_C1)
0N/Atreecore: $(SUBDIRS_CORE)
1010N/Atreezero: $(SUBDIRS_ZERO)
1612N/Atreeshark: $(SUBDIRS_SHARK)
0N/A
0N/A# Doc target. This is the same for all build options.
0N/A# Hence create a docs directory beside ...$(ARCH)_[...]
3365N/A# We specify 'BUILD_FLAVOR=product' so that the proper
3365N/A# ENABLE_FULL_DEBUG_SYMBOLS value is used.
0N/Adocs: checks
0N/A $(QUIETLY) mkdir -p $(SUBDIR_DOCS)
3365N/A $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) BUILD_FLAVOR=product jvmtidocs
0N/A
0N/A# Synonyms for win32-like targets.
0N/Acompiler2: jvmg product
0N/A
0N/Acompiler1: jvmg1 product1
0N/A
0N/Acore: jvmgcore productcore
0N/A
1010N/Azero: jvmgzero productzero
1010N/A
1612N/Ashark: jvmgshark productshark
1612N/A
0N/Aclean_docs:
0N/A rm -rf $(SUBDIR_DOCS)
0N/A
1612N/Aclean_compiler1 clean_compiler2 clean_core clean_zero clean_shark:
0N/A rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@)
0N/A
1612N/Aclean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_docs
0N/A
2388N/Ainclude $(GAMMADIR)/make/cscope.make
0N/A
0N/A#-------------------------------------------------------------------------------
0N/A
1612N/A.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK)
1612N/A.PHONY: tree tree1 treecore treezero treeshark
1612N/A.PHONY: all compiler1 compiler2 core zero shark
1612N/A.PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark docs clean_docs
0N/A.PHONY: checks check_os_version check_j2se_version