Makefile revision 196
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# This code is free software; you can redistribute it and/or modify it
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# under the terms of the GNU General Public License version 2 only, as
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# published by the Free Software Foundation.
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# This code is distributed in the hope that it will be useful, but WITHOUT
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# version 2 for more details (a copy is included in the LICENSE file that
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# accompanied this code).
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# You should have received a copy of the GNU General Public License version
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# 2 along with this work; if not, write to the Free Software Foundation,
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# CA 95054 USA or visit www.sun.com if you need additional information or
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# have any questions.
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# This makefile creates a build tree and lights off a build.
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# You can go back into the build tree and perform rebuilds or
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# incremental builds as desired. Be sure to reestablish
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# environment variable settings for LD_LIBRARY_PATH and JAVA_HOME.
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# The make process now relies on java and javac. These can be
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# specified either implicitly on the PATH, by setting the
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# (JDK-inherited) ALT_BOOTDIR environment variable to full path to a
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# JDK in which bin/java and bin/javac are present and working (e.g.,
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# /usr/local/java/jdk1.3/solaris), or via the (JDK-inherited)
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# default BOOTDIR path value. Note that one of ALT_BOOTDIR
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye# or BOOTDIR has to be set. We do *not* search javac, javah, rmic etc.
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# from the PATH.
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# JDI binding on SA produces two binaries:
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# 1. sa-jdi.jar - This is build before building libjvm[_g].so
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# Please refer to ./makefiles/sa.make
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# 2. libsaproc[_g].so - Native library for SA - This is built after
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# libjsig[_g].so (signal interposition library)
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# Please refer to ./makefiles/vm.make
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# If $(GAMMADIR)/agent dir is not present, SA components are not built.
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatleninclude $(GAMMADIR)/make/$(OSNAME)/makefiles/rules.make
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco $(OSNAME) $(ARCH) "*** ERROR: this platform does not support 64-bit compilers!")
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# The following renders pathnames in generated Makefiles valid on
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# machines other than the machine containing the build tree.
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# For example, let's say my build tree lives on /files12 on
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# exact.east.sun.com. This logic will cause GAMMADIR to begin with
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# We only do this on SunOS variants, for a couple of reasons:
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# * It is extremely rare that source trees exist on other systems
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# * It has been claimed that the Linux automounter is flakey, so
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# changing GAMMADIR in a way that exercises the automounter could
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# prove to be a source of unreliability in the build process.
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# Obviously, this Makefile is only relevant on SunOS boxes to begin
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# with, but the SunOS conditionalization will make it easier to
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# combine Makefiles in the future (assuming we ever do that).
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco # prepend current directory to relative pathnames.
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner # If NEW_GAMMADIR doesn't already start with "/net/":
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner ifeq ($(strip $(filter /net/%,$(NEW_GAMMADIR))),)
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen # prepend /net/$(HOST)
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen # remove /net/$(HOST) if name already began with /home/
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen # remove /net/$(HOST) if name already began with /java/
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen # remove /net/$(HOST) if name already began with /lab/
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen # Don't use the new value for GAMMADIR unless a file with the new
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen # name actually exists.
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# There is a (semi-) regular correspondence between make targets and actions:
60281ca3d1db22f5d2204e1be4975504853072a7Lubos Kosco# Target Tree Type Build Dir
60281ca3d1db22f5d2204e1be4975504853072a7Lubos Kosco# debug compiler2 <os>_<arch>_compiler2/debug
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# fastdebug compiler2 <os>_<arch>_compiler2/fastdebug
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco# jvmg compiler2 <os>_<arch>_compiler2/jvmg
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# optimized compiler2 <os>_<arch>_compiler2/optimized
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# profiled compiler2 <os>_<arch>_compiler2/profiled
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# product compiler2 <os>_<arch>_compiler2/product
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco# debug1 compiler1 <os>_<arch>_compiler1/debug
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco# fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# jvmg1 compiler1 <os>_<arch>_compiler1/jvmg
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# optimized1 compiler1 <os>_<arch>_compiler1/optimized
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# profiled1 compiler1 <os>_<arch>_compiler1/profiled
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# product1 compiler1 <os>_<arch>_compiler1/product
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# debugcore core <os>_<arch>_core/debug
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# fastdebugcore core <os>_<arch>_core/fastdebug
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# jvmgcore core <os>_<arch>_core/jvmg
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# optimizedcore core <os>_<arch>_core/optimized
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# profiledcore core <os>_<arch>_core/profiled
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# productcore core <os>_<arch>_core/product
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# What you get with each target:
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# fastdebug* - optimized compile, but with asserts enabled
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# jvmg* - "fat" libjvm_g - debug info linked into libjvm_g.so
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# optimized* - optimized compile, no asserts
9c4ded641ae76132f262728f5d64e30fb004ae47Lubos Kosco# profiled* - gprof
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# This target list needs to be coordinated with the usage message
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# in the build.sh script:
14a41f02433890d19b2f871156271e3388cd0845Jens ElknerTARGETS = debug jvmg fastdebug optimized profiled product
14a41f02433890d19b2f871156271e3388cd0845Jens ElknerSUBDIRS_C1 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler1/,$(TARGETS))
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders HatlenSUBDIRS_C2 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler2/,$(TARGETS))
14a41f02433890d19b2f871156271e3388cd0845Jens ElknerSUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS))
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders HatlenSUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
14a41f02433890d19b2f871156271e3388cd0845Jens ElknerSUBDIRS_KERNEL = $(addprefix $(OSNAME)_$(BUILDARCH)_kernel/,$(TARGETS))
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders HatlenTARGETS_CORE = $(addsuffix core,$(TARGETS))
14a41f02433890d19b2f871156271e3388cd0845Jens ElknerBUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
14a41f02433890d19b2f871156271e3388cd0845Jens ElknerBUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos KoscoBUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
14a41f02433890d19b2f871156271e3388cd0845Jens ElknerBUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner#-------------------------------------------------------------------------------
9a4361e23046cda58b9a5b8f4e11910dc433badaLubos Kosco# Could make everything by default, but that would take a while.
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner @echo "Try '$(MAKE) <target> ...' where <target> is one or more of"
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# We do not want people accidentally building on old systems (e.g. Linux 2.2.x,
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# Solaris 2.5.1, 2.6).
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen# Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.
14a41f02433890d19b2f871156271e3388cd0845Jens ElknerEMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlenifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),)
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner $(QUIETLY) >&2 echo "*** This OS is not supported:" `uname -a`; exit 1;
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# jvmti.make requires XSLT (J2SE 1.4.x or newer):
14a41f02433890d19b2f871156271e3388cd0845Jens ElknerXSLT_CHECK = $(RUN.JAVAP) javax.xml.transform.TransformerFactory
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner# If not found then fail fast.
echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \
$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs