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