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